├── .github ├── dependabot.yml └── workflows │ ├── codeql-analysis.yml │ ├── docker-publish.yml │ ├── go.yml │ └── release.yml ├── .gitignore ├── .idea ├── .gitignore ├── LeziAPI.iml ├── dataSources.xml ├── jsonSchemas.xml ├── modules.xml └── vcs.xml ├── Dockerfile ├── LICENSE ├── README.md ├── bootstrap ├── app.go ├── init.go └── text ├── controller ├── global.go ├── namespace.go └── speaker.go ├── data.json ├── data_schema.json ├── go.mod ├── go.sum ├── main.go ├── middleware └── cors.go ├── model ├── client.go ├── default_settings.go ├── init.go ├── migrate.go ├── setting.go ├── setting_service.go ├── text.go ├── text_service.go ├── wire.go └── wire_gen.go ├── pkg ├── cache │ ├── driver.go │ ├── driver_test.go │ ├── memory.go │ ├── memory_test.go │ └── redis.go ├── conf │ ├── conf.go │ ├── data.go │ └── init.go ├── cron │ ├── init.go │ └── jobs │ │ └── data_jobs.go ├── hashids │ ├── hashids.go │ └── hashids_test.go ├── http │ ├── client.go │ └── request.go ├── log │ ├── format.go │ ├── format_test.go │ ├── gorm.go │ ├── gorm_test.go │ ├── init.go │ ├── init_test.go │ ├── logger.go │ └── logger_test.go ├── serializer │ ├── dto │ │ └── text_json.go │ ├── error_response.go │ ├── response.go │ └── vo │ │ └── text.go └── util │ ├── env.go │ ├── io.go │ ├── path.go │ └── random.go ├── routers ├── handles.go └── router.go └── services └── remote ├── data.go └── data_test.go /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "gomod" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ "master" ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ "master" ] 20 | schedule: 21 | - cron: '16 13 * * 6' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'go' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v3 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v2 46 | with: 47 | languages: ${{ matrix.language }} 48 | # If you wish to specify custom queries, you can do so here or in a config file. 49 | # By default, queries listed here will override any specified in a config file. 50 | # Prefix the list here with "+" to use these queries and those in the config file. 51 | 52 | # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 53 | # queries: security-extended,security-and-quality 54 | 55 | 56 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 57 | # If this step fails, then you should remove it and run the build manually (see below) 58 | - name: Autobuild 59 | uses: github/codeql-action/autobuild@v2 60 | 61 | # ℹ️ Command-line programs to run using the OS shell. 62 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun 63 | 64 | # If the Autobuild fails above, remove it and uncomment the following three lines. 65 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. 66 | 67 | # - run: | 68 | # echo "Run, Build Application using script" 69 | # ./location_of_script_within_repo/buildscript.sh 70 | 71 | - name: Perform CodeQL Analysis 72 | uses: github/codeql-action/analyze@v2 73 | -------------------------------------------------------------------------------- /.github/workflows/docker-publish.yml: -------------------------------------------------------------------------------- 1 | name: Docker 2 | 3 | # This workflow uses actions that are not certified by GitHub. 4 | # They are provided by a third-party and are governed by 5 | # separate terms of service, privacy policy, and support 6 | # documentation. 7 | 8 | on: 9 | push: 10 | branches: [ "master" ] 11 | # Publish semver tags as releases. 12 | pull_request: 13 | branches: [ "master" ] 14 | release: 15 | types: [ published ] 16 | 17 | env: 18 | # Use docker.io for Docker Hub if empty 19 | REGISTRY: ghcr.io 20 | # github.repository as / 21 | IMAGE_NAME: ${{ github.repository }} 22 | 23 | 24 | jobs: 25 | build: 26 | runs-on: ubuntu-latest 27 | 28 | permissions: 29 | contents: read 30 | packages: write 31 | # This is used to complete the identity challenge 32 | # with sigstore/fulcio when running outside of PRs. 33 | id-token: write 34 | 35 | steps: 36 | - name: Checkout repository 37 | uses: actions/checkout@v3 38 | 39 | # Install the cosign tool except on PR 40 | # https://github.com/sigstore/cosign-installer 41 | - name: Install cosign 42 | if: github.event_name != 'pull_request' 43 | uses: sigstore/cosign-installer@7e0881f8fe90b25e305bbf0309761e9314607e25 44 | with: 45 | cosign-release: 'v1.9.0' 46 | 47 | 48 | # Workaround: https://github.com/docker/build-push-action/issues/461 49 | - name: Setup Docker buildx 50 | uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf 51 | 52 | # Login against a Docker registry except on PR 53 | # https://github.com/docker/login-action 54 | - name: Log into registry ${{ env.REGISTRY }} 55 | if: github.event_name != 'pull_request' 56 | uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c 57 | with: 58 | registry: ${{ env.REGISTRY }} 59 | username: ${{ github.actor }} 60 | password: ${{ secrets.GITHUB_TOKEN }} 61 | 62 | # Extract metadata (tags, labels) for Docker 63 | # https://github.com/docker/metadata-action 64 | - name: Extract Docker metadata 65 | id: meta 66 | uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 67 | with: 68 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 69 | 70 | # Build and push Docker image with Buildx (don't push on PR) 71 | # https://github.com/docker/build-push-action 72 | - name: Build and push Docker image 73 | id: build-and-push 74 | uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a 75 | with: 76 | context: . 77 | push: ${{ github.event_name != 'pull_request' }} 78 | tags: ${{ steps.meta.outputs.tags }} 79 | labels: ${{ steps.meta.outputs.labels }} 80 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: Go 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | jobs: 10 | 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | 16 | - name: Set up Go 17 | uses: actions/setup-go@v3 18 | with: 19 | go-version: 1.19 20 | 21 | - name: Build 22 | run: go build . 23 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Go Release 2 | 3 | on: 4 | release: 5 | types: [ published ] 6 | workflow_dispatch: 7 | 8 | env: 9 | CGO_ENABLED: 1 10 | 11 | jobs: 12 | 13 | build: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | 18 | - name: Set up Go 19 | uses: actions/setup-go@v3 20 | with: 21 | go-version: 1.19 22 | 23 | - name: Add dependcies for CGO 24 | run: | 25 | sudo apt-get -y update 26 | sudo apt-get -y upgrade 27 | sudo apt-get -y install build-essential zip 28 | sudo apt-get -y install gcc-mingw-w64-x86-64 29 | sudo apt-get -y install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross 30 | sudo apt-get -y install gcc-aarch64-linux-gnu libc6-dev-arm64-cross 31 | 32 | - name: Wire inject 33 | run: go run github.com/google/wire/cmd/wire@latest ./... 34 | 35 | # Linux Amd64 36 | 37 | - name: Build (linux amd64) 38 | run: go build -a -o build/leziapi_linux_amd64 . 39 | env: 40 | GOOS: linux 41 | GOARCH: amd64 42 | CC: gcc 43 | 44 | - name: Upload a Build Artifact 45 | uses: actions/upload-artifact@v3.1.0 46 | with: 47 | name: leziapi_linux_amd64 48 | path: build/leziapi_linux_amd64 49 | retention-days: 7 50 | 51 | # Linux Arm64 52 | 53 | - name: Build (linux arm64) 54 | run: go build -a -o build/leziapi_linux_arm64 . 55 | env: 56 | GOOS: linux 57 | GOARCH: arm64 58 | CC: aarch64-linux-gnu-gcc 59 | 60 | - name: Upload a Build Artifact 61 | uses: actions/upload-artifact@v3.1.0 62 | with: 63 | name: leziapi_linux_arm64 64 | path: build/leziapi_linux_arm64 65 | retention-days: 7 66 | 67 | # Linux Arm 68 | 69 | - name: Build (linux arm) 70 | run: go build -a -o build/leziapi_linux_arm . 71 | env: 72 | GOOS: linux 73 | GOARCH: arm 74 | CC: arm-linux-gnueabihf-gcc 75 | 76 | - name: Upload a Build Artifact 77 | uses: actions/upload-artifact@v3.1.0 78 | with: 79 | name: leziapi_linux_arm 80 | path: build/leziapi_linux_arm 81 | retention-days: 7 82 | 83 | # Windows x86_64 84 | 85 | - name: Build (windows amd64) 86 | run: go build -a -o build/leziapi_windows_amd64.exe . 87 | env: 88 | GOOS: windows 89 | GOARCH: amd64 90 | CC: x86_64-w64-mingw32-gcc 91 | 92 | - name: Upload a Build Artifact 93 | uses: actions/upload-artifact@v3.1.0 94 | with: 95 | name: leziapi_windows_amd64 96 | path: build/leziapi_windows_amd64.exe 97 | retention-days: 7 98 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### App 2 | conf.ini 3 | /statics/ 4 | 5 | ### VisualStudioCode template 6 | .vscode/* 7 | !.vscode/settings.json 8 | !.vscode/tasks.json 9 | !.vscode/launch.json 10 | !.vscode/extensions.json 11 | *.code-workspace 12 | 13 | # Local History for Visual Studio Code 14 | .history/ 15 | 16 | ### JetBrains template 17 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 18 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 19 | 20 | # User-specific stuff 21 | .idea/**/workspace.xml 22 | .idea/**/tasks.xml 23 | .idea/**/usage.statistics.xml 24 | .idea/**/dictionaries 25 | .idea/**/shelf 26 | 27 | # Generated files 28 | .idea/**/contentModel.xml 29 | 30 | # Sensitive or high-churn files 31 | .idea/**/dataSources/ 32 | .idea/**/dataSources.ids 33 | .idea/**/dataSources.local.xml 34 | .idea/**/sqlDataSources.xml 35 | .idea/**/dynamic.xml 36 | .idea/**/uiDesigner.xml 37 | .idea/**/dbnavigator.xml 38 | 39 | # Gradle 40 | .idea/**/gradle.xml 41 | .idea/**/libraries 42 | 43 | # Gradle and Maven with auto-import 44 | # When using Gradle or Maven with auto-import, you should exclude module files, 45 | # since they will be recreated, and may cause churn. Uncomment if using 46 | # auto-import. 47 | # .idea/artifacts 48 | # .idea/compiler.xml 49 | # .idea/jarRepositories.xml 50 | # .idea/modules.xml 51 | # .idea/*.iml 52 | # .idea/modules 53 | # *.iml 54 | # *.ipr 55 | 56 | # CMake 57 | cmake-build-*/ 58 | 59 | # Mongo Explorer plugin 60 | .idea/**/mongoSettings.xml 61 | 62 | # File-based project format 63 | *.iws 64 | 65 | # IntelliJ 66 | out/ 67 | 68 | # mpeltonen/sbt-idea plugin 69 | .idea_modules/ 70 | 71 | # JIRA plugin 72 | atlassian-ide-plugin.xml 73 | 74 | # Cursive Clojure plugin 75 | .idea/replstate.xml 76 | 77 | # Crashlytics plugin (for Android Studio and IntelliJ) 78 | com_crashlytics_export_strings.xml 79 | crashlytics.properties 80 | crashlytics-build.properties 81 | fabric.properties 82 | 83 | # Editor-based Rest Client 84 | .idea/httpRequests 85 | 86 | # Android studio 3.1+ serialized cache file 87 | .idea/caches/build_file_checksums.ser 88 | 89 | ### Go template 90 | # Binaries for programs and plugins 91 | *.exe 92 | *.exe~ 93 | *.dll 94 | *.so 95 | *.dylib 96 | 97 | # Test binary, built with `go test -c` 98 | *.test 99 | 100 | # Output of the go coverage tool, specifically when used with LiteIDE 101 | *.out 102 | 103 | # Dependency directories (remove the comment below to include it) 104 | # vendor/ 105 | 106 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # 默认忽略的文件 2 | /shelf/ 3 | /workspace.xml 4 | # 基于编辑器的 HTTP 客户端请求 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /.idea/LeziAPI.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sqlite.xerial 6 | true 7 | org.sqlite.JDBC 8 | jdbc:sqlite:C:\Users\ahdar\Documents\Code\go\lezi-api\compiled\leziapi.db 9 | $ProjectFileDir$ 10 | 11 | 12 | file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.38.0/sqlite-jdbc-3.38.0.jar 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/jsonSchemas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine AS Builder 2 | WORKDIR /app/lezi-api/ 3 | 4 | RUN apk add build-base 5 | 6 | COPY . . 7 | RUN go mod download 8 | 9 | RUN go build -o leziapi . 10 | 11 | FROM alpine AS Runner 12 | WORKDIR /app/lezi-api/ 13 | 14 | COPY --from=Builder /app/lezi-api/leziapi leziapi 15 | 16 | RUN chmod +x leziapi 17 | CMD ./leziapi 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lezi Api 2 | 3 | A fast API program for people who are silly and funny. 4 | 5 | ## Demo 6 | 7 | [https://api.lezi.wiki/](https://api.lezi.wiki/) 8 | 9 | ## API Docs 10 | 11 | [Wiki pages](https://github.com/lezi-wiki/lezi-api/wiki) - [Docs v1](https://github.com/lezi-wiki/lezi-api/wiki/LeziAPI-Docs-v1) 12 | 13 | ## Use 14 | 15 | ### Run 16 | 17 | Go to [Releases](https://github.com/lezi-wiki/lezi-api/releases) to download the corresponding version of the program.Then unpack it and get the main program. 18 | 19 | Start command(Linux): 20 | 21 | ```shell 22 | ./lezi-api 23 | ``` 24 | 25 | ### Build 26 | 27 | ```shell 28 | git clone https://github.com/lezi-wiki/lezi-api 29 | cd lezi-api 30 | go run github.com/google/wire/cmd/wire@latest ./... 31 | go build -o ../lezi-api 32 | cd .. 33 | ``` 34 | 35 | ## License 36 | 37 | under [GPL-3.0 license](https://github.com/lezi-wiki/lezi-api/blob/master/LICENSE) 38 | -------------------------------------------------------------------------------- /bootstrap/app.go: -------------------------------------------------------------------------------- 1 | package bootstrap 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | func printName() { 9 | bytes, _ := os.ReadFile("bootstrap/text") 10 | fmt.Print(string(bytes)) 11 | } 12 | -------------------------------------------------------------------------------- /bootstrap/init.go: -------------------------------------------------------------------------------- 1 | package bootstrap 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "github.com/lezi-wiki/lezi-api/model" 6 | "github.com/lezi-wiki/lezi-api/pkg/conf" 7 | "github.com/lezi-wiki/lezi-api/pkg/cron/jobs" 8 | "github.com/lezi-wiki/lezi-api/pkg/log" 9 | "github.com/lezi-wiki/lezi-api/pkg/util" 10 | "github.com/lezi-wiki/lezi-api/services/remote" 11 | "os" 12 | ) 13 | 14 | func Init(confPath string, updateEndpoint string) { 15 | printName() 16 | 17 | log.Log() 18 | 19 | // 初始化配置文件 20 | conf.Init(confPath) 21 | 22 | if conf.SystemConfig.HashIDSalt == "" { 23 | log.Log().Warn("HashIDSalt 未设置,将使用随机值") 24 | conf.SystemConfig.HashIDSalt = util.RandStringRunes(32) 25 | _ = os.Setenv("HASHID_SALT", conf.SystemConfig.HashIDSalt) 26 | } 27 | 28 | // 初始化数据库 29 | model.Init() 30 | 31 | // 设置更新 32 | remote.Endpoint = updateEndpoint 33 | 34 | go jobs.UpdateData() 35 | 36 | // Debug 关闭时,切换为生产模式 37 | if !conf.SystemConfig.Debug { 38 | gin.SetMode(gin.ReleaseMode) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /bootstrap/text: -------------------------------------------------------------------------------- 1 | ,--. ,--. ,---. ,------. ,--. 2 | | | ,---. ,-----.`--' / O \ | .--. '| | 3 | | | | .-. :`-. / ,--. | .-. || '--' || | 4 | | '--.\ --. / `-.| | | | | || | --' | | 5 | `-----' `----'`-----'`--' `--' `--'`--' `--' 6 | ------------------------------------------------------------ 7 | -------------------------------------------------------------------------------- /controller/global.go: -------------------------------------------------------------------------------- 1 | package controller 2 | 3 | import ( 4 | "errors" 5 | "github.com/gin-gonic/gin" 6 | "github.com/lezi-wiki/lezi-api/model" 7 | "github.com/lezi-wiki/lezi-api/pkg/log" 8 | "github.com/lezi-wiki/lezi-api/pkg/serializer" 9 | "github.com/lezi-wiki/lezi-api/pkg/serializer/vo" 10 | "gorm.io/gorm" 11 | ) 12 | 13 | func GlobalHandler(c *gin.Context) { 14 | var err error 15 | 16 | ns := c.Query("ns") 17 | speaker := c.Query("speaker") 18 | format := c.Query("format") 19 | 20 | text, err := model.Client.Text.RandomRecord(model.Text{ 21 | Namespace: ns, 22 | Speaker: speaker, 23 | }) 24 | if err != nil { 25 | if errors.Is(err, gorm.ErrRecordNotFound) { 26 | c.JSON(404, serializer.NotFoundResponse()) 27 | return 28 | } 29 | 30 | log.Log().Errorf("获取数据失败: %s", err) 31 | c.JSON(500, serializer.NewErrorResponse(500, "database error")) 32 | return 33 | } 34 | 35 | switch format { 36 | case "json": 37 | c.JSON(200, serializer.NewSuccessResponse(vo.BuildTextVO(text))) 38 | case "xml": 39 | c.XML(200, serializer.NewSuccessResponse(vo.BuildTextVO(text))) 40 | case "text": 41 | c.String(200, text.Text) 42 | default: 43 | c.String(200, text.Text) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /controller/namespace.go: -------------------------------------------------------------------------------- 1 | package controller 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "github.com/lezi-wiki/lezi-api/model" 6 | "github.com/lezi-wiki/lezi-api/pkg/log" 7 | "github.com/lezi-wiki/lezi-api/pkg/serializer" 8 | "github.com/lezi-wiki/lezi-api/pkg/serializer/vo" 9 | ) 10 | 11 | func NamespaceJsonHandler(c *gin.Context) { 12 | ns := c.Param("namespace") 13 | 14 | data, err := model.Client.Text.RandomRecord(model.Text{ 15 | Namespace: ns, 16 | }) 17 | if err != nil { 18 | log.Log().Errorf("获取数据失败: %s", err) 19 | c.JSON(404, serializer.NotFoundResponse()) 20 | return 21 | } 22 | 23 | c.JSON(200, serializer.NewSuccessResponse(vo.BuildTextVO(data))) 24 | } 25 | 26 | func NamespaceTextHandler(c *gin.Context) { 27 | ns := c.Param("namespace") 28 | 29 | data, err := model.Client.Text.RandomRecord(model.Text{ 30 | Namespace: ns, 31 | }) 32 | if err != nil { 33 | log.Log().Errorf("获取数据失败: %s", err) 34 | c.JSON(404, serializer.NotFoundResponse()) 35 | return 36 | } 37 | 38 | c.String(200, data.Text) 39 | } 40 | 41 | func NamespaceXmlHandler(c *gin.Context) { 42 | ns := c.Param("namespace") 43 | 44 | data, err := model.Client.Text.RandomRecord(model.Text{ 45 | Namespace: ns, 46 | }) 47 | if err != nil { 48 | log.Log().Errorf("获取数据失败: %s", err) 49 | c.JSON(404, serializer.NotFoundResponse()) 50 | return 51 | } 52 | 53 | c.XML(200, serializer.NewSuccessResponse(vo.BuildTextVO(data))) 54 | } 55 | -------------------------------------------------------------------------------- /controller/speaker.go: -------------------------------------------------------------------------------- 1 | package controller 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "github.com/lezi-wiki/lezi-api/model" 6 | "github.com/lezi-wiki/lezi-api/pkg/log" 7 | "github.com/lezi-wiki/lezi-api/pkg/serializer" 8 | "github.com/lezi-wiki/lezi-api/pkg/serializer/vo" 9 | ) 10 | 11 | func SpeakerJsonHandler(c *gin.Context) { 12 | speaker := c.Param("speaker") 13 | 14 | data, err := model.Client.Text.RandomRecord(model.Text{ 15 | Speaker: speaker, 16 | }) 17 | if err != nil { 18 | log.Log().Errorf("获取数据失败: %s", err) 19 | c.JSON(404, serializer.NotFoundResponse()) 20 | return 21 | } 22 | 23 | c.JSON(200, serializer.NewSuccessResponse(vo.BuildTextVO(data))) 24 | } 25 | 26 | func SpeakerXmlHandler(c *gin.Context) { 27 | speaker := c.Param("speaker") 28 | 29 | data, err := model.Client.Text.RandomRecord(model.Text{ 30 | Speaker: speaker, 31 | }) 32 | if err != nil { 33 | log.Log().Errorf("获取数据失败: %s", err) 34 | c.JSON(404, serializer.NotFoundResponse()) 35 | return 36 | } 37 | 38 | c.XML(200, serializer.NewSuccessResponse(vo.BuildTextVO(data))) 39 | } 40 | 41 | func SpeakerTextHandler(c *gin.Context) { 42 | speaker := c.Param("speaker") 43 | 44 | data, err := model.Client.Text.RandomRecord(model.Text{ 45 | Speaker: speaker, 46 | }) 47 | if err != nil { 48 | log.Log().Errorf("获取数据失败: %s", err) 49 | c.JSON(404, serializer.NotFoundResponse()) 50 | return 51 | } 52 | 53 | c.String(200, data.Text) 54 | } 55 | -------------------------------------------------------------------------------- /data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ns": "QingSong", 4 | "speaker": "Spruce sapling", 5 | "text": "I love HTML" 6 | }, 7 | { 8 | "ns": "QingSong", 9 | "speaker": "Spruce sapling", 10 | "text": "没事,听我的,断绝和他们的一切联系方式,你问我为什么?因为啊,那样他们就打不到我们了" 11 | }, 12 | { 13 | "ns": "QingSong", 14 | "speaker": "Spruce sapling", 15 | "text": "虽然QQ也是用HTML写的" 16 | }, 17 | { 18 | "ns": "QingSong", 19 | "speaker": "Spruce sapling", 20 | "text": "杀了一个5人小群,这就是技术" 21 | }, 22 | { 23 | "ns": "QingSong", 24 | "speaker": "Spruce sapling", 25 | "text": "有些时候,残暴是必须的" 26 | }, 27 | { 28 | "ns": "QingSong", 29 | "speaker": "Spruce sapling", 30 | "text": "(易语言)感觉还没有我 的BJ强" 31 | }, 32 | { 33 | "ns": "QingSong", 34 | "speaker": "Spruce sapling", 35 | "text": "我比他们学编程学的晚,但是他们在弄SCR的时候我就已经创造出自己的语言了" 36 | }, 37 | { 38 | "ns": "QingSong", 39 | "speaker": "Spruce sapling", 40 | "text": "这个其实我盐焗(研究)过" 41 | }, 42 | { 43 | "ns": "QingSong", 44 | "speaker": "Spruce sapling", 45 | "text": "这已经是我盐焗(研究)的第N编" 46 | }, 47 | { 48 | "ns": "QingSong", 49 | "speaker": "Spruce sapling", 50 | "text": "十六进制前面没有#吗?#FFF0000不是前面有#?" 51 | }, 52 | { 53 | "ns": "QingSong", 54 | "speaker": "Spruce sapling", 55 | "text": "都懂,只是在忍他们" 56 | }, 57 | { 58 | "ns": "QingSong", 59 | "speaker": "Spruce sapling", 60 | "text": "故意为难我是吧(怒气值+9)" 61 | }, 62 | { 63 | "ns": "QingSong", 64 | "speaker": "Spruce sapling", 65 | "text": "故意炫耀是吧(怒气+6)" 66 | }, 67 | { 68 | "ns": "QingSong", 69 | "speaker": "Spruce sapling", 70 | "text": "忍耐我可是一流的" 71 | }, 72 | { 73 | "ns": "QingSong", 74 | "speaker": "Spruce sapling", 75 | "text": "《最好的进攻就是防守》" 76 | }, 77 | { 78 | "ns": "QingSong", 79 | "speaker": "Spruce sapling", 80 | "text": "电脑是用什么写的" 81 | }, 82 | { 83 | "ns": "QingSong", 84 | "speaker": "Spruce sapling", 85 | "text": "电脑就是写的!!!" 86 | }, 87 | { 88 | "ns": "QingSong", 89 | "speaker": "Spruce sapling", 90 | "text": "我亲自出马吧,他们连将都不会" 91 | }, 92 | { 93 | "ns": "QingSong", 94 | "speaker": "Spruce sapling", 95 | "text": "凭什么要用dll" 96 | }, 97 | { 98 | "ns": "QingSong", 99 | "speaker": "Spruce sapling", 100 | "text": "这个可是我精心研制的病毒,杀毒软件识别不出来,而且任务管理器不好使,只能重启!!!" 101 | }, 102 | { 103 | "ns": "QingSong", 104 | "speaker": "Spruce sapling", 105 | "text": "编程平台大战就来了" 106 | }, 107 | { 108 | "ns": "QingSong", 109 | "speaker": "Spruce sapling", 110 | "text": "我在酝酿着一场巨变" 111 | }, 112 | { 113 | "ns": "QingSong", 114 | "speaker": "Spruce sapling", 115 | "text": "我想学别的语言,能做游戏的,有吗,JAVA?" 116 | }, 117 | { 118 | "ns": "QingSong", 119 | "speaker": "Spruce sapling", 120 | "text": "JS写不了游戏。我只要移动!!1我只要控制移动!!!!!!!!!!!!!!1" 121 | }, 122 | { 123 | "ns": "QingSong", 124 | "speaker": "Spruce sapling", 125 | "text": "我的梦想就是3D游戏" 126 | }, 127 | { 128 | "ns": "QingSong", 129 | "speaker": "Spruce sapling", 130 | "text": "控制移动(的源码)给我拿来" 131 | }, 132 | { 133 | "ns": "QingSong", 134 | "speaker": "Spruce sapling", 135 | "text": "(你要先学最基础的啊,不要一步登天)我不管" 136 | }, 137 | { 138 | "ns": "QingSong", 139 | "speaker": "Spruce sapling", 140 | "text": "switch是什么意思啊" 141 | }, 142 | { 143 | "ns": "QingSong", 144 | "speaker": "Spruce sapling", 145 | "text": "case是什么意思啊" 146 | }, 147 | { 148 | "ns": "QingSong", 149 | "speaker": "Spruce sapling", 150 | "text": "只不过是你们没有受过的伤和绝望我都受了" 151 | }, 152 | { 153 | "ns": "QingSong", 154 | "speaker": "Spruce sapling", 155 | "text": "只不过是你们没有胆量,不敢是罢了" 156 | }, 157 | { 158 | "ns": "QingSong", 159 | "speaker": "Spruce sapling", 160 | "text": "一切的障碍在我看来就是虚无缥缈的纸老虎" 161 | }, 162 | { 163 | "ns": "QingSong", 164 | "speaker": "Spruce sapling", 165 | "text": "看提示的都是傻瓜程序员" 166 | }, 167 | { 168 | "ns": "QingSong", 169 | "speaker": "Spruce sapling", 170 | "text": "你想想,一个伐木工,同时伐一棵树快,还是两颗树快?懂了吗?效率!(注:强行干涉他人活动自由)" 171 | }, 172 | { 173 | "ns": "QingSong", 174 | "speaker": "Spruce sapling", 175 | "text": "一心砍一棵树效率才会高,而且质量也高!(注:强行干涉他人活动自由)" 176 | }, 177 | { 178 | "ns": "QingSong", 179 | "speaker": "Spruce sapling", 180 | "text": "你们以为他们是什么好人吗(注:指反青松人士们)" 181 | }, 182 | { 183 | "ns": "QingSong", 184 | "speaker": "Spruce sapling", 185 | "text": "我只是通过漏洞知道她真名的(注:指某记者,所谓“真名”并不准确)" 186 | }, 187 | { 188 | "ns": "QingSong", 189 | "speaker": "Spruce sapling", 190 | "text": "你以为换了头像和昵称我就看不出来了(注:指一位反青松人士)" 191 | }, 192 | { 193 | "ns": "QingSong", 194 | "speaker": "Spruce sapling", 195 | "text": "根据青松法律的旳10条,引起骚动或骚扰,应收到合理的禁言和处罚" 196 | }, 197 | { 198 | "ns": "QingSong", 199 | "speaker": "Spruce sapling", 200 | "text": "在法律面前,一切感情都是没用的!!!" 201 | }, 202 | { 203 | "ns": "QingSong", 204 | "speaker": "Spruce sapling", 205 | "text": "DC不已经死了?" 206 | }, 207 | { 208 | "ns": "QingSong", 209 | "speaker": "Spruce sapling", 210 | "text": "(好像我还没有发布法律)" 211 | }, 212 | { 213 | "ns": "QingSong", 214 | "speaker": "Spruce sapling", 215 | "text": "法律我写好了,要有检查官,就是警察,突不突然?意不意外?" 216 | }, 217 | { 218 | "ns": "QingSong", 219 | "speaker": "Spruce sapling", 220 | "text": "最近有没有什么太大的骚动,等到法律发了之后,我给你法律,一个一个的刑或者烤或者杀" 221 | }, 222 | { 223 | "ns": "QingSong", 224 | "speaker": "Spruce sapling", 225 | "text": "千万不要相信任何人,包括你自己" 226 | }, 227 | { 228 | "ns": "QingSong", 229 | "speaker": "Spruce sapling", 230 | "text": "用提示的程序员不叫程序员" 231 | }, 232 | { 233 | "ns": "QingSong", 234 | "speaker": "Spruce sapling", 235 | "text": "我是0" 236 | }, 237 | { 238 | "ns": "QingSong", 239 | "speaker": "Spruce sapling", 240 | "text": "他要跟随粉碎我们" 241 | }, 242 | { 243 | "ns": "QingSong", 244 | "speaker": "Spruce sapling", 245 | "text": "我就会带领paddy,连刑带拷!所以说啊,我没时间的原因,一切办好了之后,我将会展开调查,扫黑除恶,连刑带拷!根据青松法律,如果,群成员不活跃,会解散群聊,敢吗?没人的话回一一处罚!" 246 | }, 247 | { 248 | "ns": "QingSong", 249 | "speaker": "Spruce sapling", 250 | "text": "我宣布,由于,墨某好学,奖励他500青松币,青松币可以在我这里换取权利,也就是县官,小臣一一尚士一一县官一一区长一一群主助手。" 251 | }, 252 | { 253 | "ns": "QingSong", 254 | "speaker": "Spruce sapling", 255 | "text": "再次宣布,Paddy掌握这青松银行的40050的财富,总共50000,但是墨某得到了500,40500。PADDY,高兴不,40500,呵呵。你可以奖励别人,记住存款,最多最多每个人2000,要不然钱不够,青松所以的钱。" 256 | }, 257 | { 258 | "ns": "QingSong", 259 | "speaker": "Spruce sapling", 260 | "text": "根据青松法律,如果出现不合理抗命行为,将受到合理处罚。还有,如果发现没有经过审核的转账,将受到合理处罚,三天起步。" 261 | }, 262 | { 263 | "ns": "QingSong", 264 | "speaker": "Spruce sapling", 265 | "text": "确定吗,墨某,你确定吗,加刑带拷!paddy,到你除暴的时候了!" 266 | }, 267 | { 268 | "ns": "QingSong", 269 | "speaker": "Spruce sapling", 270 | "text": "必须认真听ss讲话,否则,将3天小黑屋起步。再吃几下怼,就是,禁言了以后让大家怼你、针对你,懂?" 271 | }, 272 | { 273 | "ns": "QingSong", 274 | "speaker": "Spruce sapling", 275 | "text": "html5新增了一个功能,当ja过多时,会自动报废那个文件js,我应该是函数太多了。" 276 | }, 277 | { 278 | "ns": "QingSong", 279 | "speaker": "Spruce sapling", 280 | "text": "骨折了不用开学了" 281 | }, 282 | { 283 | "ns": "QingSong", 284 | "speaker": "Spruce sapling", 285 | "text": "It's is a game starter" 286 | }, 287 | { 288 | "ns": "QingSong", 289 | "speaker": "Spruce sapling", 290 | "text": "要不要考虑学前端,DC" 291 | }, 292 | { 293 | "ns": "QingSong", 294 | "speaker": "Detective_code", 295 | "text": "tk是黑方,青松蓝方,我是无限工作室室长红方" 296 | }, 297 | { 298 | "ns": "QingSong", 299 | "speaker": "Detective_code", 300 | "text": "你们不知道我的实力" 301 | }, 302 | { 303 | "ns": "Thermal", 304 | "speaker": "Thermal code", 305 | "text": "没看见贬低小学生" 306 | }, 307 | { 308 | "ns": "Thermal", 309 | "speaker": "Thermal code", 310 | "text": "老子就他妈看不惯" 311 | }, 312 | { 313 | "ns": "Thermal", 314 | "speaker": "Thermal code", 315 | "text": "他在你群里面暴露我住址" 316 | }, 317 | { 318 | "ns": "Thermal", 319 | "speaker": "Thermal code", 320 | "text": "网景幺群号" 321 | }, 322 | { 323 | "ns": "Thermal", 324 | "speaker": "Thermal code", 325 | "text": "我去找他(ahdark)" 326 | }, 327 | { 328 | "ns": "Thermal", 329 | "speaker": "Thermal code", 330 | "text": "hhh我把那个傻逼的改了" 331 | }, 332 | { 333 | "ns": "Thermal", 334 | "speaker": "Thermal code", 335 | "text": "我手机没电了" 336 | }, 337 | { 338 | "ns": "Thermal", 339 | "speaker": "Thermal code", 340 | "text": "半个点了快还不死?" 341 | }, 342 | { 343 | "ns": "Thermal", 344 | "speaker": "Thermal code", 345 | "text": "我打一晚上看看会怎么样" 346 | }, 347 | { 348 | "ns": "Thermal", 349 | "speaker": "Thermal code", 350 | "text": "(lezi.wiki)被我udp dos死了" 351 | }, 352 | { 353 | "ns": "Thermal", 354 | "speaker": "Thermal code", 355 | "text": "ahdark被我打死了" 356 | }, 357 | { 358 | "ns": "Thermal", 359 | "speaker": "Thermal code", 360 | "text": "禁止过度使用机器人" 361 | }, 362 | { 363 | "ns": "Thermal", 364 | "speaker": "Thermal code", 365 | "text": "就一没m狗我管他嘞" 366 | }, 367 | { 368 | "ns": "Thermal", 369 | "speaker": "Thermal code", 370 | "text": "一群rj惹事" 371 | }, 372 | { 373 | "ns": "Thermal", 374 | "speaker": "Thermal code", 375 | "text": "你是我家长啊管这么严" 376 | }, 377 | { 378 | "ns": "Thermal", 379 | "speaker": "Thermal code", 380 | "text": "你看手机能禁言30天吗" 381 | }, 382 | { 383 | "ns": "Thermal", 384 | "speaker": "Thermal code", 385 | "text": "你继续狗叫啊" 386 | }, 387 | { 388 | "ns": "Thermal", 389 | "speaker": "Thermal code", 390 | "text": "你小子行啊" 391 | }, 392 | { 393 | "ns": "Thermal", 394 | "speaker": "Thermal code", 395 | "text": "我知道昨天匿名谁在骂我了" 396 | }, 397 | { 398 | "ns": "Thermal", 399 | "speaker": "Thermal code", 400 | "text": "fuck @wuz you mother and dad is sb(注:这条是在骂@wuz)" 401 | }, 402 | { 403 | "ns": "Thermal", 404 | "speaker": "Thermal code", 405 | "text": "Fuck your mom and dad.(注:这条是在骂@wuz)" 406 | }, 407 | { 408 | "ns": "Thermal", 409 | "speaker": "Thermal code", 410 | "text": "Mom, we don't welcome you without anything.(注:这条是在骂@wuz)" 411 | }, 412 | { 413 | "ns": "AoligeiHardware", 414 | "speaker": "Aoligei", 415 | "text": "腾讯云服务器,你不装宝塔面板还能怎么玩" 416 | }, 417 | { 418 | "ns": "AoligeiHardware", 419 | "speaker": "Aoligei", 420 | "text": "那个,要举报的可以,我们有律师" 421 | }, 422 | { 423 | "ns": "AoligeiHardware", 424 | "speaker": "Aoligei", 425 | "text": "各位注意了!@青青子衿 Bruce 这个傻逼加一次群骂一次,管理员看见了立即删掉" 426 | }, 427 | { 428 | "ns": "AoligeiHardware", 429 | "speaker": "Aoligei", 430 | "text": "违者一样滚蛋" 431 | }, 432 | { 433 | "ns": "AoligeiHardware", 434 | "speaker": "Aoligei", 435 | "text": "我申明一下,我们从来就不缺人" 436 | }, 437 | { 438 | "ns": "AoligeiHardware", 439 | "speaker": "Aoligei", 440 | "text": "我们也不需要某些屁用没有,还不忠不义,的喷子杠精" 441 | }, 442 | { 443 | "ns": "AoligeiHardware", 444 | "speaker": "Aoligei", 445 | "text": "请某些人要有自知之明" 446 | }, 447 | { 448 | "ns": "AoligeiHardware", 449 | "speaker": "Aoligei", 450 | "text": "我认为,一个人连忠义都做不到,这个人迟早会把你坑惨" 451 | }, 452 | { 453 | "ns": "AoligeiHardware", 454 | "speaker": "Aoligei", 455 | "text": "@电脑中的乐趣 你那个广告不用做了,指望你100年也做不好" 456 | }, 457 | { 458 | "ns": "AoligeiHardware", 459 | "speaker": "Aoligei", 460 | "text": "此时,喷子马上就要进入状态了" 461 | }, 462 | { 463 | "ns": "AoligeiHardware", 464 | "speaker": "Aoligei", 465 | "text": "为了防止喷子先给你禁言" 466 | }, 467 | { 468 | "ns": "AoligeiHardware", 469 | "speaker": "Aoligei", 470 | "text": "开https还要实名认证" 471 | }, 472 | { 473 | "ns": "AoligeiHardware", 474 | "speaker": "Aoligei", 475 | "text": "王八犊子!有大病是不是" 476 | }, 477 | { 478 | "ns": "AoligeiHardware", 479 | "speaker": "Aoligei", 480 | "text": "我拿我的铲屎官一号,搭建了一个MC服务器" 481 | }, 482 | { 483 | "ns": "AoligeiHardware", 484 | "speaker": "Aoligei", 485 | "text": "就是吊大家胃口而已" 486 | }, 487 | { 488 | "ns": "AoligeiHardware", 489 | "speaker": "Aoligei", 490 | "text": "服务器性能强悍(编者注:udpflood两分钟就无法连接)" 491 | }, 492 | { 493 | "ns": "AoligeiHardware", 494 | "speaker": "Aoligei", 495 | "text": "我一看你那嚣张跋涉的样子就想吐(注:某群友劝说其提升技术再来接单而后被踢时)" 496 | }, 497 | { 498 | "ns": "AoligeiHardware", 499 | "speaker": "Aoligei", 500 | "text": "拿这玩意凑数" 501 | }, 502 | { 503 | "ns": "AoligeiHardware", 504 | "speaker": "Aoligei", 505 | "text": "瞧你这鼠目寸光" 506 | }, 507 | { 508 | "ns": "AoligeiHardware", 509 | "speaker": "Aoligei", 510 | "text": "你拿个HTML写一个UI都好" 511 | }, 512 | { 513 | "ns": "AoligeiHardware", 514 | "speaker": "Aoligei", 515 | "text": "我们官网还没公布" 516 | }, 517 | { 518 | "ns": "AoligeiHardware", 519 | "speaker": "Aoligei", 520 | "text": "我要搭建MC服务器" 521 | }, 522 | { 523 | "ns": "AoligeiHardware", 524 | "speaker": "Aoligei", 525 | "text": "要Linux系统行不行?" 526 | }, 527 | { 528 | "ns": "AoligeiHardware", 529 | "speaker": "Aoligei", 530 | "text": "主要我服务器部署的不是网站" 531 | }, 532 | { 533 | "ns": "AoligeiHardware", 534 | "speaker": "Aoligei", 535 | "text": "你到我们官网预定去" 536 | }, 537 | { 538 | "ns": "AoligeiHardware", 539 | "speaker": "Aoligei", 540 | "text": "对我们穷人来说,根本不用" 541 | }, 542 | { 543 | "ns": "AoligeiHardware", 544 | "speaker": "Aoligei", 545 | "text": "改什么改,多么的好看" 546 | }, 547 | { 548 | "ns": "AoligeiHardware", 549 | "speaker": "Aoligei", 550 | "text": "你是工作室的成员还是什么?" 551 | }, 552 | { 553 | "ns": "AoligeiHardware", 554 | "speaker": "Aoligei", 555 | "text": "为什么?米白多难看" 556 | }, 557 | { 558 | "ns": "AoligeiHardware", 559 | "speaker": "Aoligei", 560 | "text": "那你可以滚蛋了" 561 | }, 562 | { 563 | "ns": "AoligeiHardware", 564 | "speaker": "Aoligei", 565 | "text": "你这个智商已经告别合作了" 566 | }, 567 | { 568 | "ns": "AoligeiHardware", 569 | "speaker": "Aoligei", 570 | "text": "歹人来了踢群伺候" 571 | }, 572 | { 573 | "ns": "AoligeiHardware", 574 | "speaker": "Aoligei", 575 | "text": "傻批,这也能算bug" 576 | }, 577 | { 578 | "ns": "AoligeiHardware", 579 | "speaker": "Aoligei", 580 | "text": "还有,我Windows10家庭版,没有远程桌面,我该怎么连接" 581 | }, 582 | { 583 | "ns": "AoligeiHardware", 584 | "speaker": "Aoligei", 585 | "text": "哎呦,你怎么那么无知啊!" 586 | }, 587 | { 588 | "ns": "AoligeiHardware", 589 | "speaker": "Aoligei", 590 | "text": "怎么不给我再来个木马助助兴" 591 | }, 592 | { 593 | "ns": "AoligeiHardware", 594 | "speaker": "Aoligei", 595 | "text": "怕是被我一亿个TNT炸没了" 596 | }, 597 | { 598 | "ns": "AoligeiHardware", 599 | "speaker": "Aoligei", 600 | "text": "我看着还挺划算" 601 | }, 602 | { 603 | "ns": "AoligeiHardware", 604 | "speaker": "Aoligei", 605 | "text": "十一岁的小屁孩还批判我" 606 | }, 607 | { 608 | "ns": "AoligeiHardware", 609 | "speaker": "Aoligei", 610 | "text": "翻到这种老古董,让我很惊讶(注:指c语言源码)" 611 | }, 612 | { 613 | "ns": "AoligeiHardware", 614 | "speaker": "Aoligei", 615 | "text": "我的电脑禁不起,再次启动Clion的折磨了" 616 | }, 617 | { 618 | "ns": "AoligeiHardware", 619 | "speaker": "Aoligei", 620 | "text": "我还真认识个人,会送(注:指已备案域名)" 621 | }, 622 | { 623 | "ns": "AoligeiHardware", 624 | "speaker": "Aoligei", 625 | "text": "众所周知,打包Django比登天还难,我竟然打包出来了" 626 | }, 627 | { 628 | "ns": "AoligeiHardware", 629 | "speaker": "Aoligei", 630 | "text": "登天这不容易着了,我这就去造火箭登天" 631 | }, 632 | { 633 | "ns": "AoligeiHardware", 634 | "speaker": "Aoligei", 635 | "text": "待会,我偷偷向你氧气罐里加氢氧化合物" 636 | }, 637 | { 638 | "ns": "AoligeiHardware", 639 | "speaker": "Aoligei", 640 | "text": "我那个合作方给了我一堆无聊渣渣的项目" 641 | }, 642 | { 643 | "ns": "AoligeiHardware", 644 | "speaker": "Aoligei", 645 | "text": "你们谁想搞谁搞去吧!" 646 | }, 647 | { 648 | "ns": "AoligeiHardware", 649 | "speaker": "Aoligei", 650 | "text": "我会单方面停止合作" 651 | }, 652 | { 653 | "ns": "AoligeiHardware", 654 | "speaker": "Aoligei", 655 | "text": "你们谁能联系到梅尔顿国际学校的客服?" 656 | }, 657 | { 658 | "ns": "AoligeiHardware", 659 | "speaker": "Aoligei", 660 | "text": "我怀疑,有人假借这个学校的名号,来对我们实施诈骗" 661 | }, 662 | { 663 | "ns": "AoligeiHardware", 664 | "speaker": "Aoligei", 665 | "text": "我们无法验证这个组织的真实性" 666 | }, 667 | { 668 | "ns": "AoligeiHardware", 669 | "speaker": "Aoligei", 670 | "text": "这将会关系到工作室的合作项目" 671 | }, 672 | { 673 | "ns": "AoligeiHardware", 674 | "speaker": "Aoligei", 675 | "text": "我根据他们学校的官网,得知他们有一个社团叫:编程社" 676 | }, 677 | { 678 | "ns": "AoligeiHardware", 679 | "speaker": "Aoligei", 680 | "text": "我要LINUX服务器" 681 | }, 682 | { 683 | "ns": "AoligeiHardware", 684 | "speaker": "Aoligei", 685 | "text": "我已经有5TB的云硬盘了" 686 | }, 687 | { 688 | "ns": "AoligeiHardware", 689 | "speaker": "Aoligei", 690 | "text": "啥时结婚了,我当随礼送你了" 691 | }, 692 | { 693 | "ns": "AoligeiHardware", 694 | "speaker": "Aoligei", 695 | "text": "突然暴露了你的无知" 696 | }, 697 | { 698 | "ns": "AoligeiHardware", 699 | "speaker": "Aoligei", 700 | "text": "怕你服务器带不动" 701 | }, 702 | { 703 | "ns": "AoligeiHardware", 704 | "speaker": "Aoligei", 705 | "text": "先把你结婚证拍来" 706 | }, 707 | { 708 | "ns": "AoligeiHardware", 709 | "speaker": "Aoligei", 710 | "text": "兄弟,还是算了吧" 711 | }, 712 | { 713 | "ns": "AoligeiHardware", 714 | "speaker": "Aoligei", 715 | "text": "你这个配置扛不住" 716 | }, 717 | { 718 | "ns": "AoligeiHardware", 719 | "speaker": "Aoligei", 720 | "text": "无知就不要说话了" 721 | }, 722 | { 723 | "ns": "AoligeiHardware", 724 | "speaker": "Aoligei", 725 | "text": "哎!吾掐指一算,这工作室也有一年半的历史了" 726 | }, 727 | { 728 | "ns": "AoligeiHardware", 729 | "speaker": "Aoligei", 730 | "text": "当年那群人,也走的差不多了。" 731 | }, 732 | { 733 | "ns": "AoligeiHardware", 734 | "speaker": "Aoligei", 735 | "text": "当年那群人,都失踪了,还有几个是活着的啊!" 736 | }, 737 | { 738 | "ns": "AoligeiHardware", 739 | "speaker": "Aoligei", 740 | "text": "这个论坛也算是见证了我们的兴起与衰落" 741 | }, 742 | { 743 | "ns": "AoligeiHardware", 744 | "speaker": "Aoligei", 745 | "text": "我今天意欲废了这个论坛" 746 | }, 747 | { 748 | "ns": "AoligeiHardware", 749 | "speaker": "Aoligei", 750 | "text": "想必你也看出来了,我就是不给你" 751 | }, 752 | { 753 | "ns": "AoligeiHardware", 754 | "speaker": "Aoligei", 755 | "text": "我确实不是这样的人" 756 | }, 757 | { 758 | "ns": "AoligeiHardware", 759 | "speaker": "Aoligei", 760 | "text": "赶紧把婚结了" 761 | }, 762 | { 763 | "ns": "AoligeiHardware", 764 | "speaker": "Aoligei", 765 | "text": "你只要能把这个文件配置好,我就给你" 766 | }, 767 | { 768 | "ns": "AoligeiHardware", 769 | "speaker": "Aoligei", 770 | "text": "因为我就是不想让你用" 771 | }, 772 | { 773 | "ns": "AoligeiHardware", 774 | "speaker": "Aoligei", 775 | "text": "哎!我就是玩" 776 | }, 777 | { 778 | "ns": "AoligeiHardware", 779 | "speaker": "Aoligei", 780 | "text": "我看大家一路走来都不容易,想给大家点礼物" 781 | }, 782 | { 783 | "ns": "AoligeiHardware", 784 | "speaker": "Aoligei", 785 | "text": "那算了,我本来还打算发红包的呢" 786 | }, 787 | { 788 | "ns": "AoligeiHardware", 789 | "speaker": "Aoligei", 790 | "text": "打开我心爱的服务器" 791 | }, 792 | { 793 | "ns": "AoligeiHardware", 794 | "speaker": "Aoligei", 795 | "text": "算了,我今天良心发现了" 796 | }, 797 | { 798 | "ns": "AoligeiHardware", 799 | "speaker": "Aoligei", 800 | "text": "那是webssh连接服务器用的" 801 | }, 802 | { 803 | "ns": "AoligeiHardware", 804 | "speaker": "Aoligei", 805 | "text": "配置好了,我就把连接方式给你" 806 | }, 807 | { 808 | "ns": "AoligeiHardware", 809 | "speaker": "Aoligei", 810 | "text": "很简单,已经写好了,一行指令就能启动" 811 | }, 812 | { 813 | "ns": "AoligeiHardware", 814 | "speaker": "Aoligei", 815 | "text": "我服务器的连接方式也放在了里面,能不能找到要看你的造化了" 816 | }, 817 | { 818 | "ns": "AoligeiHardware", 819 | "speaker": "Aoligei", 820 | "text": "其实,我已经装上了宝塔" 821 | }, 822 | { 823 | "ns": "AoligeiHardware", 824 | "speaker": "Aoligei", 825 | "text": "你本来有更简单的方式来连接服务器" 826 | }, 827 | { 828 | "ns": "AoligeiHardware", 829 | "speaker": "Aoligei", 830 | "text": "但是我就是不给你" 831 | }, 832 | { 833 | "ns": "AoligeiHardware", 834 | "speaker": "Aoligei", 835 | "text": "量他个傻子也不会改" 836 | }, 837 | { 838 | "ns": "AoligeiHardware", 839 | "speaker": "Aoligei", 840 | "text": "我腾讯云服务器" 841 | }, 842 | { 843 | "ns": "AoligeiHardware", 844 | "speaker": "Aoligei", 845 | "text": "大不了来个重装系统" 846 | }, 847 | { 848 | "ns": "AoligeiHardware", 849 | "speaker": "Aoligei", 850 | "text": "看他怎么改" 851 | }, 852 | { 853 | "ns": "AoligeiHardware", 854 | "speaker": "Aoligei", 855 | "text": "如果造化低了,就等结婚以后,我当随礼送你了" 856 | }, 857 | { 858 | "ns": "AoligeiHardware", 859 | "speaker": "Aoligei", 860 | "text": "傻逼,你也低估我了" 861 | }, 862 | { 863 | "ns": "AoligeiHardware", 864 | "speaker": "Aoligei", 865 | "text": "密码给我加过秘" 866 | }, 867 | { 868 | "ns": "AoligeiHardware", 869 | "speaker": "Aoligei", 870 | "text": "各位,我去这里测了一下,都他妈成负数了" 871 | }, 872 | { 873 | "ns": "AoligeiHardware", 874 | "speaker": "Aoligei", 875 | "text": "这个傻逼侮辱我" 876 | }, 877 | { 878 | "ns": "AoligeiHardware", 879 | "speaker": "Aoligei", 880 | "text": "我操你妈给我滚出去" 881 | }, 882 | { 883 | "ns": "AoligeiHardware", 884 | "speaker": "Aoligei", 885 | "text": "这个傻叉机器人" 886 | }, 887 | { 888 | "ns": "AoligeiHardware", 889 | "speaker": "rsodxd", 890 | "text": "无能狂怒了属于是" 891 | }, 892 | { 893 | "ns": "AoligeiHardware", 894 | "speaker": "rsodxd", 895 | "text": "写好你的网页" 896 | }, 897 | { 898 | "ns": "AoligeiHardware", 899 | "speaker": "rsodxd", 900 | "text": "你特么改成纯色都好看" 901 | }, 902 | { 903 | "ns": "AoligeiHardware", 904 | "speaker": "rsodxd", 905 | "text": "哈哈,看看github pages" 906 | }, 907 | { 908 | "ns": "AoligeiHardware", 909 | "speaker": "rsodxd", 910 | "text": "你死哪去了?来打我啊!" 911 | }, 912 | { 913 | "ns": "AoligeiHardware", 914 | "speaker": "rsodxd", 915 | "text": "快来打啊傻逼" 916 | }, 917 | { 918 | "ns": "AoligeiHardware", 919 | "speaker": "rsodxd", 920 | "text": "gmail.com这我公司官网" 921 | }, 922 | { 923 | "ns": "AoligeiHardware", 924 | "speaker": "rsodxd", 925 | "text": "打我的服务器,使劲打" 926 | }, 927 | { 928 | "ns": "AoligeiHardware", 929 | "speaker": "rsodxd", 930 | "text": "怎么不给我投个远控?" 931 | }, 932 | { 933 | "ns": "AoligeiHardware", 934 | "speaker": "rsodxd", 935 | "text": "我服务器github.com快来啊" 936 | }, 937 | { 938 | "ns": "AoligeiHardware", 939 | "speaker": "Summer", 940 | "text": "ahdark.com 美国网络" 941 | }, 942 | { 943 | "ns": "AoligeiHardware", 944 | "speaker": "Summer", 945 | "text": "你敢说gov.cn是你写的?" 946 | }, 947 | { 948 | "ns": "AoligeiHardware", 949 | "speaker": "Summer", 950 | "text": "我又没钱DDoS" 951 | }, 952 | { 953 | "ns": "AoligeiHardware", 954 | "speaker": "Summer", 955 | "text": "内网不行吗你难道会走外网" 956 | }, 957 | { 958 | "ns": "JigokuZ", 959 | "speaker": "JigokuZ", 960 | "text": "我DDR4 8GB 2666,2666指的是读取速度" 961 | }, 962 | { 963 | "ns": "JigokuZ", 964 | "speaker": "JigokuZ", 965 | "text": "我说的是windows不行" 966 | }, 967 | { 968 | "ns": "JigokuZ", 969 | "speaker": "JigokuZ", 970 | "text": "模组我自己做的" 971 | }, 972 | { 973 | "ns": "JigokuZ", 974 | "speaker": "JigokuZ", 975 | "text": "就是用的18开的1.18.1" 976 | }, 977 | { 978 | "ns": "JigokuZ", 979 | "speaker": "JigokuZ", 980 | "text": "DDR48GB翻一倍" 981 | }, 982 | { 983 | "ns": "JigokuZ", 984 | "speaker": "JigokuZ", 985 | "text": "我跟你说64GB都不够我用" 986 | }, 987 | { 988 | "ns": "JigokuZ", 989 | "speaker": "JigokuZ", 990 | "text": "之前我还找着过6个铁匠铺的(指村庄)" 991 | }, 992 | { 993 | "ns": "JigokuZ", 994 | "speaker": "JigokuZ", 995 | "text": "我一般重新加的都是用的reload" 996 | }, 997 | { 998 | "ns": "JigokuZ", 999 | "speaker": "JigokuZ", 1000 | "text": "我CPU我记得是四核心也不八核心不对,是12" 1001 | }, 1002 | { 1003 | "ns": "JigokuZ", 1004 | "speaker": "JigokuZ", 1005 | "text": "sudo apt install我之前用ubuntu为啥就行(注:他在 CentOS 上执行的该指令)" 1006 | }, 1007 | { 1008 | "ns": "JigokuZ", 1009 | "speaker": "JigokuZ", 1010 | "text": "我爸的蓝牙耳机(编者注:被他拆了)" 1011 | }, 1012 | { 1013 | "ns": "JigokuZ", 1014 | "speaker": "JigokuZ", 1015 | "text": "200块钱摔成空气了" 1016 | }, 1017 | { 1018 | "ns": "JigokuZ", 1019 | "speaker": "JigokuZ", 1020 | "text": "谁有spigot的账号" 1021 | }, 1022 | { 1023 | "ns": "JigokuZ", 1024 | "speaker": "JigokuZ", 1025 | "text": "好家伙,放那么多ntn没事,你知道我那个服务器有多牛逼了吧?" 1026 | }, 1027 | { 1028 | "ns": "JigokuZ", 1029 | "speaker": "JigokuZ", 1030 | "text": "我之前在我,这台电脑上然后放了差不多得有几十万个天梯吧" 1031 | }, 1032 | { 1033 | "ns": "JigokuZ", 1034 | "speaker": "JigokuZ", 1035 | "text": "吃一顿麦当劳花了我100" 1036 | }, 1037 | { 1038 | "ns": "JigokuZ", 1039 | "speaker": "JigokuZ", 1040 | "text": "你这还不算2b2t" 1041 | }, 1042 | { 1043 | "ns": "JigokuZ", 1044 | "speaker": "JigokuZ", 1045 | "text": "你应该来点黑曜石,再来点末影水晶,再来点TNT" 1046 | }, 1047 | { 1048 | "ns": "JigokuZ", 1049 | "speaker": "JigokuZ", 1050 | "text": "黑曜石岩浆土块,还有末影水晶" 1051 | }, 1052 | { 1053 | "ns": "JigokuZ", 1054 | "speaker": "JigokuZ", 1055 | "text": "你们知道有阳光守护那个小黑子吗?" 1056 | }, 1057 | { 1058 | "ns": "JigokuZ", 1059 | "speaker": "JigokuZ", 1060 | "text": "我今天回去打算拿我们我手机逝一逝" 1061 | }, 1062 | { 1063 | "ns": "JigokuZ", 1064 | "speaker": "JigokuZ", 1065 | "text": "我打算拿我妹手机逝一逝" 1066 | }, 1067 | { 1068 | "ns": "JigokuZ", 1069 | "speaker": "JigokuZ", 1070 | "text": "现在启动才占了60兆" 1071 | }, 1072 | { 1073 | "ns": "JigokuZ", 1074 | "speaker": "JigokuZ", 1075 | "text": "服务器的配置信息我还得改呢" 1076 | }, 1077 | { 1078 | "ns": "JigokuZ", 1079 | "speaker": "JigokuZ", 1080 | "text": "谁有spigot的下载?" 1081 | }, 1082 | { 1083 | "ns": "JigokuZ", 1084 | "speaker": "JigokuZ", 1085 | "text": "哎,这个说说,我这个不读模组到底是啥情况?" 1086 | }, 1087 | { 1088 | "ns": "JigokuZ", 1089 | "speaker": "JigokuZ", 1090 | "text": "谷歌浏览器通用的" 1091 | }, 1092 | { 1093 | "ns": "JigokuZ", 1094 | "speaker": "JigokuZ", 1095 | "text": "nm你让他给我删了NND" 1096 | }, 1097 | { 1098 | "ns": "JigokuZ", 1099 | "speaker": "JigokuZ", 1100 | "text": "gauHUB搞HUB?给HUB?" 1101 | }, 1102 | { 1103 | "ns": "JigokuZ", 1104 | "speaker": "JigokuZ", 1105 | "text": "我tm干你信不信" 1106 | }, 1107 | { 1108 | "ns": "GBrother", 1109 | "speaker": "GBrother", 1110 | "text": "买了被人一下打死了,死几小时" 1111 | }, 1112 | { 1113 | "ns": "GBrother", 1114 | "speaker": "GBrother", 1115 | "text": "咋死了怪不得安装不了(注:指宝塔面板)" 1116 | }, 1117 | { 1118 | "ns": "GBrother", 1119 | "speaker": "GBrother", 1120 | "text": "安装完宝塔打不开了" 1121 | }, 1122 | { 1123 | "ns": "GBrother", 1124 | "speaker": "GBrother", 1125 | "text": "(使用了)sudo rm -rf /*这个命令重装也不行" 1126 | }, 1127 | { 1128 | "ns": "GBrother", 1129 | "speaker": "GBrother", 1130 | "text": "(服务器)好了怎么安宝塔" 1131 | }, 1132 | { 1133 | "ns": "GBrother", 1134 | "speaker": "GBrother", 1135 | "text": "还没死,敢c我么" 1136 | }, 1137 | { 1138 | "ns": "GBrother", 1139 | "speaker": "GBrother", 1140 | "text": "(我服务器价格)70,4+4" 1141 | }, 1142 | { 1143 | "ns": "GBrother", 1144 | "speaker": "GBrother", 1145 | "text": "(服务器)好了怎么安宝塔" 1146 | }, 1147 | { 1148 | "ns": "GBrother", 1149 | "speaker": "GBrother", 1150 | "text": "你们给我打白了" 1151 | }, 1152 | { 1153 | "ns": "GBrother", 1154 | "speaker": "GBrother", 1155 | "text": "打不过就举报你们" 1156 | }, 1157 | { 1158 | "ns": "GBrother", 1159 | "speaker": "GBrother", 1160 | "text": "废了,要几天?" 1161 | }, 1162 | { 1163 | "ns": "GBrother", 1164 | "speaker": "GBrother", 1165 | "text": "我有两个执照" 1166 | }, 1167 | { 1168 | "ns": "GBrother", 1169 | "speaker": "GBrother", 1170 | "text": "我干嘛要备案" 1171 | }, 1172 | { 1173 | "ns": "GBrother", 1174 | "speaker": "GBrother", 1175 | "text": "(通过备案需要)半天容易的很" 1176 | }, 1177 | { 1178 | "ns": "GBrother", 1179 | "speaker": "GBrother", 1180 | "text": "这b要发卡圈了不少钱" 1181 | }, 1182 | { 1183 | "ns": "GBrother", 1184 | "speaker": "GBrother", 1185 | "text": "卖g的怎么举报?" 1186 | }, 1187 | { 1188 | "ns": "GBrother", 1189 | "speaker": "GBrother", 1190 | "text": "枪我不少用户" 1191 | }, 1192 | { 1193 | "ns": "JigokuZ", 1194 | "speaker": "Xinyue", 1195 | "text": "jdk1.8=jre1.8=java8" 1196 | }, 1197 | { 1198 | "ns": "JigokuZ", 1199 | "speaker": "science_797", 1200 | "text": "正常情况服务器每秒能运算20次" 1201 | }, 1202 | { 1203 | "ns": "JigokuZ", 1204 | "speaker": "science_797", 1205 | "text": "算了,不讲了,我的极简话语你可能听不懂" 1206 | }, 1207 | { 1208 | "ns": "jiyuyan", 1209 | "speaker": "jiyuyan", 1210 | "text": "关键是在中国境内能下载到Python吗?" 1211 | }, 1212 | { 1213 | "ns": "jiyuyan", 1214 | "speaker": "jiyuyan", 1215 | "text": "什么时候中国也能安装Python再说支持它吧。" 1216 | }, 1217 | { 1218 | "ns": "jiyuyan", 1219 | "speaker": "jiyuyan", 1220 | "text": "汇编是不需要优化的" 1221 | }, 1222 | { 1223 | "ns": "jiyuyan", 1224 | "speaker": "jiyuyan", 1225 | "text": "正是语言的抽象化开始, 造成太多低效率的代码" 1226 | }, 1227 | { 1228 | "ns": "jiyuyan", 1229 | "speaker": "jiyuyan", 1230 | "text": "为什么不用更简单又不需要优化的语法呢" 1231 | }, 1232 | { 1233 | "ns": "jiyuyan", 1234 | "speaker": "jiyuyan", 1235 | "text": "沉下去摸鱼, 就是不写代码" 1236 | }, 1237 | { 1238 | "ns": "jiyuyan", 1239 | "speaker": "jiyuyan", 1240 | "text": "今天录视频试用了下. 全是毛病," 1241 | }, 1242 | { 1243 | "ns": "jiyuyan", 1244 | "speaker": "jiyuyan", 1245 | "text": "这几天也在考虑用极语言开发IDE" 1246 | }, 1247 | { 1248 | "ns": "jiyuyan", 1249 | "speaker": "jiyuyan", 1250 | "text": "EAX,EBX,ECX,EDX,ESP,EBP,EDI,ESI,AX,BX,CX,DX,AH,CH,BH,DH,AL,BL,CL,DL这些英文名词, 你没学过 难道就懂吗" 1251 | }, 1252 | { 1253 | "ns": "jiyuyan", 1254 | "speaker": "jiyuyan", 1255 | "text": "纯中文编程真的极简单" 1256 | }, 1257 | { 1258 | "ns": "jiyuyan", 1259 | "speaker": "jiyuyan", 1260 | "text": "极语言的语法在所有编程里, 已经是最为简单了" 1261 | }, 1262 | { 1263 | "ns": "jiyuyan", 1264 | "speaker": "jiyuyan", 1265 | "text": "语法越复杂, 学起来肯定更难, 极语言是尽可能的使用最简单的语法, 但是也为了能兼容C和VB, 作出太大让步" 1266 | }, 1267 | { 1268 | "ns": "jiyuyan", 1269 | "speaker": "jiyuyan", 1270 | "text": "昨天悟到的就是这个意思" 1271 | }, 1272 | { 1273 | "ns": "jiyuyan", 1274 | "speaker": "jiyuyan", 1275 | "text": "体积小的程序一定能证明开发者的水平高" 1276 | }, 1277 | { 1278 | "ns": "jiyuyan", 1279 | "speaker": "jiyuyan", 1280 | "text": "因为说C#语法简单, 那就不合天理了." 1281 | }, 1282 | { 1283 | "ns": "jiyuyan", 1284 | "speaker": "jiyuyan", 1285 | "text": "中文占用空间大, 运行效率低, 都是因为易语言造成的. 而极语言生成的软件体积小, 直接打破这个谎言了" 1286 | }, 1287 | { 1288 | "ns": "jiyuyan", 1289 | "speaker": "jiyuyan", 1290 | "text": "我最不喜欢安装软件到电脑里了" 1291 | }, 1292 | { 1293 | "ns": "jiyuyan", 1294 | "speaker": "jiyuyan", 1295 | "text": "这位仁兄也是做中文Python的" 1296 | }, 1297 | { 1298 | "ns": "jiyuyan", 1299 | "speaker": "jiyuyan", 1300 | "text": "中文很难达到让别人看不懂这个装逼效果. 除非是文言文" 1301 | }, 1302 | { 1303 | "ns": "jiyuyan", 1304 | "speaker": "jiyuyan", 1305 | "text": "学过编程的看极语言几分钟就会得出结论" 1306 | }, 1307 | { 1308 | "ns": "jiyuyan", 1309 | "speaker": "jiyuyan", 1310 | "text": "实际上跟其它语言的相同功能一对比, 就发现极语言的代码简单太多了" 1311 | }, 1312 | { 1313 | "ns": "jiyuyan", 1314 | "speaker": "jiyuyan", 1315 | "text": "不是因为习惯了英文编程, 而是大家骨子里都觉得外来的东西一定更好" 1316 | }, 1317 | { 1318 | "ns": "jiyuyan", 1319 | "speaker": "jiyuyan", 1320 | "text": "将会尽快规范中文语法标准" 1321 | }, 1322 | { 1323 | "ns": "jiyuyan", 1324 | "speaker": "jiyuyan", 1325 | "text": "废除缩进, 禁用空格" 1326 | }, 1327 | { 1328 | "ns": "jiyuyan", 1329 | "speaker": "jiyuyan", 1330 | "text": "自动缩进功能尽快测试一下, 这个功能很快就会被禁用了" 1331 | }, 1332 | { 1333 | "ns": "jiyuyan", 1334 | "speaker": "jiyuyan", 1335 | "text": "我敢肯定没几个用过自动缩进" 1336 | }, 1337 | { 1338 | "ns": "jiyuyan", 1339 | "speaker": "jiyuyan", 1340 | "text": "所以既然大家都不喜欢用, 那就废弃它了" 1341 | }, 1342 | { 1343 | "ns": "dongwang", 1344 | "speaker": "dongwang", 1345 | "text": "我不要什么技术" 1346 | }, 1347 | { 1348 | "ns": "dongwang", 1349 | "speaker": "dongwang", 1350 | "text": "我就是技术" 1351 | }, 1352 | { 1353 | "ns": "dongwang", 1354 | "speaker": "dongwang", 1355 | "text": "我的运维能力一点都不低于技术" 1356 | }, 1357 | { 1358 | "ns": "dongwang", 1359 | "speaker": "dongwang", 1360 | "text": "这就是事实" 1361 | }, 1362 | { 1363 | "ns": "dongwang", 1364 | "speaker": "dongwang", 1365 | "text": "实际上真的很可笑" 1366 | }, 1367 | { 1368 | "ns": "dongwang", 1369 | "speaker": "dongwang", 1370 | "text": "继续狗叫" 1371 | }, 1372 | { 1373 | "ns": "dongwang", 1374 | "speaker": "dongwang", 1375 | "text": "我用另一台机器连的7700k机器的ipmi" 1376 | }, 1377 | { 1378 | "ns": "dongwang", 1379 | "speaker": "dongwang", 1380 | "text": "只要能塞得进去bios能够识别就能运行" 1381 | }, 1382 | { 1383 | "ns": "dongwang", 1384 | "speaker": "dongwang", 1385 | "text": "ipmi是在主板上的一块单片机和cpu有关系?" 1386 | }, 1387 | { 1388 | "ns": "dongwang", 1389 | "speaker": "dongwang", 1390 | "text": "前面我有提到过我为什么讨厌自动化" 1391 | }, 1392 | { 1393 | "ns": "dongwang", 1394 | "speaker": "dongwang", 1395 | "text": "我的7700k终于上架了准备用ipmi装系统" 1396 | }, 1397 | { 1398 | "ns": "dongwang", 1399 | "speaker": "dongwang", 1400 | "text": "我就喜欢用原生iso安装" 1401 | }, 1402 | { 1403 | "ns": "dongwang", 1404 | "speaker": "dongwang", 1405 | "text": "听不懂人话?" 1406 | }, 1407 | { 1408 | "ns": "dongwang", 1409 | "speaker": "dongwang", 1410 | "text": "那不是人啊" 1411 | }, 1412 | { 1413 | "ns": "dongwang", 1414 | "speaker": "dongwang", 1415 | "text": "一般那些垃圾服务商自动化安装系统都是pxe网络启动" 1416 | }, 1417 | { 1418 | "ns": "dongwang", 1419 | "speaker": "dongwang", 1420 | "text": "我就是嫌他垃圾" 1421 | }, 1422 | { 1423 | "ns": "dongwang", 1424 | "speaker": "dongwang", 1425 | "text": "我才需要手懂安装" 1426 | }, 1427 | { 1428 | "ns": "dongwang", 1429 | "speaker": "dongwang", 1430 | "text": "这玩意和通过iso安装程序手动安装的还是有区别的" 1431 | }, 1432 | { 1433 | "ns": "dongwang", 1434 | "speaker": "dongwang", 1435 | "text": "linux快的原因只是没有gui" 1436 | }, 1437 | { 1438 | "ns": "dongwang", 1439 | "speaker": "dongwang", 1440 | "text": "嫌这个垃圾,那个垃圾" 1441 | }, 1442 | { 1443 | "ns": "dongwang", 1444 | "speaker": "dongwang", 1445 | "text": "自己又没什么能力" 1446 | }, 1447 | { 1448 | "ns": "dongwang", 1449 | "speaker": "dongwang", 1450 | "text": "自己又不会开发" 1451 | }, 1452 | { 1453 | "ns": "dongwang", 1454 | "speaker": "dongwang", 1455 | "text": "整天就会狗叫" 1456 | }, 1457 | { 1458 | "ns": "dongwang", 1459 | "speaker": "dongwang", 1460 | "text": "不陪你们玩了,装系统去了" 1461 | }, 1462 | { 1463 | "ns": "dongwang", 1464 | "speaker": "dongwang", 1465 | "text": "饭桶分配了一个掩码长度31位的IP不知道能不能配" 1466 | }, 1467 | { 1468 | "ns": "dongwang", 1469 | "speaker": "dongwang", 1470 | "text": "长度31位,明明只有两个可以用IP" 1471 | }, 1472 | { 1473 | "ns": "dongwang", 1474 | "speaker": "dongwang", 1475 | "text": "一个是网络号,一个是广播" 1476 | }, 1477 | { 1478 | "ns": "dongwang", 1479 | "speaker": "dongwang", 1480 | "text": "根本就没有主机地址" 1481 | }, 1482 | { 1483 | "ns": "dongwang", 1484 | "speaker": "dongwang", 1485 | "text": "网络好就是网关" 1486 | }, 1487 | { 1488 | "ns": "dongwang", 1489 | "speaker": "dongwang", 1490 | "text": "网络号可以当网关用" 1491 | }, 1492 | { 1493 | "ns": "dongwang", 1494 | "speaker": "dongwang", 1495 | "text": "不知道他们怎么做到的" 1496 | }, 1497 | { 1498 | "ns": "dongwang", 1499 | "speaker": "dongwang", 1500 | "text": "这协议已经扭曲了吧" 1501 | }, 1502 | { 1503 | "ns": "dongwang", 1504 | "speaker": "dongwang", 1505 | "text": "太牛逼了有实力" 1506 | }, 1507 | { 1508 | "ns": "dongwang", 1509 | "speaker": "dongwang", 1510 | "text": "他们怎么做到分配31位长度掩码的" 1511 | }, 1512 | { 1513 | "ns": "dongwang", 1514 | "speaker": "dongwang", 1515 | "text": "但我怕装完系统绑不上ip" 1516 | }, 1517 | { 1518 | "ns": "dongwang", 1519 | "speaker": "dongwang", 1520 | "text": "31位掩码长度的ip" 1521 | }, 1522 | { 1523 | "ns": "dongwang", 1524 | "speaker": "dongwang", 1525 | "text": "在手机银行转兑一下货币就可以用了" 1526 | }, 1527 | { 1528 | "ns": "dongwang", 1529 | "speaker": "dongwang", 1530 | "text": "信用卡才可以直接付" 1531 | }, 1532 | { 1533 | "ns": "dongwang", 1534 | "speaker": "dongwang", 1535 | "text": "借记卡要转" 1536 | }, 1537 | { 1538 | "ns": "dongwang", 1539 | "speaker": "dongwang", 1540 | "text": "借记卡里面是没有钱的" 1541 | }, 1542 | { 1543 | "ns": "dongwang", 1544 | "speaker": "dongwang", 1545 | "text": "所以还得转兑货币冲进去" 1546 | }, 1547 | { 1548 | "ns": "dongwang", 1549 | "speaker": "dongwang", 1550 | "text": "因为是外币,直接也转不进去" 1551 | }, 1552 | { 1553 | "ns": "dongwang", 1554 | "speaker": "dongwang", 1555 | "text": "给我看看你花旗银行" 1556 | }, 1557 | { 1558 | "ns": "dongwang", 1559 | "speaker": "dongwang", 1560 | "text": "给我们欣赏一下没见过" 1561 | }, 1562 | { 1563 | "ns": "dongwang", 1564 | "speaker": "dongwang", 1565 | "text": "信用卡没有什么双不双币的" 1566 | }, 1567 | { 1568 | "ns": "dongwang", 1569 | "speaker": "dongwang", 1570 | "text": "是人民币的额度" 1571 | }, 1572 | { 1573 | "ns": "dongwang", 1574 | "speaker": "dongwang", 1575 | "text": "但是你付款的时候" 1576 | }, 1577 | { 1578 | "ns": "dongwang", 1579 | "speaker": "dongwang", 1580 | "text": "它会自动转货币" 1581 | }, 1582 | { 1583 | "ns": "dongwang", 1584 | "speaker": "dongwang", 1585 | "text": "以相同的汇率进行付款" 1586 | }, 1587 | { 1588 | "ns": "dongwang", 1589 | "speaker": "dongwang", 1590 | "text": "扣减的是人民币的额度" 1591 | }, 1592 | { 1593 | "ns": "dongwang", 1594 | "speaker": "dongwang", 1595 | "text": "visa或者万事达或者美国运通" 1596 | }, 1597 | { 1598 | "ns": "dongwang", 1599 | "speaker": "dongwang", 1600 | "text": "信用卡本身是没有钱的,用的是信用额度但是借记卡不一样" 1601 | }, 1602 | { 1603 | "ns": "dongwang", 1604 | "speaker": "dongwang", 1605 | "text": "就像你银联一样得存进去" 1606 | }, 1607 | { 1608 | "ns": "dongwang", 1609 | "speaker": "dongwang", 1610 | "text": "我确实什么都懂了" 1611 | }, 1612 | { 1613 | "ns": "dongwang", 1614 | "speaker": "dongwang", 1615 | "text": "真的什么都懂一点" 1616 | }, 1617 | { 1618 | "ns": "dongwang", 1619 | "speaker": "dongwang", 1620 | "text": "无论你说什么我都能答得出来" 1621 | }, 1622 | { 1623 | "ns": "dongwang", 1624 | "speaker": "dongwang", 1625 | "text": "我有时候也觉得很牛逼" 1626 | }, 1627 | { 1628 | "ns": "dongwang", 1629 | "speaker": "dongwang", 1630 | "text": "我明明没查过资料都懂" 1631 | }, 1632 | { 1633 | "ns": "dongwang", 1634 | "speaker": "dongwang", 1635 | "text": "双和多一样" 1636 | }, 1637 | { 1638 | "ns": "dongwang", 1639 | "speaker": "dongwang", 1640 | "text": "在你的眼里2=100" 1641 | }, 1642 | { 1643 | "ns": "dongwang", 1644 | "speaker": "dongwang", 1645 | "text": "唉哟,逻辑不通" 1646 | }, 1647 | { 1648 | "ns": "dongwang", 1649 | "speaker": "dongwang", 1650 | "text": "你就会装逼可是我懂了" 1651 | }, 1652 | { 1653 | "ns": "dongwang", 1654 | "speaker": "dongwang", 1655 | "text": "对象是干嘛的?" 1656 | }, 1657 | { 1658 | "ns": "dongwang", 1659 | "speaker": "dongwang", 1660 | "text": "满足欲望的吗?" 1661 | }, 1662 | { 1663 | "ns": "dongwang", 1664 | "speaker": "dongwang", 1665 | "text": "那你有没有被人操过?" 1666 | }, 1667 | { 1668 | "ns": "dongwang", 1669 | "speaker": "dongwang", 1670 | "text": "其实你也看得出来我有水平" 1671 | }, 1672 | { 1673 | "ns": "dongwang", 1674 | "speaker": "dongwang", 1675 | "text": "不要再自欺欺人了" 1676 | }, 1677 | { 1678 | "ns": "dongwang", 1679 | "speaker": "dongwang", 1680 | "text": "你骗得了我,你骗得了自己吗?" 1681 | }, 1682 | { 1683 | "ns": "dongwang", 1684 | "speaker": "dongwang", 1685 | "text": "你骗得了所有人啊" 1686 | }, 1687 | { 1688 | "ns": "dongwang", 1689 | "speaker": "dongwang", 1690 | "text": "你可以侮辱我,可以说我装" 1691 | }, 1692 | { 1693 | "ns": "dongwang", 1694 | "speaker": "dongwang", 1695 | "text": "但是你内心依然很清楚" 1696 | }, 1697 | { 1698 | "ns": "dongwang", 1699 | "speaker": "dongwang", 1700 | "text": "你还是处吗?" 1701 | }, 1702 | { 1703 | "ns": "dongwang", 1704 | "speaker": "dongwang", 1705 | "text": "想不想和男人打炮?" 1706 | }, 1707 | { 1708 | "ns": "dongwang", 1709 | "speaker": "dongwang", 1710 | "text": "聪明人都是不正常的" 1711 | }, 1712 | { 1713 | "ns": "dongwang", 1714 | "speaker": "dongwang", 1715 | "text": "你们觉得我正常才有问题" 1716 | }, 1717 | { 1718 | "ns": "dongwang", 1719 | "speaker": "dongwang", 1720 | "text": "哈哈哈哈开始秀了" 1721 | }, 1722 | { 1723 | "ns": "dongwang", 1724 | "speaker": "dongwang", 1725 | "text": "我的水平在他们之上" 1726 | }, 1727 | { 1728 | "ns": "dongwang", 1729 | "speaker": "dongwang", 1730 | "text": "大家有目共睹" 1731 | }, 1732 | { 1733 | "ns": "dongwang", 1734 | "speaker": "dongwang", 1735 | "text": "你还记得那天怎么被我打脸的吗?" 1736 | }, 1737 | { 1738 | "ns": "dongwang", 1739 | "speaker": "dongwang", 1740 | "text": "你还要继续装吗?" 1741 | }, 1742 | { 1743 | "ns": "dongwang", 1744 | "speaker": "dongwang", 1745 | "text": "一问三不知你还有脸?" 1746 | }, 1747 | { 1748 | "ns": "dongwang", 1749 | "speaker": "dongwang", 1750 | "text": "jre和jdk会用吗?" 1751 | }, 1752 | { 1753 | "ns": "dongwang", 1754 | "speaker": "dongwang", 1755 | "text": "来我给你一个程序给我跑起来" 1756 | }, 1757 | { 1758 | "ns": "dongwang", 1759 | "speaker": "dongwang", 1760 | "text": "我没让你写" 1761 | }, 1762 | { 1763 | "ns": "dongwang", 1764 | "speaker": "dongwang", 1765 | "text": "你这种垃圾我见多了" 1766 | }, 1767 | { 1768 | "ns": "dongwang", 1769 | "speaker": "dongwang", 1770 | "text": "想来打我吗?来呀" 1771 | }, 1772 | { 1773 | "ns": "dongwang", 1774 | "speaker": "dongwang", 1775 | "text": "我就知道你会这样说" 1776 | }, 1777 | { 1778 | "ns": "dongwang", 1779 | "speaker": "dongwang", 1780 | "text": "我装逼有实力" 1781 | }, 1782 | { 1783 | "ns": "dongwang", 1784 | "speaker": "dongwang", 1785 | "text": "你有什么实力你懂什么?" 1786 | }, 1787 | { 1788 | "ns": "dongwang", 1789 | "speaker": "dongwang", 1790 | "text": "小学生活在自己的世界" 1791 | }, 1792 | { 1793 | "ns": "dongwang", 1794 | "speaker": "dongwang", 1795 | "text": "你以为你比我懂" 1796 | }, 1797 | { 1798 | "ns": "dongwang", 1799 | "speaker": "dongwang", 1800 | "text": "我的知识储备已经是你的多少倍了" 1801 | }, 1802 | { 1803 | "ns": "dongwang", 1804 | "speaker": "dongwang", 1805 | "text": "你脑子有毛病?" 1806 | }, 1807 | { 1808 | "ns": "dongwang", 1809 | "speaker": "dongwang", 1810 | "text": "我一个月服务器费用顶你一年" 1811 | }, 1812 | { 1813 | "ns": "dongwang", 1814 | "speaker": "dongwang", 1815 | "text": "老子都他妈说了不在家" 1816 | }, 1817 | { 1818 | "ns": "dongwang", 1819 | "speaker": "dongwang", 1820 | "text": "我才临时用另一台机器" 1821 | }, 1822 | { 1823 | "ns": "dongwang", 1824 | "speaker": "dongwang", 1825 | "text": "而且我做网站又没收入主要是好玩" 1826 | }, 1827 | { 1828 | "ns": "dongwang", 1829 | "speaker": "dongwang", 1830 | "text": "而你什么都不懂" 1831 | }, 1832 | { 1833 | "ns": "dongwang", 1834 | "speaker": "dongwang", 1835 | "text": "被我打脸之后你气急败坏你非常生气" 1836 | }, 1837 | { 1838 | "ns": "dongwang", 1839 | "speaker": "dongwang", 1840 | "text": "你伤害不到我" 1841 | }, 1842 | { 1843 | "ns": "dongwang", 1844 | "speaker": "dongwang", 1845 | "text": "你已经破防了" 1846 | }, 1847 | { 1848 | "ns": "dongwang", 1849 | "speaker": "dongwang", 1850 | "text": "你现在只能靠嘴了" 1851 | }, 1852 | { 1853 | "ns": "dongwang", 1854 | "speaker": "dongwang", 1855 | "text": "说实话,在现实中我直接把你打死" 1856 | }, 1857 | { 1858 | "ns": "dongwang", 1859 | "speaker": "dongwang", 1860 | "text": "你以为你是什么东西?" 1861 | }, 1862 | { 1863 | "ns": "dongwang", 1864 | "speaker": "dongwang", 1865 | "text": "你以为自己很有实力,垃圾一个" 1866 | }, 1867 | { 1868 | "ns": "dongwang", 1869 | "speaker": "dongwang", 1870 | "text": "此时此刻我无法用语言来形容我有多么开心" 1871 | }, 1872 | { 1873 | "ns": "dongwang", 1874 | "speaker": "dongwang", 1875 | "text": "我只需要看着你表演,看着你耍猴就足矣了" 1876 | }, 1877 | { 1878 | "ns": "liuzhan", 1879 | "speaker": "liuzhan", 1880 | "text": "开始装瞎了" 1881 | }, 1882 | { 1883 | "ns": "liuzhan", 1884 | "speaker": "liuzhan", 1885 | "text": "我没说我在北京啊" 1886 | }, 1887 | { 1888 | "ns": "liuzhan", 1889 | "speaker": "liuzhan", 1890 | "text": "我说了我人在广西" 1891 | }, 1892 | { 1893 | "ns": "liuzhan", 1894 | "speaker": "liuzhan", 1895 | "text": "是不是在北京打工的" 1896 | }, 1897 | { 1898 | "ns": "liuzhan", 1899 | "speaker": "liuzhan", 1900 | "text": "老家跟居住地一样吗" 1901 | }, 1902 | { 1903 | "ns": "liuzhan", 1904 | "speaker": "liuzhan", 1905 | "text": "广西建工集团这是我家的企业" 1906 | }, 1907 | { 1908 | "ns": "liuzhan", 1909 | "speaker": "liuzhan", 1910 | "text": "你的好朋友吴泽凡的信息已经被掌握了" 1911 | }, 1912 | { 1913 | "ns": "liuzhan", 1914 | "speaker": "liuzhan", 1915 | "text": "电脑的存储只能是128.256.512.1024" 1916 | }, 1917 | { 1918 | "ns": "liuzhan", 1919 | "speaker": "liuzhan", 1920 | "text": "你的电脑多少GB,不会是1024这种垃圾货吧" 1921 | }, 1922 | { 1923 | "ns": "liuzhan", 1924 | "speaker": "liuzhan", 1925 | "text": "我一个cpu就顶你十台电脑了" 1926 | }, 1927 | { 1928 | "ns": "liuzhan", 1929 | "speaker": "liuzhan", 1930 | "text": "反正我不知道为什么很简单的东西有人会用搜索" 1931 | }, 1932 | { 1933 | "ns": "liuzhan", 1934 | "speaker": "liuzhan", 1935 | "text": "还非得说详细点让你空手套白狼?" 1936 | }, 1937 | { 1938 | "ns": "liuzhan", 1939 | "speaker": "liuzhan", 1940 | "text": "我学网络安全的" 1941 | }, 1942 | { 1943 | "ns": "liuzhan", 1944 | "speaker": "liuzhan", 1945 | "text": "我同学确实有从职高毕业的" 1946 | }, 1947 | { 1948 | "ns": "liuzhan", 1949 | "speaker": "liuzhan", 1950 | "text": "知道什么是VB吗" 1951 | }, 1952 | { 1953 | "ns": "liuzhan", 1954 | "speaker": "liuzhan", 1955 | "text": "IP在通信子网内是唯一的" 1956 | }, 1957 | { 1958 | "ns": "liuzhan", 1959 | "speaker": "liuzhan", 1960 | "text": "那些说改IP的实际上也只是掩耳盗铃" 1961 | }, 1962 | { 1963 | "ns": "liuzhan", 1964 | "speaker": "liuzhan", 1965 | "text": "回头又说我掐头去尾" 1966 | }, 1967 | { 1968 | "ns": "liuzhan", 1969 | "speaker": "liuzhan", 1970 | "text": "说不过就开始转移话题指鹿为马了是吗" 1971 | }, 1972 | { 1973 | "ns": "liuzhan", 1974 | "speaker": "liuzhan", 1975 | "text": "伪造网站,造假网站是违法的" 1976 | }, 1977 | { 1978 | "ns": "liuzhan", 1979 | "speaker": "liuzhan", 1980 | "text": "正常的百度百科可不会出现404" 1981 | }, 1982 | { 1983 | "ns": "liuzhan", 1984 | "speaker": "liuzhan", 1985 | "text": "你相信百科还是普通人的评论?" 1986 | }, 1987 | { 1988 | "ns": "liuzhan", 1989 | "speaker": "liuzhan", 1990 | "text": "那就不是无用的东西" 1991 | }, 1992 | { 1993 | "ns": "liuzhan", 1994 | "speaker": "liuzhan", 1995 | "text": "连后门都不知道也称自己是学计算机的?" 1996 | }, 1997 | { 1998 | "ns": "liuzhan", 1999 | "speaker": "liuzhan", 2000 | "text": "你知道什么是数字信封吗" 2001 | }, 2002 | { 2003 | "ns": "liuzhan", 2004 | "speaker": "liuzhan", 2005 | "text": "以前百度也是用的数字信封" 2006 | }, 2007 | { 2008 | "ns": "liuzhan", 2009 | "speaker": "liuzhan", 2010 | "text": "但那是软件的后门" 2011 | }, 2012 | { 2013 | "ns": "liuzhan", 2014 | "speaker": "liuzhan", 2015 | "text": "我就是学计算机专业的" 2016 | }, 2017 | { 2018 | "ns": "liuzhan", 2019 | "speaker": "liuzhan", 2020 | "text": "我不用你教" 2021 | }, 2022 | { 2023 | "ns": "liuzhan", 2024 | "speaker": "liuzhan", 2025 | "text": "百科是这个世纪的软件" 2026 | }, 2027 | { 2028 | "ns": "liuzhan", 2029 | "speaker": "liuzhan", 2030 | "text": "伪造个不知道的事件来混淆视听?" 2031 | }, 2032 | { 2033 | "ns": "liuzhan", 2034 | "speaker": "liuzhan", 2035 | "text": "你父母工作会受影响,你爷爷叫啥我也知道" 2036 | }, 2037 | { 2038 | "ns": "liuzhan", 2039 | "speaker": "liuzhan", 2040 | "text": "我知道你父母的工作单位" 2041 | } 2042 | ] 2043 | -------------------------------------------------------------------------------- /data_schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "type": "array", 4 | "items": { 5 | "$ref": "#/definitions/TextDatum" 6 | }, 7 | "definitions": { 8 | "TextDatum": { 9 | "type": "object", 10 | "additionalProperties": false, 11 | "properties": { 12 | "ns": { 13 | "type": "string" 14 | }, 15 | "speaker": { 16 | "type": "string" 17 | }, 18 | "text": { 19 | "type": "string" 20 | } 21 | }, 22 | "required": [ 23 | "ns", 24 | "speaker", 25 | "text" 26 | ], 27 | "title": "TextDatum" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/lezi-wiki/lezi-api 2 | 3 | go 1.19 4 | 5 | require ( 6 | github.com/fatih/color v1.13.0 7 | github.com/gin-contrib/cors v1.4.0 8 | github.com/gin-gonic/gin v1.8.1 9 | github.com/go-ini/ini v1.67.0 10 | github.com/go-playground/validator/v10 v10.11.1 11 | github.com/go-redis/redis/v8 v8.11.5 12 | github.com/google/wire v0.5.0 13 | github.com/idoubi/goz v1.3.2 14 | github.com/robfig/cron/v3 v3.0.1 15 | github.com/samber/lo v1.34.0 16 | github.com/sirupsen/logrus v1.9.0 17 | github.com/speps/go-hashids/v2 v2.0.1 18 | github.com/stretchr/testify v1.8.0 19 | gorm.io/driver/mysql v1.4.3 20 | gorm.io/driver/postgres v1.3.10 21 | gorm.io/driver/sqlite v1.3.6 22 | gorm.io/driver/sqlserver v1.3.2 23 | gorm.io/gorm v1.23.10 24 | ) 25 | 26 | require ( 27 | github.com/basgys/goxml2json v1.1.0 // indirect 28 | github.com/cespare/xxhash/v2 v2.1.2 // indirect 29 | github.com/davecgh/go-spew v1.1.1 // indirect 30 | github.com/denisenkom/go-mssqldb v0.12.2 // indirect 31 | github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect 32 | github.com/gin-contrib/sse v0.1.0 // indirect 33 | github.com/go-playground/locales v0.14.0 // indirect 34 | github.com/go-playground/universal-translator v0.18.0 // indirect 35 | github.com/go-sql-driver/mysql v1.6.0 // indirect 36 | github.com/goccy/go-json v0.9.10 // indirect 37 | github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect 38 | github.com/golang-sql/sqlexp v0.1.0 // indirect 39 | github.com/idoubi/goutils v1.1.0 // indirect 40 | github.com/jackc/chunkreader/v2 v2.0.1 // indirect 41 | github.com/jackc/pgconn v1.13.0 // indirect 42 | github.com/jackc/pgio v1.0.0 // indirect 43 | github.com/jackc/pgpassfile v1.0.0 // indirect 44 | github.com/jackc/pgproto3/v2 v2.3.1 // indirect 45 | github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect 46 | github.com/jackc/pgtype v1.12.0 // indirect 47 | github.com/jackc/pgx/v4 v4.17.2 // indirect 48 | github.com/jinzhu/inflection v1.0.0 // indirect 49 | github.com/jinzhu/now v1.1.5 // indirect 50 | github.com/json-iterator/go v1.1.12 // indirect 51 | github.com/leodido/go-urn v1.2.1 // indirect 52 | github.com/mattn/go-colorable v0.1.12 // indirect 53 | github.com/mattn/go-isatty v0.0.14 // indirect 54 | github.com/mattn/go-sqlite3 v1.14.15 // indirect 55 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 56 | github.com/modern-go/reflect2 v1.0.2 // indirect 57 | github.com/pelletier/go-toml/v2 v2.0.2 // indirect 58 | github.com/pmezard/go-difflib v1.0.0 // indirect 59 | github.com/spf13/cast v1.5.0 // indirect 60 | github.com/tidwall/gjson v1.14.3 // indirect 61 | github.com/tidwall/match v1.1.1 // indirect 62 | github.com/tidwall/pretty v1.2.1 // indirect 63 | github.com/ugorji/go/codec v1.2.7 // indirect 64 | github.com/yoda-of-soda/map2xml v1.0.2 // indirect 65 | golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect 66 | golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect 67 | golang.org/x/net v0.0.0-20221004154528-8021a29435af // indirect 68 | golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect 69 | golang.org/x/text v0.3.7 // indirect 70 | google.golang.org/protobuf v1.28.0 // indirect 71 | gopkg.in/yaml.v2 v2.4.0 // indirect 72 | gopkg.in/yaml.v3 v3.0.1 // indirect 73 | ) 74 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= 2 | github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= 3 | github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= 4 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 5 | github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= 6 | github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= 7 | github.com/basgys/goxml2json v1.1.0 h1:4ln5i4rseYfXNd86lGEB+Vi652IsIXIvggKM/BhUKVw= 8 | github.com/basgys/goxml2json v1.1.0/go.mod h1:wH7a5Np/Q4QoECFIU8zTQlZwZkrilY0itPfecMw41Dw= 9 | github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= 10 | github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= 11 | github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= 12 | github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= 13 | github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= 14 | github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 15 | github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= 16 | github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= 17 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 18 | github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 19 | github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= 20 | github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 21 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 22 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 23 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 24 | github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= 25 | github.com/denisenkom/go-mssqldb v0.12.2 h1:1OcPn5GBIobjWNd+8yjfHNIaFX14B1pWI3F9HZy5KXw= 26 | github.com/denisenkom/go-mssqldb v0.12.2/go.mod h1:lnIw1mZukFRZDJYQ0Pb833QS2IaC3l5HkEfra2LJ+sk= 27 | github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= 28 | github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= 29 | github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= 30 | github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= 31 | github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= 32 | github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= 33 | github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= 34 | github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= 35 | github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g= 36 | github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs= 37 | github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= 38 | github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= 39 | github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= 40 | github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= 41 | github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= 42 | github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= 43 | github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= 44 | github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= 45 | github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= 46 | github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= 47 | github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= 48 | github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= 49 | github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= 50 | github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= 51 | github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= 52 | github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= 53 | github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= 54 | github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= 55 | github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= 56 | github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= 57 | github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= 58 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 59 | github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= 60 | github.com/goccy/go-json v0.9.10 h1:hCeNmprSNLB8B8vQKWl6DpuH0t60oEs+TAk9a7CScKc= 61 | github.com/goccy/go-json v0.9.10/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= 62 | github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= 63 | github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= 64 | github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= 65 | github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= 66 | github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= 67 | github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= 68 | github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= 69 | github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= 70 | github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= 71 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 72 | github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 73 | github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= 74 | github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= 75 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 76 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 77 | github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= 78 | github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 79 | github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= 80 | github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= 81 | github.com/idoubi/goutils v1.1.0 h1:smTFLbmrfI75oenon6eDzbg2O4surG2T6z8Y6RfWCFs= 82 | github.com/idoubi/goutils v1.1.0/go.mod h1:BVikG2hf3aDWXsBzBw3X7l4jSuuxNQQVgrxQ6amIAOk= 83 | github.com/idoubi/goz v1.3.2 h1:y8xSVjLGhoqxazBMHpof5AKO8FfzmcGpZRdMW4t7qZs= 84 | github.com/idoubi/goz v1.3.2/go.mod h1:zo/+7uz3HakSmWuTTob2tGpcsKIXTtw3Alzj4/cBCFA= 85 | github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= 86 | github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= 87 | github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= 88 | github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= 89 | github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= 90 | github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= 91 | github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= 92 | github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= 93 | github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= 94 | github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= 95 | github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys= 96 | github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI= 97 | github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= 98 | github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= 99 | github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= 100 | github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= 101 | github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= 102 | github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= 103 | github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= 104 | github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= 105 | github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= 106 | github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= 107 | github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= 108 | github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= 109 | github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= 110 | github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= 111 | github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= 112 | github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y= 113 | github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= 114 | github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= 115 | github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= 116 | github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= 117 | github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= 118 | github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= 119 | github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= 120 | github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w= 121 | github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= 122 | github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= 123 | github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= 124 | github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= 125 | github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= 126 | github.com/jackc/pgx/v4 v4.17.2 h1:0Ut0rpeKwvIVbMQ1KbMBU4h6wxehBI535LK6Flheh8E= 127 | github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw= 128 | github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= 129 | github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= 130 | github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= 131 | github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= 132 | github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= 133 | github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= 134 | github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= 135 | github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= 136 | github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= 137 | github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= 138 | github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= 139 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 140 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 141 | github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 142 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 143 | github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 144 | github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= 145 | github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= 146 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 147 | github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= 148 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 149 | github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= 150 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 151 | github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= 152 | github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= 153 | github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 154 | github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 155 | github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 156 | github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= 157 | github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 158 | github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= 159 | github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 160 | github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 161 | github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= 162 | github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= 163 | github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 164 | github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 165 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 166 | github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= 167 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= 168 | github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= 169 | github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI= 170 | github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= 171 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 172 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 173 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 174 | github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= 175 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= 176 | github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= 177 | github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= 178 | github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= 179 | github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= 180 | github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= 181 | github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= 182 | github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= 183 | github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= 184 | github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= 185 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 186 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 187 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 188 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 189 | github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= 190 | github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= 191 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 192 | github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= 193 | github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= 194 | github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= 195 | github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= 196 | github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= 197 | github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= 198 | github.com/samber/lo v1.34.0 h1:1ZqcyX4642t1E/4gKEfA7ycqSYMqsKYN09AVZbME+aQ= 199 | github.com/samber/lo v1.34.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8= 200 | github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= 201 | github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= 202 | github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= 203 | github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= 204 | github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= 205 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 206 | github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= 207 | github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= 208 | github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= 209 | github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= 210 | github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= 211 | github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= 212 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 213 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 214 | github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 215 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 216 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 217 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 218 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 219 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 220 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 221 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 222 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 223 | github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= 224 | github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= 225 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 226 | github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= 227 | github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw= 228 | github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= 229 | github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= 230 | github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= 231 | github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= 232 | github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= 233 | github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= 234 | github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= 235 | github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= 236 | github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= 237 | github.com/yoda-of-soda/map2xml v1.0.2 h1:z3Io7yyf2UFovGcy1b4ct50ci9KbLk8YmyjTpMRgXZ4= 238 | github.com/yoda-of-soda/map2xml v1.0.2/go.mod h1:kEZVcMDvg9pYiosS3G3xWl/C2LspDkrYY294J50dqjc= 239 | github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= 240 | go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 241 | go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 242 | go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 243 | go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= 244 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 245 | go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= 246 | go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= 247 | go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= 248 | go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 249 | go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 250 | go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= 251 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 252 | golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= 253 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 254 | golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 255 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 256 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 257 | golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 258 | golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= 259 | golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 260 | golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 261 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 262 | golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 263 | golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 264 | golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= 265 | golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 266 | golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM= 267 | golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= 268 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 269 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 270 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 271 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 272 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 273 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 274 | golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 275 | golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 276 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 277 | golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 278 | golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 279 | golang.org/x/net v0.0.0-20221004154528-8021a29435af h1:wv66FM3rLZGPdxpYL+ApnDe2HzHcTFta3z5nsc13wI4= 280 | golang.org/x/net v0.0.0-20221004154528-8021a29435af/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= 281 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 282 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 283 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 284 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 285 | golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 286 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 287 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 288 | golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 289 | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 290 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 291 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 292 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 293 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 294 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 295 | golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 296 | golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 297 | golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 298 | golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 299 | golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= 300 | golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 301 | golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 302 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 303 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 304 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 305 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 306 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 307 | golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 308 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 309 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 310 | golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= 311 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 312 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 313 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 314 | golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 315 | golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 316 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 317 | golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 318 | golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 319 | golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 320 | golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 321 | golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 322 | golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 323 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 324 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 325 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 326 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= 327 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 328 | google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= 329 | google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= 330 | google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 331 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 332 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 333 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= 334 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= 335 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 336 | gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= 337 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 338 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 339 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 340 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 341 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 342 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 343 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 344 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 345 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 346 | gorm.io/driver/mysql v1.4.3 h1:/JhWJhO2v17d8hjApTltKNADm7K7YI2ogkR7avJUL3k= 347 | gorm.io/driver/mysql v1.4.3/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c= 348 | gorm.io/driver/postgres v1.3.10 h1:Fsd+pQpFMGlGxxVMUPJhNo8gG8B1lKtk8QQ4/VZZAJw= 349 | gorm.io/driver/postgres v1.3.10/go.mod h1:whNfh5WhhHs96honoLjBAMwJGYEuA3m1hvgUbNXhPCw= 350 | gorm.io/driver/sqlite v1.3.6 h1:Fi8xNYCUplOqWiPa3/GuCeowRNBRGTf62DEmhMDHeQQ= 351 | gorm.io/driver/sqlite v1.3.6/go.mod h1:Sg1/pvnKtbQ7jLXxfZa+jSHvoX8hoZA8cn4xllOMTgE= 352 | gorm.io/driver/sqlserver v1.3.2 h1:yYt8f/xdAKLY7lCCyXxIUEgZ/WsURos3dHrx8MKFGAk= 353 | gorm.io/driver/sqlserver v1.3.2/go.mod h1:w25Vrx2BG+CJNUu/xKbFhaKlGxT/nzRkhWCCoptX8tQ= 354 | gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= 355 | gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= 356 | gorm.io/gorm v1.23.7/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= 357 | gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= 358 | gorm.io/gorm v1.23.10 h1:4Ne9ZbzID9GUxRkllxN4WjJKpsHx8YbKvekVdgyWh24= 359 | gorm.io/gorm v1.23.10/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= 360 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 361 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | _ "embed" 5 | "flag" 6 | "github.com/lezi-wiki/lezi-api/bootstrap" 7 | "github.com/lezi-wiki/lezi-api/pkg/conf" 8 | "github.com/lezi-wiki/lezi-api/pkg/cron" 9 | "github.com/lezi-wiki/lezi-api/pkg/log" 10 | "github.com/lezi-wiki/lezi-api/pkg/util" 11 | "github.com/lezi-wiki/lezi-api/routers" 12 | ) 13 | 14 | var ( 15 | isEject bool 16 | confPath string 17 | updateEndpoint string 18 | ) 19 | 20 | func init() { 21 | flag.StringVar(&confPath, "c", util.RelativePath("conf.ini"), "配置文件路径") 22 | flag.StringVar(&updateEndpoint, "update", "https://raw.githubusercontent.com/lezi-wiki/lezi-api/master/data.json", "数据更新地址") 23 | flag.BoolVar(&isEject, "eject", false, "导出内置静态资源") 24 | flag.Parse() 25 | 26 | bootstrap.Init(confPath, updateEndpoint) 27 | } 28 | 29 | func main() { 30 | if updateEndpoint != "false" { 31 | cron.InitJobs() 32 | } else { 33 | log.Log().Warning("自动更新服务未启动,数据将无法从 GitHub 自动获取!") 34 | } 35 | 36 | r := routers.InitRouter() 37 | 38 | log.Log().Infof("应用将监听 %s", conf.SystemConfig.Listen) 39 | err := r.Run(conf.SystemConfig.Listen) 40 | if err != nil { 41 | log.Log().Panicf("尝试监听 %s 时发生错误,%s", conf.SystemConfig.Listen, err.Error()) 42 | return 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /middleware/cors.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "github.com/gin-contrib/cors" 5 | "github.com/gin-gonic/gin" 6 | ) 7 | 8 | func Cors() gin.HandlerFunc { 9 | return cors.New(cors.Config{ 10 | AllowOriginFunc: func(origin string) bool { 11 | return true 12 | }, 13 | AllowCredentials: true, 14 | AllowMethods: []string{"GET", "POST", "HEAD", "PATCH"}, 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /model/client.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | ) 6 | 7 | var Client *DataClient 8 | 9 | type DataClient struct { 10 | db *gorm.DB 11 | 12 | Setting SettingService 13 | Text TextService 14 | } 15 | 16 | func NewDataClient(db *gorm.DB, settingService SettingService, textService TextService) *DataClient { 17 | c := &DataClient{ 18 | db: db, 19 | } 20 | 21 | c.Setting = settingService 22 | c.Text = textService 23 | 24 | return c 25 | } 26 | -------------------------------------------------------------------------------- /model/default_settings.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import "github.com/lezi-wiki/lezi-api/pkg/conf" 4 | 5 | var defaultSettings = []Setting{ 6 | {Name: "version", Type: SettingTypeSystem, Val: conf.Version}, 7 | } 8 | -------------------------------------------------------------------------------- /model/init.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "fmt" 5 | "github.com/lezi-wiki/lezi-api/pkg/util" 6 | "time" 7 | 8 | "github.com/gin-gonic/gin" 9 | "github.com/lezi-wiki/lezi-api/pkg/conf" 10 | "github.com/lezi-wiki/lezi-api/pkg/log" 11 | "gorm.io/driver/mysql" 12 | "gorm.io/driver/postgres" 13 | "gorm.io/driver/sqlite" 14 | "gorm.io/driver/sqlserver" 15 | "gorm.io/gorm" 16 | "gorm.io/gorm/logger" 17 | "gorm.io/gorm/schema" 18 | ) 19 | 20 | func newDatabase() (*gorm.DB, error) { 21 | var dialect gorm.Dialector 22 | 23 | if gin.Mode() == gin.TestMode { 24 | dialect = sqlite.Open("file::memory:?cache=shared") 25 | } else { 26 | switch conf.DataSourceConfig.Driver { 27 | case "sqlite3", "sqlite": 28 | dialect = sqlite.Open(util.RelativePath(conf.DataSourceConfig.File)) 29 | case "mysql", "mariadb": 30 | dialect = mysql.Open(fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local", 31 | conf.DataSourceConfig.Username, 32 | conf.DataSourceConfig.Password, 33 | conf.DataSourceConfig.Host, 34 | conf.DataSourceConfig.Port, 35 | conf.DataSourceConfig.Database, 36 | )) 37 | case "postgres", "postgresql": 38 | dialect = postgres.Open(fmt.Sprintf("host=%s port=%d user=%s dbname=%s password=%s sslmode=%s TimeZone=%s", 39 | conf.DataSourceConfig.Host, 40 | conf.DataSourceConfig.Port, 41 | conf.DataSourceConfig.Username, 42 | conf.DataSourceConfig.Database, 43 | conf.DataSourceConfig.Password, 44 | conf.DataSourceConfig.SSLMode, 45 | time.Local.String(), 46 | )) 47 | case "mssql", "sqlserver": 48 | dialect = sqlserver.Open(fmt.Sprintf("sqlserver://%s:%s@%s:%d?database=%s", 49 | conf.DataSourceConfig.Username, 50 | conf.DataSourceConfig.Password, 51 | conf.DataSourceConfig.Host, 52 | conf.DataSourceConfig.Port, 53 | conf.DataSourceConfig.Database, 54 | )) 55 | default: 56 | log.Log().Panicf("不支持的数据库驱动 %s", conf.DataSourceConfig.Driver) 57 | } 58 | } 59 | 60 | logLevel := logger.Silent 61 | 62 | // Debug模式下,输出所有 SQL 日志 63 | if conf.SystemConfig.Debug { 64 | logLevel = logger.Info 65 | } 66 | 67 | database, err := gorm.Open(dialect, &gorm.Config{ 68 | PrepareStmt: true, 69 | Logger: logger.New(new(log.GormLogger), logger.Config{ 70 | SlowThreshold: 200 * time.Millisecond, 71 | LogLevel: logLevel, 72 | IgnoreRecordNotFoundError: false, 73 | Colorful: true, 74 | }), 75 | NamingStrategy: schema.NamingStrategy{ 76 | TablePrefix: conf.DataSourceConfig.Prefix, 77 | SingularTable: true, 78 | }, 79 | }) 80 | 81 | if err != nil { 82 | return nil, err 83 | } 84 | 85 | return database, nil 86 | } 87 | 88 | func initDB() *gorm.DB { 89 | db, err := newDatabase() 90 | 91 | if err != nil { 92 | log.Log().Panicf("数据库连接失败: %s", err) 93 | } 94 | 95 | sqlDB, err := db.DB() 96 | 97 | if err != nil { 98 | log.Log().Panicf("数据库连接失败: %s", err) 99 | } 100 | 101 | sqlDB.SetMaxIdleConns(10) 102 | sqlDB.SetMaxOpenConns(100) 103 | 104 | // 自动迁移 105 | migrate(db) 106 | 107 | return db 108 | } 109 | 110 | func Init() { 111 | Client = initializeClient() 112 | } 113 | -------------------------------------------------------------------------------- /model/migrate.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/lezi-wiki/lezi-api/pkg/conf" 7 | "github.com/lezi-wiki/lezi-api/pkg/log" 8 | "gorm.io/gorm" 9 | ) 10 | 11 | func needMigrate(db *gorm.DB) bool { 12 | var s Setting 13 | err := db.Model(&Setting{}).Where(&Setting{ 14 | Name: "version", 15 | Type: SettingTypeSystem, 16 | }).First(&s).Error 17 | if err != nil { 18 | return true 19 | } 20 | 21 | return s.Val != conf.Version 22 | } 23 | 24 | func migrate(db *gorm.DB) { 25 | if !needMigrate(db) { 26 | log.Log().Info("跳过数据库迁移阶段") 27 | return 28 | } 29 | 30 | log.Log().Info("开始数据库迁移") 31 | 32 | err := db.AutoMigrate(&Setting{}, &Text{}) 33 | if err != nil { 34 | log.Log().Panicf("无法迁移数据库: %s", err) 35 | } 36 | 37 | addDefaultSettings(db) 38 | 39 | log.Log().Info("数据库迁移完成") 40 | } 41 | 42 | func addDefaultSettings(db *gorm.DB) { 43 | for _, value := range defaultSettings { 44 | err := db.Where(&Setting{ 45 | Name: value.Name, 46 | Type: value.Type, 47 | }).First(&Setting{}).Error 48 | if errors.Is(err, gorm.ErrRecordNotFound) { 49 | db.Model(&Setting{}).Create(&value) 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /model/setting.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "encoding/gob" 5 | "gorm.io/gorm" 6 | ) 7 | 8 | type Setting struct { 9 | gorm.Model 10 | Name string `gorm:"not null;uniqueIndex"` 11 | Type SettingType `gorm:"not null;index"` 12 | Val string `gorm:"not null"` 13 | } 14 | 15 | type SettingType string 16 | 17 | const ( 18 | SettingTypeSystem SettingType = "system" 19 | ) 20 | 21 | func init() { 22 | gob.Register(&Setting{}) 23 | } 24 | -------------------------------------------------------------------------------- /model/setting_service.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "github.com/lezi-wiki/lezi-api/pkg/cache" 5 | "gorm.io/gorm" 6 | ) 7 | 8 | type SettingService interface { 9 | Get(name string, settingType SettingType) (string, error) 10 | Set(name string, settingType SettingType, val string) error 11 | Delete(name string, settingType SettingType) error 12 | List() ([]Setting, error) 13 | ListType(settingType SettingType) ([]Setting, error) 14 | } 15 | 16 | type SettingServiceImpl struct { 17 | db *gorm.DB 18 | } 19 | 20 | func NewSettingService(db *gorm.DB) SettingService { 21 | return &SettingServiceImpl{db: db} 22 | } 23 | 24 | func (s *SettingServiceImpl) Get(name string, settingType SettingType) (string, error) { 25 | var setting Setting 26 | 27 | if value, ok := cache.Get("setting_" + name); ok { 28 | return value.(string), nil 29 | } 30 | 31 | err := s.db.Model(&Setting{}).Where(&Setting{ 32 | Name: name, 33 | Type: settingType, 34 | }).First(&setting).Error 35 | return setting.Val, err 36 | } 37 | 38 | func (s *SettingServiceImpl) Set(name string, settingType SettingType, val string) error { 39 | err := s.db.Model(&Setting{}).Where(&Setting{ 40 | Name: name, 41 | Type: settingType, 42 | }).Updates(&Setting{ 43 | Val: val, 44 | }).Error 45 | if err != nil { 46 | return err 47 | } 48 | 49 | cache.Set("setting_"+name, val, 0) 50 | return nil 51 | } 52 | 53 | func (s *SettingServiceImpl) Delete(name string, settingType SettingType) error { 54 | err := s.db.Model(&Setting{}).Where(&Setting{ 55 | Name: name, 56 | Type: settingType, 57 | }).Delete(&Setting{}).Error 58 | if err != nil { 59 | return err 60 | } 61 | 62 | cache.Deletes([]string{name}, "setting_") 63 | return nil 64 | } 65 | 66 | func (s *SettingServiceImpl) List() ([]Setting, error) { 67 | var settings []Setting 68 | err := s.db.Model(&Setting{}).Find(&settings).Error 69 | return settings, err 70 | } 71 | 72 | func (s *SettingServiceImpl) ListType(settingType SettingType) ([]Setting, error) { 73 | var settings []Setting 74 | err := s.db.Model(&Setting{}).Where("type = ?", settingType).Find(&settings).Error 75 | return settings, err 76 | } 77 | -------------------------------------------------------------------------------- /model/text.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "encoding/gob" 5 | "gorm.io/gorm" 6 | ) 7 | 8 | type Text struct { 9 | gorm.Model 10 | Namespace string `gorm:"not null;index"` 11 | Speaker string `gorm:"not null;index"` 12 | Text string `gorm:"not null;size:512"` 13 | Context *string `gorm:"size:512"` 14 | } 15 | 16 | func init() { 17 | gob.Register(&Text{}) 18 | } 19 | -------------------------------------------------------------------------------- /model/text_service.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "github.com/lezi-wiki/lezi-api/pkg/util" 5 | "gorm.io/gorm" 6 | ) 7 | 8 | type TextService interface { 9 | Get(text Text) (*Text, error) 10 | List(text Text) ([]Text, error) 11 | GetTextByNamespace(namespace string) ([]Text, error) 12 | GetTextBySpeaker(speaker string) ([]Text, error) 13 | ListAll() ([]Text, error) 14 | CreateText(text Text) (*Text, error) 15 | UpdateText(text Text) (*Text, error) 16 | DeleteText(id uint) error 17 | Count() int64 18 | RandomRecord(rule Text) (*Text, error) 19 | Exists(text Text) bool 20 | } 21 | 22 | type TextServiceImpl struct { 23 | db *gorm.DB 24 | } 25 | 26 | func NewTextService(db *gorm.DB) TextService { 27 | return &TextServiceImpl{db: db} 28 | } 29 | 30 | func (t TextServiceImpl) Get(text Text) (*Text, error) { 31 | err := t.db.Model(&Text{}).Where(&text).First(&text).Error 32 | if err != nil { 33 | return nil, err 34 | } 35 | 36 | return &text, nil 37 | } 38 | 39 | func (t TextServiceImpl) List(text Text) ([]Text, error) { 40 | var data []Text 41 | err := t.db.Model(&Text{}).Where(&text).Find(&data).Error 42 | if err != nil { 43 | return nil, err 44 | } 45 | 46 | return data, nil 47 | } 48 | 49 | func (t TextServiceImpl) GetTextByNamespace(namespace string) ([]Text, error) { 50 | var data []Text 51 | err := t.db.Model(&Text{}).Where("namespace = ?", namespace).Find(&data).Error 52 | if err != nil { 53 | return nil, err 54 | } 55 | 56 | return data, nil 57 | } 58 | 59 | func (t TextServiceImpl) GetTextBySpeaker(speaker string) ([]Text, error) { 60 | var data []Text 61 | err := t.db.Model(&Text{}).Where("speaker = ?", speaker).Find(&data).Error 62 | if err != nil { 63 | return nil, err 64 | } 65 | 66 | return data, nil 67 | } 68 | 69 | func (t TextServiceImpl) ListAll() ([]Text, error) { 70 | var data []Text 71 | err := t.db.Model(&Text{}).Find(&data).Error 72 | if err != nil { 73 | return nil, err 74 | } 75 | 76 | return data, nil 77 | } 78 | 79 | func (t TextServiceImpl) CreateText(text Text) (*Text, error) { 80 | err := t.db.Model(&Text{}).Create(&text).Error 81 | if err != nil { 82 | return nil, err 83 | } 84 | 85 | return &text, nil 86 | } 87 | 88 | func (t TextServiceImpl) UpdateText(text Text) (*Text, error) { 89 | err := t.db.Model(&Text{}).Where("id = ?", text.ID).Updates(&text).Error 90 | if err != nil { 91 | return nil, err 92 | } 93 | 94 | return &text, nil 95 | } 96 | 97 | func (t TextServiceImpl) DeleteText(id uint) error { 98 | return t.db.Model(&Text{}).Where("id = ?", id).Delete(&Text{}).Error 99 | } 100 | 101 | func (t TextServiceImpl) Count() int64 { 102 | var count int64 103 | err := t.db.Model(&Text{}).Count(&count).Error 104 | if err != nil { 105 | return 0 106 | } 107 | 108 | return count 109 | } 110 | 111 | func (t TextServiceImpl) RandomRecord(rule Text) (*Text, error) { 112 | var count int64 113 | if err := t.db.Model(&Text{}).Where(&rule).Count(&count).Error; err != nil { 114 | return nil, err 115 | } 116 | 117 | var text Text 118 | if err := t.db.Model(&Text{}).Where(&rule).Offset(util.RandomInt(0, int(count-1))).First(&text).Error; err != nil { 119 | return nil, err 120 | } 121 | 122 | return &text, nil 123 | } 124 | 125 | func (t TextServiceImpl) Exists(text Text) bool { 126 | var count int64 127 | err := t.db.Model(&Text{}).Where(&text).Count(&count).Error 128 | if err != nil { 129 | return false 130 | } 131 | 132 | return count > 0 133 | } 134 | -------------------------------------------------------------------------------- /model/wire.go: -------------------------------------------------------------------------------- 1 | //go:build wireinject 2 | // +build wireinject 3 | 4 | package model 5 | 6 | import ( 7 | "github.com/google/wire" 8 | ) 9 | 10 | func initializeClient() *DataClient { 11 | wire.Build(initDB, NewDataClient, NewSettingService, NewTextService) 12 | return &DataClient{} 13 | } 14 | -------------------------------------------------------------------------------- /model/wire_gen.go: -------------------------------------------------------------------------------- 1 | // Code generated by Wire. DO NOT EDIT. 2 | 3 | //go:generate go run github.com/google/wire/cmd/wire 4 | //go:build !wireinject 5 | // +build !wireinject 6 | 7 | package model 8 | 9 | // Injectors from wire.go: 10 | 11 | func initializeClient() *DataClient { 12 | db := initDB() 13 | settingService := NewSettingService(db) 14 | textService := NewTextService(db) 15 | dataClient := NewDataClient(db, settingService, textService) 16 | return dataClient 17 | } 18 | -------------------------------------------------------------------------------- /pkg/cache/driver.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "github.com/lezi-wiki/lezi-api/pkg/conf" 6 | "github.com/lezi-wiki/lezi-api/pkg/log" 7 | "github.com/samber/lo" 8 | "strings" 9 | ) 10 | 11 | // store 缓存存储器 12 | var store Driver 13 | 14 | // Init 初始化缓存 15 | func Init() { 16 | if conf.RedisConfig.Server != "" && gin.Mode() != gin.TestMode { 17 | log.Log().Infof("Redis has been enabled, server: %s", conf.RedisConfig.Server) 18 | 19 | store = NewRedisStore( 20 | 10, 21 | conf.RedisConfig.Network, 22 | conf.RedisConfig.Server, 23 | conf.RedisConfig.Password, 24 | conf.RedisConfig.DB, 25 | ) 26 | } else { 27 | store = NewMemoStore() 28 | } 29 | } 30 | 31 | // Driver 键值缓存存储容器 32 | type Driver interface { 33 | // Set 设置值,ttl为过期时间,单位为秒 34 | Set(key string, value interface{}, ttl int) error 35 | 36 | // Get 取值,并返回是否成功 37 | Get(key string) (interface{}, bool) 38 | 39 | // Gets 批量取值,返回成功取值的map即不存在的值 40 | Gets(keys []string, prefix string) (map[string]interface{}, []string) 41 | 42 | // Sets 批量设置值,所有的key都会加上prefix前缀 43 | Sets(values map[string]interface{}, prefix string) error 44 | 45 | // Delete 删除值 46 | Delete(key string) error 47 | 48 | // Deletes 批量删除值,所有的key都会加上prefix前缀 49 | Deletes(keys []string, prefix string) error 50 | } 51 | 52 | // Set 设置缓存值 53 | func Set(key string, value interface{}, ttl int) error { 54 | log.Log().Debugf("设置缓存:%s=%v,TTL:%d", key, value, ttl) 55 | return store.Set(key, value, ttl) 56 | } 57 | 58 | // Get 获取缓存值 59 | func Get(key string) (interface{}, bool) { 60 | log.Log().Debugf("获取缓存:%s", key) 61 | return store.Get(key) 62 | } 63 | 64 | // Delete 删除缓存值 65 | func Delete(key string) error { 66 | log.Log().Debugf("删除缓存:%s", key) 67 | return store.Delete(key) 68 | } 69 | 70 | // Deletes 删除值 71 | func Deletes(keys []string, prefix string) error { 72 | go log.Log().Debugf("删除缓存:%s", strings.Join(lo.Map(keys, func(key string, i int) string { 73 | return prefix + key 74 | }), ",")) 75 | return store.Deletes(keys, prefix) 76 | } 77 | 78 | // GetSettings 根据名称批量获取设置项缓存 79 | func GetSettings(keys []string, prefix string) (map[string]string, []string) { 80 | raw, miss := store.Gets(keys, prefix) 81 | 82 | res := make(map[string]string, len(raw)) 83 | for k, v := range raw { 84 | res[k] = v.(string) 85 | } 86 | 87 | return res, miss 88 | } 89 | 90 | // SetSettings 批量设置站点设置缓存 91 | func SetSettings(values map[string]string, prefix string) error { 92 | var toBeSet = make(map[string]interface{}, len(values)) 93 | for key, value := range values { 94 | toBeSet[key] = interface{}(value) 95 | } 96 | return store.Sets(toBeSet, prefix) 97 | } 98 | -------------------------------------------------------------------------------- /pkg/cache/driver_test.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestSet(t *testing.T) { 10 | asserts := assert.New(t) 11 | 12 | asserts.NoError(Set("123", "321", -1)) 13 | } 14 | 15 | func TestGet(t *testing.T) { 16 | asserts := assert.New(t) 17 | asserts.NoError(Set("123", "321", -1)) 18 | 19 | value, ok := Get("123") 20 | asserts.True(ok) 21 | asserts.Equal("321", value) 22 | 23 | value, ok = Get("not_exist") 24 | asserts.False(ok) 25 | } 26 | 27 | func TestDeletes(t *testing.T) { 28 | asserts := assert.New(t) 29 | asserts.NoError(Set("123", "321", -1)) 30 | err := Deletes([]string{"123"}, "") 31 | asserts.NoError(err) 32 | _, exist := Get("123") 33 | asserts.False(exist) 34 | } 35 | 36 | func TestGetSettings(t *testing.T) { 37 | asserts := assert.New(t) 38 | asserts.NoError(Set("test_1", "1", -1)) 39 | 40 | values, missed := GetSettings([]string{"1", "2"}, "test_") 41 | asserts.Equal(map[string]string{"1": "1"}, values) 42 | asserts.Equal([]string{"2"}, missed) 43 | } 44 | 45 | func TestSetSettings(t *testing.T) { 46 | asserts := assert.New(t) 47 | 48 | err := SetSettings(map[string]string{"3": "3", "4": "4"}, "test_") 49 | asserts.NoError(err) 50 | value1, _ := Get("test_3") 51 | value2, _ := Get("test_4") 52 | asserts.Equal("3", value1) 53 | asserts.Equal("4", value2) 54 | } 55 | 56 | func TestInit(t *testing.T) { 57 | asserts := assert.New(t) 58 | 59 | asserts.NotPanics(func() { 60 | Init() 61 | }) 62 | } 63 | -------------------------------------------------------------------------------- /pkg/cache/memory.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | import ( 4 | "github.com/lezi-wiki/lezi-api/pkg/log" 5 | "sync" 6 | "time" 7 | ) 8 | 9 | // MemoryStore 内存存储驱动 10 | type MemoryStore struct { 11 | Store *sync.Map 12 | } 13 | 14 | // item 存储的对象 15 | type item struct { 16 | expires int64 17 | value interface{} 18 | } 19 | 20 | // newItem 生成对象 21 | func newItem(value interface{}, expires int) item { 22 | expires64 := int64(expires) 23 | if expires > 0 { 24 | expires64 = time.Now().Unix() + expires64 25 | } 26 | 27 | return item{ 28 | value: value, 29 | expires: expires64, 30 | } 31 | } 32 | 33 | // getValue 从itemWithTTL中取值 34 | func getValue(itemKey interface{}, ok bool) (interface{}, bool) { 35 | if !ok { 36 | return nil, ok 37 | } 38 | 39 | var itemObj item 40 | if itemObj, ok = itemKey.(item); !ok { 41 | return itemKey, true 42 | } 43 | 44 | if itemObj.expires > 0 && itemObj.expires < time.Now().Unix() { 45 | return nil, false 46 | } 47 | 48 | return itemObj.value, ok 49 | 50 | } 51 | 52 | // GarbageCollect 回收已过期的缓存 53 | func (store *MemoryStore) GarbageCollect() { 54 | store.Store.Range(func(key, value interface{}) bool { 55 | if item, ok := value.(item); ok { 56 | if item.expires > 0 && item.expires < time.Now().Unix() { 57 | log.Log().Debugf("回收垃圾[%s]", key.(string)) 58 | store.Store.Delete(key) 59 | } 60 | } 61 | return true 62 | }) 63 | } 64 | 65 | // NewMemoStore 新建内存存储 66 | func NewMemoStore() *MemoryStore { 67 | return &MemoryStore{ 68 | Store: &sync.Map{}, 69 | } 70 | } 71 | 72 | // Set 存储值 73 | func (store *MemoryStore) Set(key string, value interface{}, ttl int) error { 74 | store.Store.Store(key, newItem(value, ttl)) 75 | return nil 76 | } 77 | 78 | // Get 取值 79 | func (store *MemoryStore) Get(key string) (interface{}, bool) { 80 | return getValue(store.Store.Load(key)) 81 | } 82 | 83 | // Gets 批量取值 84 | func (store *MemoryStore) Gets(keys []string, prefix string) (map[string]interface{}, []string) { 85 | var res = make(map[string]interface{}) 86 | var notFound = make([]string, 0, len(keys)) 87 | 88 | for _, key := range keys { 89 | if value, ok := getValue(store.Store.Load(prefix + key)); ok { 90 | res[key] = value 91 | } else { 92 | notFound = append(notFound, key) 93 | } 94 | } 95 | 96 | return res, notFound 97 | } 98 | 99 | // Sets 批量设置值 100 | func (store *MemoryStore) Sets(values map[string]interface{}, prefix string) error { 101 | for key, value := range values { 102 | store.Store.Store(prefix+key, value) 103 | } 104 | return nil 105 | } 106 | 107 | // Delete 删除值 108 | func (store *MemoryStore) Delete(key string) error { 109 | store.Store.Delete(key) 110 | return nil 111 | } 112 | 113 | // Deletes 批量删除值 114 | func (store *MemoryStore) Deletes(keys []string, prefix string) error { 115 | for _, key := range keys { 116 | store.Store.Delete(prefix + key) 117 | } 118 | return nil 119 | } 120 | -------------------------------------------------------------------------------- /pkg/cache/memory_test.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func TestNewMemoStore(t *testing.T) { 11 | asserts := assert.New(t) 12 | 13 | store := NewMemoStore() 14 | asserts.NotNil(store) 15 | asserts.NotNil(store.Store) 16 | } 17 | 18 | func TestMemoStore_Set(t *testing.T) { 19 | asserts := assert.New(t) 20 | 21 | store := NewMemoStore() 22 | err := store.Set("KEY", "vAL", -1) 23 | asserts.NoError(err) 24 | 25 | val, ok := store.Store.Load("KEY") 26 | asserts.True(ok) 27 | asserts.Equal("vAL", val.(item).value) 28 | } 29 | 30 | func TestMemoStore_Get(t *testing.T) { 31 | asserts := assert.New(t) 32 | store := NewMemoStore() 33 | 34 | // 正常情况 35 | { 36 | _ = store.Set("string", "string_val", -1) 37 | val, ok := store.Get("string") 38 | asserts.Equal("string_val", val) 39 | asserts.True(ok) 40 | } 41 | 42 | // Key不存在 43 | { 44 | val, ok := store.Get("something") 45 | asserts.Equal(nil, val) 46 | asserts.False(ok) 47 | } 48 | 49 | // 存储struct 50 | { 51 | type testStruct struct { 52 | key int 53 | } 54 | test := testStruct{key: 233} 55 | _ = store.Set("struct", test, -1) 56 | val, ok := store.Get("struct") 57 | asserts.True(ok) 58 | res, ok := val.(testStruct) 59 | asserts.True(ok) 60 | asserts.Equal(test, res) 61 | } 62 | 63 | // 过期 64 | { 65 | _ = store.Set("string", "string_val", 1) 66 | time.Sleep(time.Duration(2) * time.Second) 67 | val, ok := store.Get("string") 68 | asserts.Nil(val) 69 | asserts.False(ok) 70 | } 71 | 72 | } 73 | 74 | func TestMemoStore_Gets(t *testing.T) { 75 | asserts := assert.New(t) 76 | store := NewMemoStore() 77 | 78 | err := store.Set("1", "1,val", -1) 79 | err = store.Set("2", "2,val", -1) 80 | err = store.Set("3", "3,val", -1) 81 | err = store.Set("4", "4,val", -1) 82 | asserts.NoError(err) 83 | 84 | // 全部命中 85 | { 86 | values, miss := store.Gets([]string{"1", "2", "3", "4"}, "") 87 | asserts.Len(values, 4) 88 | asserts.Len(miss, 0) 89 | } 90 | 91 | // 命中一半 92 | { 93 | values, miss := store.Gets([]string{"1", "2", "9", "10"}, "") 94 | asserts.Len(values, 2) 95 | asserts.Equal([]string{"9", "10"}, miss) 96 | } 97 | } 98 | 99 | func TestMemoStore_Sets(t *testing.T) { 100 | asserts := assert.New(t) 101 | store := NewMemoStore() 102 | 103 | err := store.Sets(map[string]interface{}{ 104 | "1": "1.val", 105 | "2": "2.val", 106 | "3": "3.val", 107 | "4": "4.val", 108 | }, "test_") 109 | asserts.NoError(err) 110 | 111 | vals, miss := store.Gets([]string{"1", "2", "3", "4"}, "test_") 112 | asserts.Len(miss, 0) 113 | asserts.Equal(map[string]interface{}{ 114 | "1": "1.val", 115 | "2": "2.val", 116 | "3": "3.val", 117 | "4": "4.val", 118 | }, vals) 119 | } 120 | 121 | func TestMemoStore_Delete(t *testing.T) { 122 | asserts := assert.New(t) 123 | store := NewMemoStore() 124 | 125 | err := store.Sets(map[string]interface{}{ 126 | "1": "1.val", 127 | "2": "2.val", 128 | "3": "3.val", 129 | "4": "4.val", 130 | }, "test_") 131 | asserts.NoError(err) 132 | 133 | err = store.Deletes([]string{"1", "2"}, "test_") 134 | asserts.NoError(err) 135 | values, miss := store.Gets([]string{"1", "2", "3", "4"}, "test_") 136 | asserts.Equal([]string{"1", "2"}, miss) 137 | asserts.Equal(map[string]interface{}{"3": "3.val", "4": "4.val"}, values) 138 | } 139 | 140 | func TestMemoStore_GarbageCollect(t *testing.T) { 141 | asserts := assert.New(t) 142 | store := NewMemoStore() 143 | asserts.NoError(store.Set("test", 1, 1)) 144 | time.Sleep(time.Duration(2000) * time.Millisecond) 145 | store.GarbageCollect() 146 | _, ok := store.Get("test") 147 | asserts.False(ok) 148 | } 149 | -------------------------------------------------------------------------------- /pkg/cache/redis.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "encoding/gob" 7 | "github.com/go-redis/redis/v8" 8 | "github.com/lezi-wiki/lezi-api/pkg/log" 9 | "github.com/samber/lo" 10 | "net" 11 | "time" 12 | ) 13 | 14 | // RedisStore redis存储驱动 15 | type RedisStore struct { 16 | client *redis.Client 17 | ctx context.Context 18 | } 19 | 20 | type redisItem struct { 21 | Value interface{} 22 | } 23 | 24 | func serializer(value interface{}) ([]byte, error) { 25 | var buffer bytes.Buffer 26 | enc := gob.NewEncoder(&buffer) 27 | storeValue := redisItem{ 28 | Value: value, 29 | } 30 | err := enc.Encode(storeValue) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return buffer.Bytes(), nil 35 | } 36 | 37 | func deserializer(value []byte) (interface{}, error) { 38 | var res redisItem 39 | buffer := bytes.NewReader(value) 40 | dec := gob.NewDecoder(buffer) 41 | err := dec.Decode(&res) 42 | if err != nil { 43 | return nil, err 44 | } 45 | return res.Value, nil 46 | } 47 | 48 | // NewRedisStore 创建新的redis存储 49 | func NewRedisStore(size int, network, address, password string, database int) *RedisStore { 50 | return &RedisStore{ 51 | client: redis.NewClient(&redis.Options{ 52 | Network: network, 53 | Addr: address, 54 | Password: password, 55 | DB: database, 56 | Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { 57 | c, err := net.Dial(network, addr) 58 | if err != nil { 59 | log.Log().Warnf("无法创建 Redis 连接,%s", err) 60 | return nil, err 61 | } 62 | 63 | return c, nil 64 | }, 65 | IdleTimeout: time.Second * 240, 66 | MinIdleConns: size, 67 | MaxRetries: 3, 68 | }), 69 | ctx: context.Background(), 70 | } 71 | } 72 | 73 | // Set 存储值 74 | func (store *RedisStore) Set(key string, value interface{}, ttl int) error { 75 | rc := store.client.Conn(store.ctx) 76 | defer func(rc *redis.Conn) { 77 | err := rc.Close() 78 | if err != nil { 79 | log.Log().Errorf("Redis 关闭连接错误,%s", err) 80 | } 81 | }(rc) 82 | 83 | serialized, err := serializer(value) 84 | if err != nil { 85 | return err 86 | } 87 | 88 | if ttl > 0 { 89 | err = rc.SetEX(store.ctx, key, serialized, time.Second*time.Duration(ttl)).Err() 90 | } else { 91 | err = rc.Set(store.ctx, key, serialized, 0).Err() 92 | } 93 | 94 | if err != nil { 95 | return err 96 | } 97 | return nil 98 | 99 | } 100 | 101 | // Get 取值 102 | func (store *RedisStore) Get(key string) (interface{}, bool) { 103 | rc := store.client.Conn(store.ctx) 104 | defer func(rc *redis.Conn) { 105 | err := rc.Close() 106 | if err != nil { 107 | log.Log().Errorf("Redis 关闭连接错误,%s", err) 108 | } 109 | }(rc) 110 | 111 | v, err := rc.Get(store.ctx, key).Bytes() 112 | if err != nil || v == nil { 113 | return nil, false 114 | } 115 | 116 | finalValue, err := deserializer(v) 117 | if err != nil { 118 | return nil, false 119 | } 120 | 121 | return finalValue, true 122 | 123 | } 124 | 125 | // Gets 批量取值 126 | func (store *RedisStore) Gets(keys []string, prefix string) (map[string]interface{}, []string) { 127 | rc := store.client.Conn(store.ctx) 128 | defer func(rc *redis.Conn) { 129 | err := rc.Close() 130 | if err != nil { 131 | log.Log().Errorf("Redis 关闭连接错误,%s", err) 132 | } 133 | }(rc) 134 | 135 | v, err := rc.MGet(store.ctx, lo.Map(keys, func(key string, index int) string { 136 | return prefix + key 137 | })...).Result() 138 | if err != nil { 139 | return nil, keys 140 | } 141 | 142 | res := make(map[string]interface{}) 143 | missed := make([]string, 0, len(keys)) 144 | 145 | for key, value := range v { 146 | decoded, err := deserializer([]byte(value.(string))) 147 | if err != nil || decoded == nil { 148 | missed = append(missed, keys[key]) 149 | } else { 150 | res[keys[key]] = decoded 151 | } 152 | } 153 | return res, missed 154 | } 155 | 156 | // Sets 批量设置值 157 | func (store *RedisStore) Sets(values map[string]interface{}, prefix string) error { 158 | rc := store.client.Conn(store.ctx) 159 | defer func(rc *redis.Conn) { 160 | err := rc.Close() 161 | if err != nil { 162 | log.Log().Errorf("Redis 关闭连接错误,%s", err) 163 | } 164 | }(rc) 165 | var setValues = make(map[string]interface{}) 166 | 167 | // 编码待设置值 168 | for key, value := range values { 169 | serialized, err := serializer(value) 170 | if err != nil { 171 | return err 172 | } 173 | setValues[prefix+key] = serialized 174 | } 175 | 176 | _, err := rc.MSet(store.ctx, setValues).Result() 177 | if err != nil { 178 | return err 179 | } 180 | return nil 181 | 182 | } 183 | 184 | // Delete 删除给定的键 185 | func (store *RedisStore) Delete(key string) error { 186 | rc := store.client.Conn(store.ctx) 187 | defer func(rc *redis.Conn) { 188 | err := rc.Close() 189 | if err != nil { 190 | log.Log().Errorf("Redis 关闭连接错误,%s", err) 191 | } 192 | }(rc) 193 | 194 | _, err := rc.Del(store.ctx, key).Result() 195 | if err != nil { 196 | return err 197 | } 198 | return nil 199 | } 200 | 201 | // Deletes 批量删除给定的键 202 | func (store *RedisStore) Deletes(keys []string, prefix string) error { 203 | rc := store.client.Conn(store.ctx) 204 | defer func(rc *redis.Conn) { 205 | err := rc.Close() 206 | if err != nil { 207 | log.Log().Errorf("Redis 关闭连接错误,%s", err) 208 | } 209 | }(rc) 210 | 211 | // 处理前缀 212 | keys = lo.Map[string, string](keys, func(key string, index int) string { 213 | return prefix + key 214 | }) 215 | 216 | _, err := rc.Del(store.ctx, keys...).Result() 217 | if err != nil { 218 | return err 219 | } 220 | return nil 221 | } 222 | 223 | // DeleteAll 批量所有键 224 | func (store *RedisStore) DeleteAll() error { 225 | rc := store.client.Conn(store.ctx) 226 | defer func(rc *redis.Conn) { 227 | err := rc.Close() 228 | if err != nil { 229 | log.Log().Errorf("Redis 关闭连接错误,%s", err) 230 | } 231 | }(rc) 232 | 233 | _, err := rc.FlushDB(store.ctx).Result() 234 | 235 | return err 236 | } 237 | -------------------------------------------------------------------------------- /pkg/conf/conf.go: -------------------------------------------------------------------------------- 1 | package conf 2 | 3 | const defaultConf = `[System] 4 | Listen = :8080 5 | Debug = false 6 | ` 7 | 8 | const Version = "1.1.3" 9 | 10 | type system struct { 11 | Listen string `validate:"required"` 12 | Debug bool 13 | HashIDSalt string 14 | } 15 | 16 | type datasource struct { 17 | Driver string `validate:"required"` 18 | Host string 19 | Port int 20 | Database string 21 | Username string 22 | Password string 23 | File string 24 | Prefix string 25 | SSLMode string 26 | } 27 | 28 | type redis struct { 29 | Network string 30 | Server string 31 | Password string 32 | DB int 33 | } 34 | -------------------------------------------------------------------------------- /pkg/conf/data.go: -------------------------------------------------------------------------------- 1 | package conf 2 | 3 | import ( 4 | "github.com/lezi-wiki/lezi-api/pkg/util" 5 | ) 6 | 7 | var SystemConfig = &system{ 8 | Listen: util.EnvStr("LISTEN", ":8080"), 9 | Debug: util.EnvStr("DEBUG", "false") == "true", 10 | HashIDSalt: util.EnvStr("HASHID_SALT", ""), 11 | } 12 | 13 | var DataSourceConfig = &datasource{ 14 | Driver: util.EnvStr("DB_DRIVER", "sqlite3"), 15 | Host: util.EnvStr("DB_HOST", "localhost"), 16 | Port: util.EnvNum("DB_PORT", 3306), 17 | Database: util.EnvStr("DB_DATABASE", "leziapi"), 18 | Username: util.EnvStr("DB_USERNAME", "root"), 19 | Password: util.EnvStr("DB_PASSWORD", "root"), 20 | File: util.EnvStr("DB_FILE", "leziapi.db"), 21 | Prefix: util.EnvStr("DB_PREFIX", "lezi_"), 22 | SSLMode: util.EnvStr("DB_SSL", "disable"), 23 | } 24 | 25 | var RedisConfig = &redis{ 26 | Network: util.EnvStr("REDIS_NETWORK", "tcp"), 27 | Server: util.EnvStr("REDIS_SERVER", ""), 28 | Password: util.EnvStr("REDIS_PASSWORD", ""), 29 | DB: util.EnvNum("REDIS_DB", 0), 30 | } 31 | -------------------------------------------------------------------------------- /pkg/conf/init.go: -------------------------------------------------------------------------------- 1 | package conf 2 | 3 | import ( 4 | "github.com/go-ini/ini" 5 | "github.com/go-playground/validator/v10" 6 | "github.com/lezi-wiki/lezi-api/pkg/log" 7 | "github.com/lezi-wiki/lezi-api/pkg/util" 8 | "github.com/sirupsen/logrus" 9 | ) 10 | 11 | var cfg *ini.File 12 | 13 | // Init 初始化配置文件 14 | func Init(path string) { 15 | var err error 16 | 17 | if path == "" || !util.Exists(path) { 18 | // 创建初始配置文件 19 | confContent := defaultConf 20 | f, err := util.CreatNestedFile(path) 21 | if err != nil { 22 | log.Log().Panicf("无法创建配置文件, %s", err) 23 | } 24 | 25 | // 写入配置文件 26 | _, err = f.WriteString(confContent) 27 | if err != nil { 28 | log.Log().Panicf("无法写入配置文件, %s", err) 29 | } 30 | 31 | f.Close() 32 | log.Log().Infof("配置文件初始化完成,文件位于 %s", path) 33 | } 34 | 35 | log.Log().Infof("将从 %s 解析配置文件", path) 36 | cfg, err = ini.Load(path) 37 | if err != nil { 38 | log.Log().Panicf("无法解析配置文件 '%s': %s", path, err) 39 | } 40 | 41 | sections := map[string]interface{}{ 42 | "System": SystemConfig, 43 | "DataSource": DataSourceConfig, 44 | } 45 | for sectionName, sectionStruct := range sections { 46 | err = mapSection(sectionName, sectionStruct) 47 | if err != nil { 48 | log.Log().Panicf("配置文件 %s 分区解析失败: %s", sectionName, err) 49 | } 50 | } 51 | 52 | // 重设log等级 53 | if SystemConfig.Debug { 54 | log.GlobalLogger = nil 55 | log.Log().SetLevel(logrus.DebugLevel) 56 | } 57 | } 58 | 59 | // mapSection 将配置文件的 Section 映射到结构体上 60 | func mapSection(section string, confStruct interface{}) error { 61 | err := cfg.Section(section).MapTo(confStruct) 62 | if err != nil { 63 | return err 64 | } 65 | 66 | // 验证合法性 67 | validate := validator.New() 68 | err = validate.Struct(confStruct) 69 | if err != nil { 70 | return err 71 | } 72 | 73 | return nil 74 | } 75 | -------------------------------------------------------------------------------- /pkg/cron/init.go: -------------------------------------------------------------------------------- 1 | package cron 2 | 3 | import ( 4 | "github.com/lezi-wiki/lezi-api/pkg/cron/jobs" 5 | "github.com/lezi-wiki/lezi-api/pkg/log" 6 | "github.com/robfig/cron/v3" 7 | ) 8 | 9 | var task *cron.Cron 10 | 11 | func init() { 12 | task = cron.New() 13 | task.Start() 14 | } 15 | 16 | func InitJobs() { 17 | // 每30分钟获取远端数据 18 | _, err := task.AddFunc("@hourly", jobs.UpdateData) 19 | if err != nil { 20 | log.Log().Errorf("Cron jobs 错误, %s", err.Error()) 21 | log.Log().Warning("自动更新服务未启动,数据将无法从 GitHub 自动获取!") 22 | return 23 | } else { 24 | log.Log().Infof("自动更新服务已启动,数据将从 GitHub 自动获取!") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /pkg/cron/jobs/data_jobs.go: -------------------------------------------------------------------------------- 1 | package jobs 2 | 3 | import ( 4 | "github.com/lezi-wiki/lezi-api/model" 5 | "github.com/lezi-wiki/lezi-api/pkg/log" 6 | "github.com/lezi-wiki/lezi-api/pkg/serializer/dto" 7 | "github.com/lezi-wiki/lezi-api/services/remote" 8 | "github.com/samber/lo" 9 | ) 10 | 11 | func UpdateData() { 12 | log.Log().Infof("准备从 GitHub 更新数据集") 13 | data, err := remote.GetDataFromGitHub() 14 | if err != nil { 15 | log.Log().Errorf("更新数据集失败") 16 | return 17 | } 18 | 19 | models := lo.Map(data, func(item dto.TextJsonDTO, i int) model.Text { 20 | return dto.BuildTextJsonDTO(item) 21 | }) 22 | 23 | for _, datum := range models { 24 | if exist := model.Client.Text.Exists(datum); exist { 25 | continue 26 | } 27 | 28 | if _, err := model.Client.Text.CreateText(datum); err != nil { 29 | log.Log().Errorf("对于命名空间 %s 同步发言人 %s 的数据 %s 失败", datum.Namespace, datum.Speaker, datum.Text) 30 | continue 31 | } 32 | } 33 | 34 | log.Log().Infof("数据集更新完成,远端获取数据 %d 条,当前数据 %d 条", len(data), model.Client.Text.Count()) 35 | } 36 | -------------------------------------------------------------------------------- /pkg/hashids/hashids.go: -------------------------------------------------------------------------------- 1 | package hashids 2 | 3 | import ( 4 | "errors" 5 | "github.com/lezi-wiki/lezi-api/pkg/conf" 6 | "github.com/lezi-wiki/lezi-api/pkg/log" 7 | "github.com/speps/go-hashids/v2" 8 | ) 9 | 10 | var ( 11 | ErrHashIDType = errors.New("hashid 类型错误") 12 | ) 13 | 14 | type HashIDType int 15 | 16 | const ( 17 | TypeUser HashIDType = iota 18 | TypeText 19 | TypeNamespace 20 | TypeSpeaker 21 | ) 22 | 23 | var data *hashids.HashIDData 24 | 25 | func Init() { 26 | data = &hashids.HashIDData{ 27 | MinLength: 4, 28 | Salt: conf.SystemConfig.HashIDSalt, 29 | Alphabet: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", 30 | } 31 | } 32 | 33 | // HashEncode 对给定数据计算HashID 34 | func HashEncode(v []int) (string, error) { 35 | hd := hashids.NewData() 36 | hd.Salt = conf.SystemConfig.HashIDSalt 37 | 38 | h, err := hashids.NewWithData(hd) 39 | if err != nil { 40 | return "", err 41 | } 42 | 43 | id, err := h.Encode(v) 44 | if err != nil { 45 | return "", err 46 | } 47 | return id, nil 48 | } 49 | 50 | // HashDecode 对给定数据计算原始数据 51 | func HashDecode(raw string) ([]int, error) { 52 | hd := hashids.NewData() 53 | hd.Salt = conf.SystemConfig.HashIDSalt 54 | 55 | h, err := hashids.NewWithData(hd) 56 | if err != nil { 57 | return []int{}, err 58 | } 59 | 60 | return h.DecodeWithError(raw) 61 | 62 | } 63 | 64 | // HashIDEncode 编码 HashID 65 | func HashIDEncode(id uint, t HashIDType) string { 66 | str, err := HashEncode([]int{int(id), int(t)}) 67 | if err != nil { 68 | log.Log().Errorf("HashIDEncode error, %s", err) 69 | } 70 | 71 | return str 72 | } 73 | 74 | // HashIDDecode 解码 HashID 75 | func HashIDDecode(s string, t HashIDType) (uint, error) { 76 | r, _ := HashDecode(s) 77 | if len(r) != 2 || r[1] != int(t) { 78 | return 0, ErrHashIDType 79 | } 80 | 81 | return uint(r[0]), nil 82 | } 83 | -------------------------------------------------------------------------------- /pkg/hashids/hashids_test.go: -------------------------------------------------------------------------------- 1 | package hashids 2 | 3 | import ( 4 | "github.com/lezi-wiki/lezi-api/pkg/conf" 5 | "github.com/stretchr/testify/assert" 6 | "testing" 7 | ) 8 | 9 | func TestInit(t *testing.T) { 10 | asserts := assert.New(t) 11 | 12 | conf.SystemConfig.HashIDSalt = "test" 13 | Init() 14 | asserts.Equal(4, data.MinLength) 15 | asserts.Equal("test", data.Salt) 16 | 17 | encode, err := HashEncode([]int{1, 2}) 18 | asserts.NoError(err) 19 | asserts.NotEmpty(encode) 20 | } 21 | 22 | func TestHashIDEncode(t *testing.T) { 23 | asserts := assert.New(t) 24 | 25 | encode := HashIDEncode(1, TypeUser) 26 | asserts.NotEmpty(encode) 27 | } 28 | 29 | func TestHashIDDecode(t *testing.T) { 30 | asserts := assert.New(t) 31 | 32 | { 33 | encode := HashIDEncode(1, TypeUser) 34 | asserts.NotEmpty(encode) 35 | 36 | decode, err := HashIDDecode(encode, TypeUser) 37 | asserts.NoError(err) 38 | asserts.Equal(uint(1), decode) 39 | } 40 | { 41 | decode, err := HashIDDecode("test", TypeUser) 42 | asserts.Error(err) 43 | asserts.Equal(uint(0), decode) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /pkg/http/client.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import "github.com/idoubi/goz" 4 | 5 | var client *goz.Request 6 | 7 | func init() { 8 | client = goz.NewClient() 9 | } 10 | -------------------------------------------------------------------------------- /pkg/http/request.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "errors" 5 | "github.com/idoubi/goz" 6 | ) 7 | 8 | const ( 9 | ErrHttp = "http error" 10 | ) 11 | 12 | func Get(url string, opt ...goz.Options) ([]byte, error) { 13 | req, err := client.Get(url, opt...) 14 | if err != nil { 15 | return nil, err 16 | } 17 | 18 | code := req.GetStatusCode() 19 | if code != 200 { 20 | return nil, errors.New(ErrHttp) 21 | } 22 | 23 | data, err := req.GetBody() 24 | if err != nil { 25 | return nil, err 26 | } 27 | 28 | return data, nil 29 | } 30 | 31 | func Post(url string, data interface{}, opts ...goz.Options) ([]byte, error) { 32 | newOpt := []goz.Options{ 33 | { 34 | JSON: data, 35 | }, 36 | } 37 | for _, option := range opts { 38 | newOpt = append(newOpt, option) 39 | } 40 | 41 | req, err := client.Post(url, newOpt...) 42 | if err != nil { 43 | return nil, err 44 | } 45 | 46 | resp, err := req.GetBody() 47 | if err != nil { 48 | return nil, err 49 | } 50 | 51 | return resp, nil 52 | } 53 | -------------------------------------------------------------------------------- /pkg/log/format.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "fmt" 5 | "github.com/fatih/color" 6 | "github.com/sirupsen/logrus" 7 | "os" 8 | "strings" 9 | ) 10 | 11 | type formatter struct { 12 | pid string 13 | } 14 | 15 | // 日志颜色 16 | var colors = map[logrus.Level]func(format string, a ...interface{}) string{ 17 | logrus.WarnLevel: color.New(color.FgYellow).Add(color.Bold).SprintfFunc(), 18 | logrus.PanicLevel: color.New(color.BgHiRed).Add(color.Bold).SprintfFunc(), 19 | logrus.FatalLevel: color.New(color.BgRed).Add(color.Bold).SprintfFunc(), 20 | logrus.ErrorLevel: color.New(color.FgRed).Add(color.Bold).SprintfFunc(), 21 | logrus.InfoLevel: color.New(color.FgCyan).Add(color.Bold).SprintfFunc(), 22 | logrus.DebugLevel: color.New(color.FgWhite).Add(color.Bold).SprintfFunc(), 23 | } 24 | 25 | func (f *formatter) Format(entry *logrus.Entry) ([]byte, error) { 26 | colorFunc := colors[entry.Level] 27 | 28 | level := entry.Level.String() 29 | if entry.Data["level"] != nil { 30 | level = entry.Data["level"].(string) 31 | } 32 | 33 | switch entry.Logger.Level { 34 | case logrus.DebugLevel: 35 | level = colorFunc("%-11s", "["+strings.ToUpper(level)+"]") 36 | default: 37 | level = colorFunc("%-7s", "["+strings.ToUpper(level)+"]") 38 | } 39 | 40 | return []byte(fmt.Sprintf( 41 | "%s %s | %s | %s\n", 42 | level, 43 | f.pid, 44 | entry.Time.Format("2006-01-02 15:04:05.000"), 45 | entry.Message, 46 | )), nil 47 | } 48 | 49 | func NewFormatter() *formatter { 50 | return &formatter{ 51 | pid: color.New(color.FgHiMagenta).Sprint(os.Getpid()), 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /pkg/log/format_test.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | "github.com/stretchr/testify/assert" 6 | "os" 7 | "testing" 8 | ) 9 | 10 | func TestFormat(t *testing.T) { 11 | asserts := assert.New(t) 12 | 13 | logger := logrus.New() 14 | logger.SetFormatter(&formatter{}) 15 | logger.SetOutput(os.Stdout) 16 | logger.SetLevel(logrus.DebugLevel) 17 | 18 | asserts.NotEmpty(logger.Formatter.(*formatter).Format(logger.WithFields(logrus.Fields{"test": "test"}))) 19 | } 20 | 21 | func BenchmarkTestFormatter_Format(b *testing.B) { 22 | logger := logrus.New() 23 | logger.SetFormatter(&formatter{}) 24 | logger.SetOutput(os.Stdout) 25 | logger.SetLevel(logrus.DebugLevel) 26 | 27 | b.ResetTimer() 28 | b.StartTimer() 29 | for i := 0; i < b.N; i++ { 30 | logger.Formatter.(*formatter).Format(logger.WithFields(logrus.Fields{"test": "test"})) 31 | } 32 | b.StopTimer() 33 | } 34 | -------------------------------------------------------------------------------- /pkg/log/gorm.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | type GormLogger struct{} 4 | 5 | func (g *GormLogger) Printf(format string, args ...interface{}) { 6 | Log().WithField("level", "Database").Debugf(format, args...) 7 | } 8 | -------------------------------------------------------------------------------- /pkg/log/gorm_test.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "github.com/stretchr/testify/assert" 5 | "testing" 6 | ) 7 | 8 | func TestGormLogger_Printf(t *testing.T) { 9 | asserts := assert.New(t) 10 | 11 | logger := new(GormLogger) 12 | asserts.NotNil(logger) 13 | asserts.NotPanics(func() { 14 | logger.Printf("test %s", "tests") 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /pkg/log/init.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/sirupsen/logrus" 7 | ) 8 | 9 | func NewLogger() *logrus.Logger { 10 | logger := logrus.New() 11 | logger.SetFormatter(NewFormatter()) 12 | logger.SetOutput(os.Stdout) 13 | logger.SetLevel(Level) 14 | 15 | return logger 16 | } 17 | -------------------------------------------------------------------------------- /pkg/log/init_test.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | "github.com/stretchr/testify/assert" 6 | "os" 7 | "testing" 8 | ) 9 | 10 | func TestInit(t *testing.T) { 11 | asserts := assert.New(t) 12 | 13 | logger := NewLogger() 14 | asserts.NotNil(logger) 15 | asserts.Equal(logrus.DebugLevel, logger.Level) 16 | 17 | asserts.NotPanics(func() { 18 | logger.SetOutput(os.Stdout) 19 | }) 20 | 21 | asserts.NotPanics(func() { 22 | logger.Debugf("debugf %s", "tests") 23 | logger.Infof("infof %s", "tests") 24 | logger.Errorf("errorf %s", "tests") 25 | }) 26 | asserts.Panics(func() { 27 | logger.Panicf("panicf %s", "tests") 28 | }) 29 | asserts.Panics(func() { 30 | logger.Fatalf("fatalf %s", "tests") 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /pkg/log/logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | ) 6 | 7 | var GlobalLogger *logrus.Logger 8 | var Level = logrus.InfoLevel 9 | 10 | func Log() *logrus.Logger { 11 | if GlobalLogger == nil { 12 | GlobalLogger = NewLogger() 13 | } 14 | 15 | return GlobalLogger 16 | } 17 | -------------------------------------------------------------------------------- /pkg/log/logger_test.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "github.com/stretchr/testify/assert" 5 | "testing" 6 | ) 7 | 8 | func TestLogger(t *testing.T) { 9 | asserts := assert.New(t) 10 | 11 | { 12 | logger := Log() 13 | asserts.NotNil(logger) 14 | asserts.Equal(logger, GlobalLogger) 15 | } 16 | 17 | { 18 | GlobalLogger = nil 19 | logger := Log() 20 | asserts.NotNil(logger) 21 | asserts.Equal(logger, GlobalLogger) 22 | } 23 | } 24 | 25 | func BenchmarkLogger(b *testing.B) { 26 | b.StartTimer() 27 | 28 | for i := 0; i < b.N; i++ { 29 | Log().Printf("%s", "tests") 30 | } 31 | 32 | b.StopTimer() 33 | } 34 | 35 | func BenchmarkGormLogger_Printf(b *testing.B) { 36 | b.StartTimer() 37 | 38 | for i := 0; i < b.N; i++ { 39 | new(GormLogger).Printf("%s", "tests") 40 | } 41 | 42 | b.StopTimer() 43 | } 44 | -------------------------------------------------------------------------------- /pkg/serializer/dto/text_json.go: -------------------------------------------------------------------------------- 1 | package dto 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/lezi-wiki/lezi-api/model" 6 | ) 7 | 8 | type TextJsonDTO struct { 9 | Text string `json:"text"` 10 | Namespace string `json:"ns"` 11 | Speaker string `json:"speaker"` 12 | } 13 | 14 | func (t TextJsonDTO) MarshalJSON() ([]byte, error) { 15 | return json.Marshal(t) 16 | } 17 | 18 | func UnmarshalTextJsonDTO(data []byte) (TextJsonDTO, error) { 19 | var r TextJsonDTO 20 | err := json.Unmarshal(data, &r) 21 | return r, err 22 | } 23 | 24 | func UnmarshalTextJsonDTOs(data []byte) ([]TextJsonDTO, error) { 25 | var r []TextJsonDTO 26 | err := json.Unmarshal(data, &r) 27 | return r, err 28 | } 29 | 30 | func BuildTextJsonDTO(text TextJsonDTO) model.Text { 31 | return model.Text{ 32 | Namespace: text.Namespace, 33 | Speaker: text.Speaker, 34 | Text: text.Text, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /pkg/serializer/error_response.go: -------------------------------------------------------------------------------- 1 | package serializer 2 | 3 | import "net/http" 4 | 5 | func NewErrorResponse(code int, msg string) *Response { 6 | return &Response{ 7 | Code: code, 8 | Msg: msg, 9 | } 10 | } 11 | 12 | func NotFoundResponse() *Response { 13 | return &Response{ 14 | Code: http.StatusNotFound, 15 | Msg: http.StatusText(http.StatusNotFound), 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pkg/serializer/response.go: -------------------------------------------------------------------------------- 1 | package serializer 2 | 3 | import ( 4 | "encoding/json" 5 | "encoding/xml" 6 | "net/http" 7 | ) 8 | 9 | type Response struct { 10 | Code int `json:"code" xml:"code"` 11 | Msg string `json:"message" xml:"msg"` 12 | Data interface{} `json:"data,omitempty" xml:"data,omitempty"` 13 | } 14 | 15 | func (r *Response) Json() ([]byte, error) { 16 | bytes, err := json.Marshal(r) 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | return bytes, nil 22 | } 23 | 24 | func (r *Response) Xml() ([]byte, error) { 25 | bytes, err := xml.Marshal(r) 26 | if err != nil { 27 | return nil, err 28 | } 29 | 30 | return bytes, nil 31 | } 32 | 33 | func NewResponse(code int, msg string, data interface{}) *Response { 34 | return &Response{ 35 | Code: code, 36 | Msg: msg, 37 | Data: data, 38 | } 39 | } 40 | 41 | func NewResponseWithCode(code int) *Response { 42 | return &Response{ 43 | Code: code, 44 | Msg: http.StatusText(code), 45 | } 46 | } 47 | 48 | func NewResponseWithCodeAndData(code int, data interface{}) *Response { 49 | return &Response{ 50 | Code: code, 51 | Msg: http.StatusText(code), 52 | Data: data, 53 | } 54 | } 55 | 56 | func NewSuccessResponse(data interface{}) *Response { 57 | return &Response{ 58 | Code: http.StatusOK, 59 | Msg: http.StatusText(http.StatusOK), 60 | Data: data, 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /pkg/serializer/vo/text.go: -------------------------------------------------------------------------------- 1 | package vo 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/lezi-wiki/lezi-api/model" 6 | "github.com/lezi-wiki/lezi-api/pkg/hashids" 7 | ) 8 | 9 | type TextVO struct { 10 | ID string `json:"id" xml:"Id" bson:"id" yaml:"id"` 11 | Namespace string `json:"ns" xml:"Namespace" bson:"namespace" yaml:"namespace"` 12 | Speaker string `json:"speaker" xml:"Speaker" bson:"speaker" yaml:"speaker"` 13 | Text string `json:"text" xml:"Text" bson:"text" yaml:"text"` 14 | } 15 | 16 | func (t TextVO) MarshalTextVOJSON() ([]byte, error) { 17 | return json.Marshal(t) 18 | } 19 | 20 | func UnmarshalTextVO(data []byte) (TextVO, error) { 21 | var r TextVO 22 | err := json.Unmarshal(data, &r) 23 | return r, err 24 | } 25 | 26 | func BuildTextVO(text *model.Text) TextVO { 27 | return TextVO{ 28 | ID: hashids.HashIDEncode(text.ID, hashids.TypeText), 29 | Namespace: text.Namespace, 30 | Speaker: text.Speaker, 31 | Text: text.Text, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /pkg/util/env.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "os" 5 | "strconv" 6 | ) 7 | 8 | func EnvStr(name string, defaultValue string) string { 9 | env := os.Getenv(name) 10 | if env == "" { 11 | return defaultValue 12 | } 13 | return env 14 | } 15 | 16 | func EnvNum(name string, defaultValue int) int { 17 | env := os.Getenv(name) 18 | if env == "" { 19 | return defaultValue 20 | } 21 | num, err := strconv.Atoi(env) 22 | if err != nil { 23 | return defaultValue 24 | } 25 | return num 26 | } 27 | -------------------------------------------------------------------------------- /pkg/util/io.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "github.com/lezi-wiki/lezi-api/pkg/log" 5 | "io" 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | // Exists reports whether the named file or directory exists. 11 | func Exists(name string) bool { 12 | if _, err := os.Stat(name); err != nil { 13 | if os.IsNotExist(err) { 14 | return false 15 | } 16 | } 17 | return true 18 | } 19 | 20 | // CreatNestedFile 给定path创建文件,如果目录不存在就递归创建 21 | func CreatNestedFile(path string) (*os.File, error) { 22 | basePath := filepath.Dir(path) 23 | if !Exists(basePath) { 24 | err := os.MkdirAll(basePath, 0700) 25 | if err != nil { 26 | log.Log().Warningf("无法创建目录,%s", err) 27 | return nil, err 28 | } 29 | } 30 | 31 | return os.Create(path) 32 | } 33 | 34 | // IsEmpty 返回给定目录是否为空目录 35 | func IsEmpty(name string) (bool, error) { 36 | f, err := os.Open(name) 37 | if err != nil { 38 | return false, err 39 | } 40 | defer f.Close() 41 | 42 | _, err = f.Readdirnames(1) // Or f.Readdir(1) 43 | if err == io.EOF { 44 | return true, nil 45 | } 46 | return false, err // Either not empty or error, suits both cases 47 | } 48 | -------------------------------------------------------------------------------- /pkg/util/path.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | ) 7 | 8 | // RelativePath 获取相对可执行文件的路径 9 | func RelativePath(name string) string { 10 | if filepath.IsAbs(name) { 11 | return name 12 | } 13 | e, _ := os.Executable() 14 | return filepath.Join(filepath.Dir(e), name) 15 | } 16 | -------------------------------------------------------------------------------- /pkg/util/random.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "math/rand" 5 | "time" 6 | ) 7 | 8 | func init() { 9 | rand.Seed(time.Now().UnixNano()) 10 | } 11 | 12 | // RandStringRunes 返回随机字符串 13 | func RandStringRunes(n int) string { 14 | var letterRunes = []rune("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") 15 | 16 | b := make([]rune, n) 17 | for i := range b { 18 | b[i] = letterRunes[rand.Intn(len(letterRunes))] 19 | } 20 | 21 | return string(b) 22 | } 23 | 24 | func RandomInt(min, max int) int { 25 | if min >= max { 26 | return max 27 | } 28 | return min + rand.Intn(max-min) 29 | } 30 | 31 | func RandomItemFromSlice[T any](slice []T) T { 32 | return slice[RandomInt(0, len(slice)-1)] 33 | } 34 | -------------------------------------------------------------------------------- /routers/handles.go: -------------------------------------------------------------------------------- 1 | package routers 2 | 3 | import "github.com/gin-gonic/gin" 4 | 5 | func Handles(r *gin.RouterGroup, methods []string, path string, handler ...gin.HandlerFunc) { 6 | for _, method := range methods { 7 | r.Handle(method, path, handler...) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /routers/router.go: -------------------------------------------------------------------------------- 1 | package routers 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "github.com/lezi-wiki/lezi-api/controller" 6 | "github.com/lezi-wiki/lezi-api/middleware" 7 | "github.com/lezi-wiki/lezi-api/pkg/serializer" 8 | "net/http" 9 | ) 10 | 11 | func InitRouter() *gin.Engine { 12 | // Gin router 13 | r := gin.Default() 14 | 15 | // cors 16 | r.Use(middleware.Cors()) 17 | 18 | // Ping interface 19 | r.GET("/ping", func(c *gin.Context) { 20 | c.JSON(http.StatusOK, serializer.NewResponse(http.StatusOK, "pong", nil)) 21 | }) 22 | 23 | r.GET("/", func(c *gin.Context) { 24 | c.Redirect(http.StatusMovedPermanently, "https://github.com/lezi-wiki/lezi-api/wiki") 25 | }) 26 | 27 | // api v1 28 | v1 := r.Group("/api/v1") 29 | 30 | methodsSupport := []string{"GET", "POST", "HEAD", "OPTIONS"} 31 | 32 | { 33 | Handles(v1, methodsSupport, "global", controller.GlobalHandler) 34 | 35 | namespace := v1.Group(":namespace") 36 | { 37 | Handles(namespace, methodsSupport, "text", controller.NamespaceTextHandler) 38 | Handles(namespace, methodsSupport, "json", controller.NamespaceJsonHandler) 39 | Handles(namespace, methodsSupport, "xml", controller.NamespaceXmlHandler) 40 | } 41 | 42 | speaker := v1.Group("speaker/:speaker") 43 | { 44 | Handles(speaker, methodsSupport, "text", controller.SpeakerTextHandler) 45 | Handles(speaker, methodsSupport, "json", controller.SpeakerJsonHandler) 46 | Handles(speaker, methodsSupport, "xml", controller.SpeakerXmlHandler) 47 | } 48 | } 49 | 50 | return r 51 | } 52 | -------------------------------------------------------------------------------- /services/remote/data.go: -------------------------------------------------------------------------------- 1 | package remote 2 | 3 | import ( 4 | "encoding/json" 5 | "errors" 6 | "github.com/lezi-wiki/lezi-api/pkg/http" 7 | "github.com/lezi-wiki/lezi-api/pkg/log" 8 | "github.com/lezi-wiki/lezi-api/pkg/serializer/dto" 9 | ) 10 | 11 | var Endpoint string 12 | 13 | const ( 14 | ErrNotValid = "json is not legal" 15 | ) 16 | 17 | func GetDataFromGitHub() ([]dto.TextJsonDTO, error) { 18 | raw, err := http.Get(Endpoint) 19 | if err != nil { 20 | log.Log().Errorf("Error when get data from GitHub, %s", err.Error()) 21 | return nil, err 22 | } 23 | 24 | isValid := json.Valid(raw) 25 | if !isValid { 26 | log.Log().Errorf("Error when get data from GitHub, %s", ErrNotValid) 27 | return nil, errors.New(ErrNotValid) 28 | } 29 | 30 | data, err := dto.UnmarshalTextJsonDTOs(raw) 31 | if err != nil { 32 | log.Log().Errorf("Error when get data from GitHub, %s", err.Error()) 33 | return nil, err 34 | } 35 | 36 | return data, nil 37 | } 38 | -------------------------------------------------------------------------------- /services/remote/data_test.go: -------------------------------------------------------------------------------- 1 | package remote 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/stretchr/testify/assert" 6 | "testing" 7 | ) 8 | 9 | func TestGetDataFromGitHub(t *testing.T) { 10 | test := assert.New(t) 11 | Endpoint = "https://raw.fastgit.org/lezi-wiki/lezi-api/master/data.json" 12 | data, err := GetDataFromGitHub() 13 | test.NoError(err) 14 | test.NotNil(data) 15 | _, err = json.Marshal(data) 16 | test.NoError(err) 17 | } 18 | --------------------------------------------------------------------------------