diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..86c88f444 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: 🆕 Create new issue + url: http://new-issue.go-admin.dev + about: The issue which is not created via http://new-issue.go-admin.dev will be closed immediately. + - name: 🆕 创建一个新 Issue + url: http://new-issue.go-admin.dev + about: 不是用 http://new-issue.go-admin.dev 创建的 issue 会被机器人自动关闭。 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..049421b9e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,66 @@ + + +[[中文版模板 / Chinese template](https://github.com/go-admin-team/go-admin/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)] + +### 🤔 This is a ... + +- [ ] New feature +- [ ] Bug fix +- [ ] Site / documentation update +- [ ] Demo update +- [ ] Component style update +- [ ] TypeScript definition update +- [ ] Bundle size optimization +- [ ] Performance optimization +- [ ] Enhancement feature +- [ ] Internationalization +- [ ] Refactoring +- [ ] Code style optimization +- [ ] Test Case +- [ ] Branch merge +- [ ] Other (about what?) + +### 🔗 Related issue link + + + +### 💡 Background and solution + + + +### 📝 Changelog + + + +| Language | Changelog | +| ---------- | --------- | +| 🇺🇸 English | | +| 🇨🇳 Chinese | | + +### ☑️ Self-Check before Merge + +⚠️ Please check all items below before review. ⚠️ + +- [ ] Doc is updated/provided or not needed +- [ ] Demo is updated/provided or not needed +- [ ] TypeScript's definition is updated/provided or not needed +- [ ] Changelog is provided or not needed diff --git a/.github/PULL_REQUEST_TEMPLATE/pr_cn.md b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md new file mode 100644 index 000000000..ce155b685 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md @@ -0,0 +1,61 @@ + + +[[English Template / 英文模板](https://github.com/go-admin-team/go-admin/blob/master/.github/PULL_REQUEST_TEMPLATE.md)] + +### 🤔 这个变动的性质是? + +- [ ] 新特性提交 +- [ ] 日常 bug 修复 +- [ ] 站点、文档改进 +- [ ] 演示代码改进 +- [ ] 组件样式/交互改进 +- [ ] TypeScript 定义更新 +- [ ] 包体积优化 +- [ ] 性能优化 +- [ ] 功能增强 +- [ ] 国际化改进 +- [ ] 重构 +- [ ] 代码风格优化 +- [ ] 测试用例 +- [ ] 分支合并 +- [ ] 其他改动(是关于什么的改动?) + +### 🔗 相关 Issue + + + +### 💡 需求背景和解决方案 + + + +### 📝 更新日志 + + + +| 语言 | 更新描述 | +| ------- | -------- | +| 🇺🇸 英文 | | +| 🇨🇳 中文 | | + +### ☑️ 请求合并前的自查清单 + +⚠️ 请自检并全部**勾选全部选项**。⚠️ + +- [ ] 文档已补充或无须补充 +- [ ] 代码演示已提供或无须提供 +- [ ] TypeScript 定义已补充或无须补充 +- [ ] Changelog 已提供或无须提供 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..4825dddaf --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,57 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + IMAGE_NAME: registry.ap-northeast-1.aliyuncs.com/go-admin/go-admin-api # 镜像名称 + TAG: ${{ github.sha }} + IMAGE_NAME_TAG: registry.ap-northeast-1.aliyuncs.com/go-admin/go-admin-api:${{ github.sha }} + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.24 + + - name: Tidy + run: go mod tidy + + - name: Build + run: env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags "sqlite3,json1" --ldflags "-extldflags -static" -o main . + + - name: Build the Docker image and push + run: | + docker login --username=${{ secrets.DOCKER_USERNAME }} registry.ap-northeast-1.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }} + echo "************ docker login end" + docker build -t go-admin-api:latest . + echo "************ docker build end" + docker tag go-admin-api ${{ env.IMAGE_NAME_TAG }} + echo "************ docker tag end" + docker images + echo "************ docker images end" + docker push ${{ env.IMAGE_NAME_TAG }} # 推送 + echo "************ docker push end" + + - name: Restart server # 第五步,重启服务 + uses: appleboy/ssh-action@master + env: + GITHUB_SHA_X: ${GITHUB_SHA} + with: + host: ${{ secrets.SSH_HOST }} # 下面三个配置与上一步类似 + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.DEPLOY_KEY }} + # 重启的脚本,根据自身情况做相应改动,一般要做的是migrate数据库以及重启服务器 + script: | + sudo docker rm -f go-admin-api + sudo docker login --username=${{ secrets.DOCKER_USERNAME }} registry.ap-northeast-1.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }} + sudo docker run -d -p 8000:8000 --name go-admin-api ${{ env.IMAGE_NAME_TAG }} diff --git a/.github/workflows/dev-lwx.yml b/.github/workflows/dev-lwx.yml deleted file mode 100644 index b62a4c6b8..000000000 --- a/.github/workflows/dev-lwx.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: build - -on: - push: - branches: [ dev-lwx ] - pull_request: - branches: [ dev-lwx ] - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.15 - uses: actions/setup-go@v1 - with: - go-version: 1.15 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - name: Build - run: | - CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin . - mv go-admin ./scripts - - - uses: Azure/docker-login@v1 - with: - login-server: registry.cn-shanghai.aliyuncs.com - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - run: | - docker build ./scripts -t registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }} - docker push registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }} - - uses: Azure/k8s-set-context@v1 - with: - kubeconfig: ${{ secrets.KUBE_CONFIG }} - - - uses: Azure/k8s-create-secret@v1 - with: - namespace: 'go-admin' - container-registry-url: registry.cn-shanghai.aliyuncs.com - container-registry-username: ${{ secrets.REGISTRY_USERNAME }} - container-registry-password: ${{ secrets.REGISTRY_PASSWORD }} - secret-name: aliyuncs-k8s-secret - - - uses: Azure/k8s-deploy@v1 - with: - namespace: 'go-admin' - manifests: 'scripts/k8s/deploy.yml' - images: 'registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }}' - imagepullsecrets: 'aliyuncs-k8s-secret' - kubectl-version: 'latest' diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 644578159..fb65e63ff 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,9 +2,12 @@ name: build on: push: - branches: [ master ] + branches: [ master, dev ] pull_request: branches: [ master ] +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: @@ -13,22 +16,47 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.14 - uses: actions/setup-go@v1 + - name: Set up Go 1.18 + uses: actions/setup-go@v3 with: - go-version: 1.14 + go-version: 1.18 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - + run: go mod tidy - name: Build - run: go build -v . + run: make build + + - name: Log in to the Container registry + uses: docker/login-action@v2 + if: startsWith(${{github.ref}}, 'refs/tags/') + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + if: startsWith(${{github.ref}}, 'refs/tags/') + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=auto + tags: | + type=schedule + type=ref,event=tag + type=sha,prefix=,format=long,enable=true,priority=100 + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + if: startsWith(${{github.ref}}, 'refs/tags/') + with: + context: . + file: scripts/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/issue-check-inactive.yml b/.github/workflows/issue-check-inactive.yml new file mode 100644 index 000000000..9a7973100 --- /dev/null +++ b/.github/workflows/issue-check-inactive.yml @@ -0,0 +1,22 @@ +name: Issue Check Inactive + +on: + schedule: + - cron: "0 0 */15 * *" + +permissions: + contents: read + +jobs: + issue-check-inactive: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs + runs-on: ubuntu-latest + steps: + - name: check-inactive + uses: actions-cool/issues-helper@v3 + with: + actions: 'check-inactive' + inactive-label: 'Inactive' + inactive-day: 30 diff --git a/.github/workflows/issue-close-require.yml b/.github/workflows/issue-close-require.yml new file mode 100644 index 000000000..f1fc9b60d --- /dev/null +++ b/.github/workflows/issue-close-require.yml @@ -0,0 +1,32 @@ +name: Issue Close Require + +on: + schedule: + - cron: "0 0 * * *" + +permissions: + contents: read + +jobs: + issue-close-require: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs + runs-on: ubuntu-latest + steps: + - name: need reproduce + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issues' + labels: '🤔 Need Reproduce' + inactive-day: 3 + + - name: needs more info + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issues' + labels: 'needs-more-info' + inactive-day: 3 + body: | + Since the issue was labeled with `needs-more-info`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply. + 由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。 diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml new file mode 100644 index 000000000..5211d3e9b --- /dev/null +++ b/.github/workflows/issue-labeled.yml @@ -0,0 +1,76 @@ +# Origin Source +# https://github.com/ant-design/ant-design/blob/79f566b7f8abb1012ef55b0d2793bfdf5595b85d/.github/workflows/issue-reply.yml +name: Issue Labeled + +on: + issues: + types: [labeled] + +permissions: + contents: read + +jobs: + issue-labeled: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs + runs-on: ubuntu-latest + steps: + - name: help wanted + if: github.event.label.name == 'help wanted' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.ADMIN_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the [Pull Request Template](https://github.com/go-admin-team/go-admin/blob/master/.github/PULL_REQUEST_TEMPLATE.md) here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! + 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的[预设模板](https://github.com/go-admin-team/go-admin/blob/master/.github/PULL_REQUEST_TEMPLATE.md),提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。 + ![giphy](https://user-images.githubusercontent.com/507615/62342668-4735dc00-b51a-11e9-92a7-d46fbb1cc0c7.gif) + - name: 🤔 Need Reproduce + if: github.event.label.name == '🤔 Need Reproduce' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.ADMIN_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by `Need Reproduce` will be closed if no activities in 3 days. + 你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 [此处](https://u.ant.design/codesandbox-repro) 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。 + ![](https://gw.alipayobjects.com/zos/antfincdn/y9kwg7DVCd/reproduce.gif) + - name: Usage + if: github.event.label.name == 'Usage' || github.event.label.name == 'Question' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment,close-issue' + token: ${{ secrets.ADMIN_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please [don't ask usage questions](https://github.com/ant-design/ant-design/issues/2320) here. You can try to open a new discussion in [antd discussions](https://github.com/ant-design/ant-design/discussions), select `Q&A` to ask questions, also can ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/antd) or [Segment Fault](https://segmentfault.com/t/antd), then apply tag `antd` and `react` to your question. + 你好 @${{ github.event.issue.user.login }},go-admin Issue 板块是用于 bug 反馈与需求讨论的地方。请[勿询问如何使用的问题](https://github.com/go-admin-te/ant-design/issues/699),你可以试着在 [antd discussions](https://github.com/ant-design/ant-design/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问,也可以在 [Stack Overflow](https://stackoverflow.com/questions/tagged/antd) 或者 [Segment Fault](https://segmentfault.com/t/antd) 中提问(记得添加 `antd` 和 `react` 标签哦~)。 + - name: 3.x + if: github.event.label.name == '3.x' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment,close-issue' + token: ${{ secrets.ADMIN_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hi @${{ github.event.issue.user.login }}. Current version (3.x) is off the maintenance period. We may not accept pull request or fix bug with it anymore. This topic will be auto closed. + 你好 @${{ github.event.issue.user.login }},当前版本(3.x)已经过了维护期。我们不会再接受对其的相关 PR 与 issue。当前 topic 会被自动关闭。 + - name: invalid + if: github.event.label.name == 'Invalid' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment,close-issue' + token: ${{ secrets.ADMIN_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](https://new-issue.go-admin.dev) to create an issue, thank you! + 你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](https://new-issue.go-admin.dev) 来创建 issue 以方便我们定位错误。谢谢配合! + - name: rtl + if: github.event.label.name == 'rtl' + uses: actions-cool/issues-helper@v3 + with: + actions: 'add-assignees' + assignees: 'xrkffgg' diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml new file mode 100644 index 000000000..9249c8e78 --- /dev/null +++ b/.github/workflows/mirror.yaml @@ -0,0 +1,29 @@ +name: 'GitHub Actions Mirror' + +on: [push, delete] + +jobs: + mirror_to_gitee: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v1 + - name: 'Mirror to gitee' + uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git@gitee.com:go-admin-team/go-admin.git + ssh_private_key: + ${{ secrets.GITEE_KEY }} + mirror_to_gitlab: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v1 + - name: 'Mirror to gitlab' + uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git@gitlab.com:go-admin-team/go-admin.git + ssh_private_key: + ${{ secrets.GITLAB_KEY }} diff --git a/.gitignore b/.gitignore index ce6fd6bd2..24cb16d50 100644 --- a/.gitignore +++ b/.gitignore @@ -3,13 +3,13 @@ */.DS_Store static/uploadfile main.exe +*.exe go-admin +go-admin.exe temp/ !temp vendor config/settings.dev.yml -go-admin -common/middleware/demo.go config/settings.dev.*.yml config/settings.dev.*.yml.log temp/logs @@ -17,7 +17,6 @@ config/settings.dev.yml.log config/settings.b.dev.yml cmd/migrate/migration/version-local/* !cmd/migrate/migration/version-local/doc.go -*/.DS_Store # go sum go.sum diff --git a/Dockerfile b/Dockerfile index 9e24efb35..fb3e023dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,18 @@ FROM alpine -ENV GOPROXY https://goproxy.cn/ +# ENV GOPROXY https://goproxy.cn/ + +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories RUN apk update --no-cache +RUN apk add --update gcc g++ libc6-compat RUN apk add --no-cache ca-certificates RUN apk add --no-cache tzdata ENV TZ Asia/Shanghai COPY ./main /main -COPY ./config/settings.prod.yml /config/settings.yml +COPY ./config/settings.demo.yml /config/settings.yml +COPY ./go-admin-db.db /go-admin-db.db EXPOSE 8000 RUN chmod +x /main CMD ["/main","server","-c", "/config/settings.yml"] \ No newline at end of file diff --git a/Dockerfilebak b/Dockerfilebak new file mode 100644 index 000000000..c5e33a5c0 --- /dev/null +++ b/Dockerfilebak @@ -0,0 +1,28 @@ +FROM golang:alpine as builder + +MAINTAINER lwnmengjing + +ENV GOPROXY https://goproxy.cn/ + +WORKDIR /go/release +#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories +RUN apk update && apk add tzdata + +COPY go.mod ./go.mod +RUN go mod tidy +COPY . . +RUN pwd && ls + +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin . + +FROM alpine + +COPY --from=builder /go/release/go-admin / + +COPY --from=builder /go/release/config/settings.yml /config/settings.yml + +COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +EXPOSE 8000 + +CMD ["/go-admin","server","-c", "/config/settings.yml"] \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index 2e5981c4f..36b35f4c3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 wenjianzhang +Copyright (c) 2020 go-admin-team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index 952901248..afdb1a12b 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,41 @@ PROJECT:=go-admin .PHONY: build build: - CGO_ENABLED=0 go build -o go-admin main.go + CGO_ENABLED=0 go build -ldflags="-w -s" -a -installsuffix "" -o go-admin . + +# make build-linux +build-linux: + @docker build -t go-admin:latest . + @echo "build successful" + build-sqlite: - go build -tags sqlite3 -o go-admin main.go + go build -tags sqlite3 -ldflags="-w -s" -a -installsuffix -o go-admin . + +# make run +run: + # delete go-admin-api container + @if [ $(shell docker ps -aq --filter name=go-admin --filter publish=8000) ]; then docker rm -f go-admin; fi + + # 启动方法一 run go-admin-api container docker-compose 启动方式 + # 进入到项目根目录 执行 make run 命令 + @docker-compose up -d + + # 启动方式二 docker run 这里注意-v挂载的宿主机的地址改为部署时的实际决对路径 + #@docker run --name=go-admin -p 8000:8000 -v /home/code/go/src/go-admin/go-admin/config:/go-admin-api/config -v /home/code/go/src/go-admin/go-admin-api/static:/go-admin/static -v /home/code/go/src/go-admin/go-admin/temp:/go-admin-api/temp -d --restart=always go-admin:latest + + @echo "go-admin service is running..." + + # delete Tag= 的镜像 + @docker image prune -f + @docker ps -a | grep "go-admin" + +stop: + # delete go-admin-api container + @if [ $(shell docker ps -aq --filter name=go-admin --filter publish=8000) ]; then docker-compose down; fi + #@if [ $(shell docker ps -aq --filter name=go-admin --filter publish=8000) ]; then docker rm -f go-admin; fi + #@echo "go-admin stop success" + + #.PHONY: test #test: # go test -v ./... -cover @@ -12,3 +44,11 @@ build-sqlite: #.PHONY: docker #docker: # docker build . -t go-admin:latest + +# make deploy +deploy: + + #@git checkout master + #@git pull origin master + make build-linux + make run diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 1d4cc3231..f7acfb838 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -1,6 +1,6 @@ # go-admin - + [![Build Status](https://github.com/wenjianzhang/go-admin/workflows/build/badge.svg)](https://github.com/go-admin-team/go-admin) @@ -9,18 +9,25 @@ [English](https://github.com/go-admin-team/go-admin/blob/master/README.md) | 简体中文 -基于Gin + Vue + Element UI的前后端分离权限管理系统,系统初始化极度简单,只需要配置文件中,修改数据库连接,系统支持多指令操作,迁移指令可以让初始化数据库信息变得更简单,服务指令可以很简单的启动api服务 +基于Gin + Vue + Element UI OR Arco Design OR Ant Design的前后端分离权限管理系统,系统初始化极度简单,只需要配置文件中,修改数据库连接,系统支持多指令操作,迁移指令可以让初始化数据库信息变得更简单,服务指令可以很简单的启动api服务 -[在线文档](https://doc.go-admin.dev) - -[github在线文档](https://wenjianzhang.github.io) - -[gitee在线文档](http://mydearzwj.gitee.io/go-admin-doc/) +[在线文档](https://www.go-admin.pro) [前端项目](https://github.com/go-admin-team/go-admin-ui) [视频教程](https://space.bilibili.com/565616721/channel/detail?cid=125737) +## 🎬 在线体验 + +Element UI vue体验:[https://vue2.go-admin.dev](https://vue2.go-admin.dev/#/login) +> ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 + +Arco Design vue3 demo:[https://vue3.go-admin.dev](https://vue3.go-admin.dev/#/login) +> ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 + +antd体验:[https://antd.go-admin.pro](https://antd.go-admin.pro/) +> ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 + ## ✨ 特性 - 遵循 RESTful API 设计规范 @@ -74,9 +81,9 @@ ### 轻松实现go-admin写出第一个应用 - 文档教程 -[步骤一 - 基础内容介绍](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial01.html) +[步骤一 - 基础内容介绍](https://doc.zhangwj.com/guide/intro/tutorial01.html) -[步骤二 - 实际应用 - 编写增删改查](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial02.html) +[步骤二 - 实际应用 - 编写增删改查](https://doc.zhangwj.com/guide/intro/tutorial02.html) ### 手把手教你从入门到放弃 - 视频教程 @@ -100,6 +107,14 @@ ## 📦 本地开发 +### 环境要求 + +go 1.18 + +node版本: v14.16.0 + +npm版本: 6.14.11 + ### 开发目录创建 ```bash @@ -130,19 +145,22 @@ git clone https://github.com/go-admin-team/go-admin-ui.git # 进入 go-admin 后端项目 cd ./go-admin +# 更新整理依赖 +go mod tidy + # 编译项目 go build # 修改配置 # 文件路径 go-admin/config/settings.yml -vi ./config/setting.yml +vi ./config/settings.yml # 1. 配置文件中修改数据库信息 # 注意: settings.database 下对应的配置数据 # 2. 确认log路径 ``` -:::tip ⚠️注意 在windows环境如果没有安装中CGO,会出现这个问题; +⚠️注意 在windows环境如果没有安装中CGO,会出现这个问题; ```bash E:\go-admin>go build @@ -158,19 +176,18 @@ D:\Code\go-admin>go build cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` -[解决cgo问题进入](https://doc.go-admin.dev/guide/other/faq.html#_5-cgo-exec-missing-cc-exec-missing-cc-file-does-not-exist) +[解决cgo问题进入](https://doc.go-admin.dev/zh-CN/guide/faq#cgo-%E7%9A%84%E9%97%AE%E9%A2%98) -::: #### 初始化数据库,以及服务启动 ``` bash # 首次配置需要初始化数据库资源信息 # macOS or linux 下使用 -$ ./go-admin migrate -c=config/settings.dev.yml +$ ./go-admin migrate -c config/settings.dev.yml # ⚠️注意:windows 下使用 -$ go-admin.exe migrate -c=config/settings.dev.yml +$ go-admin.exe migrate -c config/settings.dev.yml # 启动项目,也可以用IDE进行调试 @@ -182,6 +199,13 @@ $ ./go-admin server -c config/settings.yml $ go-admin.exe server -c config/settings.yml ``` +#### sys_api 表的数据如何添加 + +在项目启动时,使用`-a true` 系统会自动添加缺少的接口数据 +```bash +./go-admin server -c config/settings.yml -a true +``` + #### 使用docker 编译启动 ```shell @@ -217,39 +241,76 @@ env GOOS=linux GOARCH=amd64 go build main.go npm install # 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 -npm install --registry=https://registry.npm.taobao.org +npm install --registry=https://registry.npmmirror.com # 启动服务 npm run dev ``` -## 🎬 在线体验 - -> admin / 123456 - -演示地址:[http://www.go-admin.dev](http://www.go-admin.dev/#/login) - ## 📨 互动 - + + - + +
wenjianzhang
微信go-admin技术交流甲号公众号🔥🔥🔥 go-admin技术交流乙号哔哩哔哩🔥🔥🔥
-## 💎 主要成员 - - - - - +## 💎 贡献者 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## JetBrains 开源证书支持 @@ -259,16 +320,20 @@ npm run dev ## 🤝 特别感谢 -1. [chengxiao](https://github.com/chengxiao) -2. [gin](https://github.com/gin-gonic/gin) -2. [casbin](https://github.com/casbin/casbin) -2. [spf13/viper](https://github.com/spf13/viper) -2. [gorm](https://github.com/jinzhu/gorm) -2. [gin-swagger](https://github.com/swaggo/gin-swagger) -2. [jwt-go](https://github.com/dgrijalva/jwt-go) -2. [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) -2. [ruoyi-vue](https://gitee.com/y_project/RuoYi-Vue) -2. [form-generator](https://github.com/JakHuang/form-generator) +1. [ant-design](https://github.com/ant-design/ant-design) +2. [ant-design-pro](https://github.com/ant-design/ant-design-pro) +2. [arco-design](https://github.com/arco-design/arco-design) +2. [arco-design-pro](https://github.com/arco-design/arco-design-pro) +4. [gin](https://github.com/gin-gonic/gin) +5. [casbin](https://github.com/casbin/casbin) +6. [spf13/viper](https://github.com/spf13/viper) +7. [gorm](https://github.com/jinzhu/gorm) +8. [gin-swagger](https://github.com/swaggo/gin-swagger) +9. [jwt-go](https://github.com/dgrijalva/jwt-go) +10. [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) +11. [ruoyi-vue](https://gitee.com/y_project/RuoYi-Vue) +12. [form-generator](https://github.com/JakHuang/form-generator) + ## 🤟 打赏 @@ -284,4 +349,4 @@ npm run dev [MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md) -Copyright (c) 2020 wenjianzhang \ No newline at end of file +Copyright (c) 2024 wenjianzhang diff --git a/README.md b/README.md index 860b62901..39bcf0acf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-admin - + [![Build Status](https://github.com/wenjianzhang/go-admin/workflows/build/badge.svg)](https://github.com/go-admin-team/go-admin) @@ -10,14 +10,25 @@ English | [简体中文](https://github.com/go-admin-team/go-admin/blob/master/README.Zh-cn.md) -The front-end and back-end separation authority management system based on Gin + Vue + Element UI is extremely simple to initialize the system. You only need to modify the database connection in the configuration file. The system supports multi-instruction operations. Migration instructions can make it easier to initialize database information. Service instructions It's easy to start the api service. +The front-end and back-end separation authority management system based on Gin + Vue + Element UI OR Arco Design is extremely simple to initialize the system. You only need to modify the database connection in the configuration file. The system supports multi-instruction operations. Migration instructions can make it easier to initialize database information. Service instructions It's easy to start the api service. -[documentation](https://doc.go-admin.dev) +[documentation](https://www.go-admin.dev) [Front-end project](https://github.com/go-admin-team/go-admin-ui) [Video tutorial](https://space.bilibili.com/565616721/channel/detail?cid=125737) +## 🎬 Online Demo + +Element UI vue demo:[https://vue2.go-admin.dev](https://vue2.go-admin.dev/#/login) +> 账号 / 密码: admin / 123456 + +Arco Design vue3 demo:[https://vue3.go-admin.dev](https://vue3.go-admin.dev/#/login) +> 账号 / 密码: admin / 123456 + +antd demo:[https://antd.go-admin.pro](https://antd.go-admin.pro/) +> 账号 / 密码: admin / 123456 +> ## ✨ Feature - Follow RESTful API design specifications @@ -68,9 +79,9 @@ At the same time, a series of tutorials including videos and documents are provi ### Easily implement go-admin to write the first application-documentation tutorial -[Step 1 - basic content introduction](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial01.html) +[Step 1 - basic content introduction](https://doc.zhangwj.com/guide/intro/tutorial01.html) -[Step 2 - Practical application - writing database operations](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial02.html) +[Step 2 - Practical application - writing database operations](https://doc.zhangwj.com/guide/intro/tutorial02.html) ### Teach you from getting started to giving up-video tutorial @@ -94,6 +105,14 @@ At the same time, a series of tutorials including videos and documents are provi ## 📦 Local development +### Environmental requirements + +go 1.18 + +nodejs: v14.16.0 + +npm: 6.14.11 + ### Development directory creation ```bash @@ -124,19 +143,22 @@ git clone https://github.com/go-admin-team/go-admin-ui.git # Enter the go-admin backend project cd ./go-admin +# Update dependencies +go mod tidy + # Compile the project go build # Change setting # File path go-admin/config/settings.yml -vi ./config/setting.yml +vi ./config/settings.yml # 1. Modify the database information in the configuration file # Note: The corresponding configuration data under settings.database # 2. Confirm the log path ``` -:::tip ⚠️Note that this problem will occur if CGO is not installed in the windows environment; +:::tip ⚠️Note that this problem will occur if CGO is not installed in the windows10+ environment; ```bash E:\go-admin>go build @@ -152,7 +174,7 @@ D:\Code\go-admin>go build cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` -[Solve the cgo problem and enter](https://doc.go-admin.dev/guide/other/faq.html#_5-cgo-exec-missing-cc-exec-missing-cc-file-does-not-exist) +[Solve the cgo problem and enter](https://doc.go-admin.dev/guide/faq#cgo-%E7%9A%84%E9%97%AE%E9%A2%98) ::: @@ -161,10 +183,10 @@ cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` bash # The first configuration needs to initialize the database resource information # Use under macOS or linux -$ ./go-admin migrate -c=config/settings.dev.yml +$ ./go-admin migrate -c config/settings.dev.yml # ⚠️Note: Use under windows -$ go-admin.exe migrate -c=config/settings.dev.yml +$ go-admin.exe migrate -c config/settings.dev.yml # Start the project, you can also use the IDE for debugging # Use under macOS or linux @@ -214,31 +236,69 @@ npm install # or cnpm install npm run dev ``` -## 🎬 Online Demo -> admin / 123456 - -演示地址:[http://www.go-admin.dev](http://www.go-admin.dev/#/login) - - ## 📨 Interactive + + + +
wenjianzhang
WechatWechat公众号🔥🔥🔥 go-admin技术交流乙号bilibili🔥🔥🔥
-## 💎 Members - - - - - +## 💎 Contributors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -250,7 +310,11 @@ The `go-admin` project has always been developed in the GoLand integrated develo ## 🤝 Thanks -1. [chengxiao](https://github.com/chengxiao) + +1. [ant-design](https://github.com/ant-design/ant-design) +2. [ant-design-pro](https://github.com/ant-design/ant-design-pro) +2. [arco-design](https://github.com/arco-design/arco-design) +2. [arco-design-pro](https://github.com/arco-design/arco-design-pro) 2. [gin](https://github.com/gin-gonic/gin) 2. [casbin](https://github.com/casbin/casbin) 2. [spf13/viper](https://github.com/spf13/viper) @@ -268,10 +332,11 @@ The `go-admin` project has always been developed in the GoLand integrated develo ## 🤝 Link -[Go developer growth roadmap](http://www.golangroadmap.com/) +- [Go developer growth roadmap](http://www.golangroadmap.com/) +- [mss-boot-io](https://docs.mss-boot-io.top/) ## 🔑 License [MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md) -Copyright (c) 2020 wenjianzhang \ No newline at end of file +Copyright (c) 2022 wenjianzhang diff --git a/app/admin/apis/captcha.go b/app/admin/apis/captcha.go index f5bccace9..e884e24a5 100644 --- a/app/admin/apis/captcha.go +++ b/app/admin/apis/captcha.go @@ -17,17 +17,17 @@ type System struct { // @Success 200 {object} response.Response{data=string,id=string,msg=string} "{"code": 200, "data": [...]}" // @Router /api/v1/captcha [get] func (e System) GenerateCaptchaHandler(c *gin.Context) { - err := e.MakeContext(c).Errors - if err != nil { + if err := e.MakeContext(c).Errors; err != nil { e.Error(500, err, "服务初始化失败!") return } - id, b64s, err := captcha.DriverDigitFunc() + id, b64s, answer, err := captcha.DriverDigitFunc() if err != nil { e.Logger.Errorf("DriverDigitFunc error, %s", err.Error()) e.Error(500, err, "验证码获取失败") return } + e.Logger.Infof("DriverDigitFunc answer: %s", answer) e.Custom(gin.H{ "code": 200, "data": b64s, diff --git a/app/admin/apis/go_admin.go b/app/admin/apis/go_admin.go index 6fa8a1624..a44da2fd7 100644 --- a/app/admin/apis/go_admin.go +++ b/app/admin/apis/go_admin.go @@ -17,7 +17,7 @@ body{ overflow-y:hidden } - + - + ` diff --git a/app/admin/apis/sys_config.go b/app/admin/apis/sys_config.go index e4886bcea..0a95c8b4f 100644 --- a/app/admin/apis/sys_config.go +++ b/app/admin/apis/sys_config.go @@ -198,7 +198,7 @@ func (e SysConfig) Get2SysApp(c *gin.Context) { return } // 控制只读前台的数据 - req.IsFrontend = 1 + req.IsFrontend = "1" list := make([]models.SysConfig, 0) err = s.GetWithKeyList(&req, &list) if err != nil { @@ -310,4 +310,4 @@ func (e SysConfig) GetSysConfigByKEYForService(c *gin.Context) { return } e.OK(resp, s.Msg) -} \ No newline at end of file +} diff --git a/app/admin/apis/sys_dept.go b/app/admin/apis/sys_dept.go index f37eae4ba..8f1663fe4 100644 --- a/app/admin/apis/sys_dept.go +++ b/app/admin/apis/sys_dept.go @@ -187,7 +187,7 @@ func (e SysDept) Get2Tree(c *gin.Context) { req := dto.SysDeptGetPageReq{} err := e.MakeContext(c). MakeOrm(). - Bind(&req,binding.Form). + Bind(&req, binding.Form). MakeService(&s.Service). Errors if err != nil { @@ -235,4 +235,4 @@ func (e SysDept) GetDeptTreeRoleSelect(c *gin.Context) { "depts": result, "checkedKeys": menuIds, }, "") -} \ No newline at end of file +} diff --git a/app/admin/apis/sys_menu.go b/app/admin/apis/sys_menu.go index d6eab24d0..36fa29eeb 100644 --- a/app/admin/apis/sys_menu.go +++ b/app/admin/apis/sys_menu.go @@ -202,44 +202,6 @@ func (e SysMenu) GetMenuRole(c *gin.Context) { e.OK(result, "") } -//// GetMenuIDS 获取角色对应的菜单id数组 -//// @Summary 获取角色对应的菜单id数组,设置角色权限使用 -//// @Description 获取JSON -//// @Tags 菜单 -//// @Param id path int true "id" -//// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" -//// @Router /api/v1/menuids/{id} [get] -//// @Security Bearer -//func (e SysMenu) GetMenuIDS(c *gin.Context) { -// s := new(service.SysMenu) -// r := service.SysRole{} -// m := dto.SysRoleByName{} -// err := e.MakeContext(c). -// MakeOrm(). -// Bind(&m, binding.JSON). -// MakeService(&s.Service). -// MakeService(&r.Service). -// Errors -// if err != nil { -// e.Logger.Error(err) -// e.Error(500, err, err.Error()) -// return -// } -// var data models.SysRole -// err = r.GetWithName(&m, &data).Error -// -// //data.RoleName = c.GetString("role") -// //data.UpdateBy = user.GetUserId(c) -// //result, err := data.GetIDS(s.Orm) -// -// if err != nil { -// e.Logger.Errorf("GetIDS error, %s", err.Error()) -// e.Error(500, err, "获取失败") -// return -// } -// e.OK(result, "") -//} - // GetMenuTreeSelect 根据角色ID查询菜单下拉树结构 // @Summary 角色修改使用的菜单列表 // @Description 获取JSON @@ -253,7 +215,7 @@ func (e SysMenu) GetMenuRole(c *gin.Context) { func (e SysMenu) GetMenuTreeSelect(c *gin.Context) { m := service.SysMenu{} r := service.SysRole{} - req :=dto.SelectRole{} + req := dto.SelectRole{} err := e.MakeContext(c). MakeOrm(). MakeService(&m.Service). @@ -284,4 +246,4 @@ func (e SysMenu) GetMenuTreeSelect(c *gin.Context) { "menus": result, "checkedKeys": menuIds, }, "获取成功") -} \ No newline at end of file +} diff --git a/app/admin/apis/sys_post.go b/app/admin/apis/sys_post.go index 33911fb8f..a12d54a28 100644 --- a/app/admin/apis/sys_post.go +++ b/app/admin/apis/sys_post.go @@ -2,6 +2,7 @@ package apis import ( "fmt" + "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/go-admin-team/go-admin-core/sdk/api" @@ -93,8 +94,7 @@ func (e SysPost) Get(c *gin.Context) { // @Accept application/json // @Product application/json // @Param data body dto.SysPostInsertReq true "data" -// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" -// @Success 200 {string} string "{"code": -1, "message": "添加失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post [post] // @Security Bearer func (e SysPost) Insert(c *gin.Context) { @@ -126,8 +126,7 @@ func (e SysPost) Insert(c *gin.Context) { // @Accept application/json // @Product application/json // @Param data body dto.SysPostUpdateReq true "body" -// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" -// @Success 200 {string} string "{"code": -1, "message": "添加失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post/{id} [put] // @Security Bearer func (e SysPost) Update(c *gin.Context) { @@ -159,8 +158,7 @@ func (e SysPost) Update(c *gin.Context) { // @Description 删除数据 // @Tags 岗位 // @Param id body dto.SysPostDeleteReq true "请求参数" -// @Success 200 {string} string "{"code": 200, "message": "删除成功"}" -// @Success 500 {string} string "{"code": 500, "message": "删除失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post [delete] // @Security Bearer func (e SysPost) Delete(c *gin.Context) { @@ -183,4 +181,4 @@ func (e SysPost) Delete(c *gin.Context) { return } e.OK(req.GetId(), "删除成功") -} +} \ No newline at end of file diff --git a/app/admin/apis/sys_role.go b/app/admin/apis/sys_role.go index 7e28a671d..d7ee1e7f3 100644 --- a/app/admin/apis/sys_role.go +++ b/app/admin/apis/sys_role.go @@ -2,10 +2,12 @@ package apis import ( "fmt" + "go-admin/common/global" + "net/http" + "github.com/gin-gonic/gin/binding" "github.com/go-admin-team/go-admin-core/sdk" "go-admin/app/admin/models" - "net/http" "github.com/gin-gonic/gin" "github.com/go-admin-team/go-admin-core/sdk/api" @@ -14,7 +16,6 @@ import ( "go-admin/app/admin/service" "go-admin/app/admin/service/dto" - "go-admin/common/global" ) type SysRole struct { @@ -125,12 +126,13 @@ func (e SysRole) Insert(c *gin.Context) { err = s.Insert(&req, cb) if err != nil { e.Logger.Error(err) - e.Error(500, err, "创建失败") + e.Error(500, err, "创建失败,"+err.Error()) return } _, err = global.LoadPolicy(c) if err != nil { - e.Error(500, err, "") + e.Logger.Error(err) + e.Error(500, err, "创建失败,"+err.Error()) return } e.OK(req.GetId(), "创建成功") @@ -168,11 +170,14 @@ func (e SysRole) Update(c *gin.Context) { e.Logger.Error(err) return } + _, err = global.LoadPolicy(c) if err != nil { - e.Error(500, err, "") + e.Logger.Error(err) + e.Error(500, err, "更新失败,"+err.Error()) return } + e.OK(req.GetId(), "更新成功") } @@ -198,17 +203,14 @@ func (e SysRole) Delete(c *gin.Context) { return } - err = s.Remove(&req) + cb := sdk.Runtime.GetCasbinKey(c.Request.Host) + err = s.Remove(&req, cb) if err != nil { e.Logger.Error(err) e.Error(500, err, "") return } - _, err = global.LoadPolicy(c) - if err != nil { - e.Error(500, err, fmt.Sprintf("删除角色 %v 失败,失败信息 %s", req.GetId(), err.Error())) - return - } + e.OK(req.GetId(), fmt.Sprintf("删除角色角色 %v 状态成功!", req.GetId())) } @@ -227,7 +229,7 @@ func (e SysRole) Update2Status(c *gin.Context) { req := dto.UpdateStatusReq{} err := e.MakeContext(c). MakeOrm(). - Bind(&req). + Bind(&req, binding.JSON, nil). MakeService(&s.Service). Errors if err != nil { @@ -279,4 +281,4 @@ func (e SysRole) Update2DataScope(c *gin.Context) { return } e.OK(nil, "操作成功") -} \ No newline at end of file +} diff --git a/app/admin/apis/sys_user.go b/app/admin/apis/sys_user.go index 16fcff1a5..0cf6fc0a4 100644 --- a/app/admin/apis/sys_user.go +++ b/app/admin/apis/sys_user.go @@ -3,6 +3,7 @@ package apis import ( "github.com/gin-gonic/gin/binding" "go-admin/app/admin/models" + "golang.org/x/crypto/bcrypt" "net/http" "github.com/gin-gonic/gin" @@ -30,7 +31,7 @@ type SysUser struct { // @Security Bearer func (e SysUser) GetPage(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserGetPageReq{} + req := dto.SysUserGetPageReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req). @@ -67,7 +68,7 @@ func (e SysUser) GetPage(c *gin.Context) { // @Security Bearer func (e SysUser) Get(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserById{} + req := dto.SysUserById{} err := e.MakeContext(c). MakeOrm(). Bind(&req, nil). @@ -101,7 +102,7 @@ func (e SysUser) Get(c *gin.Context) { // @Security Bearer func (e SysUser) Insert(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserInsertReq{} + req := dto.SysUserInsertReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req, binding.JSON). @@ -136,7 +137,7 @@ func (e SysUser) Insert(c *gin.Context) { // @Security Bearer func (e SysUser) Update(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserUpdateReq{} + req := dto.SysUserUpdateReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req). @@ -171,7 +172,7 @@ func (e SysUser) Update(c *gin.Context) { // @Security Bearer func (e SysUser) Delete(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserById{} + req := dto.SysUserById{} err := e.MakeContext(c). MakeOrm(). Bind(&req, binding.JSON). @@ -208,7 +209,7 @@ func (e SysUser) Delete(c *gin.Context) { // @Security Bearer func (e SysUser) InsetAvatar(c *gin.Context) { s := service.SysUser{} - req :=dto.UpdateSysUserAvatarReq{} + req := dto.UpdateSysUserAvatarReq{} err := e.MakeContext(c). MakeOrm(). MakeService(&s.Service). @@ -257,7 +258,7 @@ func (e SysUser) InsetAvatar(c *gin.Context) { // @Security Bearer func (e SysUser) UpdateStatus(c *gin.Context) { s := service.SysUser{} - req :=dto.UpdateSysUserStatusReq{} + req := dto.UpdateSysUserStatusReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req, binding.JSON, nil). @@ -294,7 +295,7 @@ func (e SysUser) UpdateStatus(c *gin.Context) { // @Security Bearer func (e SysUser) ResetPwd(c *gin.Context) { s := service.SysUser{} - req :=dto.ResetSysUserPwdReq{} + req := dto.ResetSysUserPwdReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req, binding.JSON). @@ -320,7 +321,7 @@ func (e SysUser) ResetPwd(c *gin.Context) { } // UpdatePwd -// @Summary 重置密码 +// @Summary 修改密码 // @Description 获取JSON // @Tags 用户 // @Accept application/json @@ -331,7 +332,7 @@ func (e SysUser) ResetPwd(c *gin.Context) { // @Security Bearer func (e SysUser) UpdatePwd(c *gin.Context) { s := service.SysUser{} - req :=dto.PassWord{} + req := dto.PassWord{} err := e.MakeContext(c). MakeOrm(). Bind(&req). @@ -345,6 +346,10 @@ func (e SysUser) UpdatePwd(c *gin.Context) { // 数据权限检查 p := actions.GetPermissionFromContext(c) + var hash []byte + if hash, err = bcrypt.GenerateFromPassword([]byte(req.NewPassword), bcrypt.DefaultCost); err != nil { + req.NewPassword = string(hash) + } err = s.UpdatePwd(user.GetUserId(c), req.OldPassword, req.NewPassword, p) if err != nil { @@ -352,6 +357,7 @@ func (e SysUser) UpdatePwd(c *gin.Context) { e.Error(http.StatusForbidden, err, "密码修改失败") return } + e.OK(nil, "密码修改成功") } @@ -364,7 +370,7 @@ func (e SysUser) UpdatePwd(c *gin.Context) { // @Security Bearer func (e SysUser) GetProfile(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserById{} + req := dto.SysUserById{} err := e.MakeContext(c). MakeOrm(). MakeService(&s.Service). @@ -401,7 +407,7 @@ func (e SysUser) GetProfile(c *gin.Context) { // @Router /api/v1/getinfo [get] // @Security Bearer func (e SysUser) GetInfo(c *gin.Context) { - req :=dto.SysUserById{} + req := dto.SysUserById{} s := service.SysUser{} r := service.SysRole{} err := e.MakeContext(c). @@ -444,10 +450,10 @@ func (e SysUser) GetInfo(c *gin.Context) { if sysUser.Avatar != "" { mp["avatar"] = sysUser.Avatar } - mp["userName"] = sysUser.NickName + mp["userName"] = sysUser.Username mp["userId"] = sysUser.UserId mp["deptId"] = sysUser.DeptId mp["name"] = sysUser.NickName mp["code"] = 200 e.OK(mp, "") -} \ No newline at end of file +} diff --git a/app/admin/models/casbin_rule.go b/app/admin/models/casbin_rule.go index 014e2fd18..d9013eed7 100644 --- a/app/admin/models/casbin_rule.go +++ b/app/admin/models/casbin_rule.go @@ -1,14 +1,14 @@ package models -//sys_casbin_rule type CasbinRule struct { - PType string `json:"p_type" gorm:"size:100;"` - V0 string `json:"v0" gorm:"size:100;"` - V1 string `json:"v1" gorm:"size:100;"` - V2 string `json:"v2" gorm:"size:100;"` - V3 string `json:"v3" gorm:"size:100;"` - V4 string `json:"v4" gorm:"size:100;"` - V5 string `json:"v5" gorm:"size:100;"` + ID uint `gorm:"primaryKey;autoIncrement"` + Ptype string `gorm:"size:512;uniqueIndex:unique_index"` + V0 string `gorm:"size:512;uniqueIndex:unique_index"` + V1 string `gorm:"size:512;uniqueIndex:unique_index"` + V2 string `gorm:"size:512;uniqueIndex:unique_index"` + V3 string `gorm:"size:512;uniqueIndex:unique_index"` + V4 string `gorm:"size:512;uniqueIndex:unique_index"` + V5 string `gorm:"size:512;uniqueIndex:unique_index"` } func (CasbinRule) TableName() string { diff --git a/app/admin/models/initdb.go b/app/admin/models/initdb.go index 9bb37a2ab..cdec260f3 100644 --- a/app/admin/models/initdb.go +++ b/app/admin/models/initdb.go @@ -31,7 +31,7 @@ func ExecSql(db *gorm.DB, filePath string) error { fmt.Println(sqlList[i]) continue } - sql := strings.Replace(sqlList[i]+";", "\n", "", 0) + sql := strings.Replace(sqlList[i]+";", "\n", "", -1) sql = strings.TrimSpace(sql) if err = db.Exec(sql).Error; err != nil { log.Printf("error sql: %s", sql) diff --git a/app/admin/models/model.go b/app/admin/models/model.go deleted file mode 100644 index 4a1c439b6..000000000 --- a/app/admin/models/model.go +++ /dev/null @@ -1,11 +0,0 @@ -package models - -import ( - "time" -) - -type BaseModel struct { - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - DeletedAt *time.Time `json:"deletedAt"` -} diff --git a/app/admin/models/sys_api.go b/app/admin/models/sys_api.go index af8c41add..0b78e4942 100644 --- a/app/admin/models/sys_api.go +++ b/app/admin/models/sys_api.go @@ -27,7 +27,7 @@ type SysApi struct { models.ControlBy } -func (SysApi) TableName() string { +func (*SysApi) TableName() string { return "sys_api" } @@ -44,14 +44,14 @@ func SaveSysApi(message storage.Messager) (err error) { var rb []byte rb, err = json.Marshal(message.GetValues()) if err != nil { - fmt.Errorf("json Marshal error, %s", err.Error()) + err = fmt.Errorf("json Marshal error, %v", err.Error()) return err } var l runtime.Routers err = json.Unmarshal(rb, &l) if err != nil { - fmt.Errorf("json Unmarshal error, %s", err.Error()) + err = fmt.Errorf("json Unmarshal error, %s", err.Error()) return err } dbList := sdk.Runtime.GetDb() diff --git a/app/admin/models/sys_config.go b/app/admin/models/sys_config.go index 8bd07275f..2024bbb58 100644 --- a/app/admin/models/sys_config.go +++ b/app/admin/models/sys_config.go @@ -10,13 +10,13 @@ type SysConfig struct { ConfigKey string `json:"configKey" gorm:"size:128;comment:ConfigKey"` // ConfigValue string `json:"configValue" gorm:"size:255;comment:ConfigValue"` // ConfigType string `json:"configType" gorm:"size:64;comment:ConfigType"` - IsFrontend int `json:"isFrontend" gorm:"size:64;comment:是否前台"` // + IsFrontend string `json:"isFrontend" gorm:"size:64;comment:是否前台"` // Remark string `json:"remark" gorm:"size:128;comment:Remark"` // models.ControlBy models.ModelTime } -func (SysConfig) TableName() string { +func (*SysConfig) TableName() string { return "sys_config" } diff --git a/app/admin/models/sys_dept.go b/app/admin/models/sys_dept.go index cedac5e50..e4400de87 100644 --- a/app/admin/models/sys_dept.go +++ b/app/admin/models/sys_dept.go @@ -7,7 +7,7 @@ type SysDept struct { ParentId int `json:"parentId" gorm:""` //上级部门 DeptPath string `json:"deptPath" gorm:"size:255;"` // DeptName string `json:"deptName" gorm:"size:128;"` //部门名称 - Sort int `json:"sort" gorm:"size:4;"` //排序 + Sort int `json:"sort" gorm:"size:4;"` //排序 Leader string `json:"leader" gorm:"size:128;"` //负责人 Phone string `json:"phone" gorm:"size:11;"` //手机 Email string `json:"email" gorm:"size:64;"` //邮箱 @@ -19,7 +19,7 @@ type SysDept struct { Children []SysDept `json:"children" gorm:"-"` } -func (SysDept) TableName() string { +func (*SysDept) TableName() string { return "sys_dept" } diff --git a/app/admin/models/sys_dict_data.go b/app/admin/models/sys_dict_data.go index 015618530..15abf890e 100644 --- a/app/admin/models/sys_dict_data.go +++ b/app/admin/models/sys_dict_data.go @@ -20,7 +20,7 @@ type SysDictData struct { models.ModelTime } -func (SysDictData) TableName() string { +func (*SysDictData) TableName() string { return "sys_dict_data" } diff --git a/app/admin/models/sys_dict_type.go b/app/admin/models/sys_dict_type.go index 70f710d48..49f7ebe2e 100644 --- a/app/admin/models/sys_dict_type.go +++ b/app/admin/models/sys_dict_type.go @@ -14,7 +14,7 @@ type SysDictType struct { models.ModelTime } -func (SysDictType) TableName() string { +func (*SysDictType) TableName() string { return "sys_dict_type" } diff --git a/app/admin/models/sys_login_log.go b/app/admin/models/sys_login_log.go index 263f5825b..98873e895 100644 --- a/app/admin/models/sys_login_log.go +++ b/app/admin/models/sys_login_log.go @@ -29,7 +29,7 @@ type SysLoginLog struct { models.ControlBy } -func (SysLoginLog) TableName() string { +func (*SysLoginLog) TableName() string { return "sys_login_log" } diff --git a/app/admin/models/sys_menu.go b/app/admin/models/sys_menu.go index cd520e35c..ea7e66931 100644 --- a/app/admin/models/sys_menu.go +++ b/app/admin/models/sys_menu.go @@ -30,7 +30,13 @@ type SysMenu struct { models.ModelTime } -func (SysMenu) TableName() string { +type SysMenuSlice []SysMenu + +func (x SysMenuSlice) Len() int { return len(x) } +func (x SysMenuSlice) Less(i, j int) bool { return x[i].Sort < x[j].Sort } +func (x SysMenuSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + +func (*SysMenu) TableName() string { return "sys_menu" } @@ -41,4 +47,4 @@ func (e *SysMenu) Generate() models.ActiveRecord { func (e *SysMenu) GetId() interface{} { return e.MenuId -} \ No newline at end of file +} diff --git a/app/admin/models/sys_opera_log.go b/app/admin/models/sys_opera_log.go index 31fb63500..e29a54dcc 100644 --- a/app/admin/models/sys_opera_log.go +++ b/app/admin/models/sys_opera_log.go @@ -18,15 +18,15 @@ type SysOperaLog struct { BusinessType string `json:"businessType" gorm:"size:128;comment:操作类型"` BusinessTypes string `json:"businessTypes" gorm:"size:128;comment:BusinessTypes"` Method string `json:"method" gorm:"size:128;comment:函数"` - RequestMethod string `json:"requestMethod" gorm:"size:128;comment:请求方式"` + RequestMethod string `json:"requestMethod" gorm:"size:128;comment:请求方式 GET POST PUT DELETE"` OperatorType string `json:"operatorType" gorm:"size:128;comment:操作类型"` OperName string `json:"operName" gorm:"size:128;comment:操作者"` DeptName string `json:"deptName" gorm:"size:128;comment:部门名称"` OperUrl string `json:"operUrl" gorm:"size:255;comment:访问地址"` OperIp string `json:"operIp" gorm:"size:128;comment:客户端ip"` OperLocation string `json:"operLocation" gorm:"size:128;comment:访问位置"` - OperParam string `json:"operParam" gorm:"size:255;comment:请求参数"` - Status string `json:"status" gorm:"size:4;comment:操作状态"` + OperParam string `json:"operParam" gorm:"text;comment:请求参数"` + Status string `json:"status" gorm:"size:4;comment:操作状态 1:正常 2:关闭"` OperTime time.Time `json:"operTime" gorm:"comment:操作时间"` JsonResult string `json:"jsonResult" gorm:"size:255;comment:返回数据"` Remark string `json:"remark" gorm:"size:255;comment:备注"` @@ -37,7 +37,7 @@ type SysOperaLog struct { models.ControlBy } -func (SysOperaLog) TableName() string { +func (*SysOperaLog) TableName() string { return "sys_opera_log" } diff --git a/app/admin/models/sys_post.go b/app/admin/models/sys_post.go index c51f8906e..705318aa5 100644 --- a/app/admin/models/sys_post.go +++ b/app/admin/models/sys_post.go @@ -16,7 +16,7 @@ type SysPost struct { Params string `gorm:"-" json:"params"` } -func (SysPost) TableName() string { +func (*SysPost) TableName() string { return "sys_post" } @@ -27,4 +27,4 @@ func (e *SysPost) Generate() models.ActiveRecord { func (e *SysPost) GetId() interface{} { return e.PostId -} \ No newline at end of file +} diff --git a/app/admin/models/sys_role.go b/app/admin/models/sys_role.go index 766af2091..d23fb17f1 100644 --- a/app/admin/models/sys_role.go +++ b/app/admin/models/sys_role.go @@ -3,25 +3,25 @@ package models import "go-admin/common/models" type SysRole struct { - RoleId int `json:"roleId" gorm:"primaryKey;autoIncrement"` // 角色编码 - RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称 - Status string `json:"status" gorm:"size:4;"` // - RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码 - RoleSort int `json:"roleSort" gorm:""` //角色排序 - Flag string `json:"flag" gorm:"size:128;"` // - Remark string `json:"remark" gorm:"size:255;"` //备注 - Admin bool `json:"admin" gorm:"size:4;"` - DataScope string `json:"dataScope" gorm:"size:128;"` - Params string `json:"params" gorm:"-"` - MenuIds []int `json:"menuIds" gorm:"-"` - DeptIds []int `json:"deptIds" gorm:"-"` - SysDept []SysDept `json:"sysDept" gorm:"many2many:sys_role_dept;foreignKey:RoleId;joinForeignKey:role_id;references:DeptId;joinReferences:dept_id;"` + RoleId int `json:"roleId" gorm:"primaryKey;autoIncrement"` // 角色编码 + RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称 + Status string `json:"status" gorm:"size:4;"` // 状态 1禁用 2正常 + RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码 + RoleSort int `json:"roleSort" gorm:""` //角色排序 + Flag string `json:"flag" gorm:"size:128;"` // + Remark string `json:"remark" gorm:"size:255;"` //备注 + Admin bool `json:"admin" gorm:"size:4;"` + DataScope string `json:"dataScope" gorm:"size:128;"` + Params string `json:"params" gorm:"-"` + MenuIds []int `json:"menuIds" gorm:"-"` + DeptIds []int `json:"deptIds" gorm:"-"` + SysDept []SysDept `json:"sysDept" gorm:"many2many:sys_role_dept;foreignKey:RoleId;joinForeignKey:role_id;references:DeptId;joinReferences:dept_id;"` SysMenu *[]SysMenu `json:"sysMenu" gorm:"many2many:sys_role_menu;foreignKey:RoleId;joinForeignKey:role_id;references:MenuId;joinReferences:menu_id;"` models.ControlBy models.ModelTime } -func (SysRole) TableName() string { +func (*SysRole) TableName() string { return "sys_role" } @@ -32,4 +32,4 @@ func (e *SysRole) Generate() models.ActiveRecord { func (e *SysRole) GetId() interface{} { return e.RoleId -} \ No newline at end of file +} diff --git a/app/admin/models/sys_user.go b/app/admin/models/sys_user.go index e239b29ff..eab2cadf3 100644 --- a/app/admin/models/sys_user.go +++ b/app/admin/models/sys_user.go @@ -29,7 +29,7 @@ type SysUser struct { models.ModelTime } -func (SysUser) TableName() string { +func (*SysUser) TableName() string { return "sys_user" } @@ -42,7 +42,7 @@ func (e *SysUser) GetId() interface{} { return e.UserId } -//加密 +// Encrypt 加密 func (e *SysUser) Encrypt() (err error) { if e.Password == "" { return diff --git a/app/admin/router/router.go b/app/admin/router/router.go index c226eeea0..d2c458173 100644 --- a/app/admin/router/router.go +++ b/app/admin/router/router.go @@ -12,7 +12,6 @@ var ( routerCheckRole = make([]func(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware), 0) ) -// 路由示例 func InitExamplesRouter(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware) *gin.Engine { // 无需认证的路由 @@ -39,4 +38,4 @@ func examplesCheckRoleRouter(r *gin.Engine, authMiddleware *jwtauth.GinJWTMiddle for _, f := range routerCheckRole { f(v1, authMiddleware) } -} \ No newline at end of file +} diff --git a/app/admin/router/sys_router.go b/app/admin/router/sys_router.go index 944f89597..b713e4b0d 100644 --- a/app/admin/router/sys_router.go +++ b/app/admin/router/sys_router.go @@ -1,19 +1,21 @@ package router import ( - "github.com/go-admin-team/go-admin-core/sdk/config" "go-admin/app/admin/apis" "mime" + "github.com/go-admin-team/go-admin-core/sdk/config" + "github.com/gin-gonic/gin" jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" "github.com/go-admin-team/go-admin-core/sdk/pkg/ws" ginSwagger "github.com/swaggo/gin-swagger" - "github.com/swaggo/gin-swagger/swaggerFiles" + + swaggerfiles "github.com/swaggo/files" "go-admin/common/middleware" "go-admin/common/middleware/handler" - _ "go-admin/docs" + _ "go-admin/docs/admin" ) func InitSysRouter(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware) *gin.RouterGroup { @@ -54,11 +56,11 @@ func sysStaticFileRouter(r *gin.RouterGroup) { } func sysSwaggerRouter(r *gin.RouterGroup) { - r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) + r.GET("/swagger/admin/*any", ginSwagger.WrapHandler(swaggerfiles.NewHandler(), ginSwagger.InstanceName("admin"))) } func sysCheckRoleRouterInit(r *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { - wss:=r.Group("").Use(authMiddleware.MiddlewareFunc()) + wss := r.Group("").Use(authMiddleware.MiddlewareFunc()) { wss.GET("/ws/:id/:channel", ws.WebsocketManager.WsClient) wss.GET("/wslogout/:id/:channel", ws.WebsocketManager.UnWsClient) diff --git a/app/admin/service/dto/sys_api.go b/app/admin/service/dto/sys_api.go index 5e53d071b..d26034eec 100644 --- a/app/admin/service/dto/sys_api.go +++ b/app/admin/service/dto/sys_api.go @@ -11,8 +11,9 @@ type SysApiGetPageReq struct { dto.Pagination `search:"-"` Title string `form:"title" search:"type:contains;column:title;table:sys_api" comment:"标题"` Path string `form:"path" search:"type:contains;column:path;table:sys_api" comment:"地址"` - Action string `form:"action" search:"type:exact;column:action;table:sys_api" comment:"类型"` + Action string `form:"action" search:"type:exact;column:action;table:sys_api" comment:"请求方式"` ParentId string `form:"parentId" search:"type:exact;column:parent_id;table:sys_api" comment:"按钮id"` + Type string `form:"type" search:"-" comment:"类型"` SysApiOrder } @@ -84,7 +85,6 @@ func (s *SysApiGetReq) GetId() interface{} { return s.Id } - // SysApiDeleteReq 功能删除请求参数 type SysApiDeleteReq struct { Ids []int `json:"ids"` @@ -93,4 +93,3 @@ type SysApiDeleteReq struct { func (s *SysApiDeleteReq) GetId() interface{} { return s.Ids } - diff --git a/app/admin/service/dto/sys_config.go b/app/admin/service/dto/sys_config.go index cbc03656f..06f7467fe 100644 --- a/app/admin/service/dto/sys_config.go +++ b/app/admin/service/dto/sys_config.go @@ -12,7 +12,7 @@ type SysConfigGetPageReq struct { ConfigName string `form:"configName" search:"type:contains;column:config_name;table:sys_config"` ConfigKey string `form:"configKey" search:"type:contains;column:config_key;table:sys_config"` ConfigType string `form:"configType" search:"type:exact;column:config_type;table:sys_config"` - IsFrontend int `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config"` + IsFrontend string `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config"` SysConfigOrder } @@ -29,7 +29,7 @@ func (m *SysConfigGetPageReq) GetNeedSearch() interface{} { } type SysConfigGetToSysAppReq struct { - IsFrontend int `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config"` + IsFrontend string `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config"` } func (m *SysConfigGetToSysAppReq) GetNeedSearch() interface{} { @@ -43,7 +43,7 @@ type SysConfigControl struct { ConfigKey string `uri:"configKey" json:"configKey" comment:""` ConfigValue string `json:"configValue" comment:""` ConfigType string `json:"configType" comment:""` - IsFrontend int `json:"isFrontend"` + IsFrontend string `json:"isFrontend"` Remark string `json:"remark" comment:""` common.ControlBy } diff --git a/app/admin/service/dto/sys_opera_log.go b/app/admin/service/dto/sys_opera_log.go index f83f6061c..5df36eb6d 100644 --- a/app/admin/service/dto/sys_opera_log.go +++ b/app/admin/service/dto/sys_opera_log.go @@ -8,16 +8,21 @@ import ( common "go-admin/common/models" ) +const ( + OperaStatusEnabel = "1" // 状态-正常 + OperaStatusDisable = "2" // 状态-关闭 +) + type SysOperaLogGetPageReq struct { dto.Pagination `search:"-"` Title string `form:"title" search:"type:contains;column:title;table:sys_opera_log" comment:"操作模块"` Method string `form:"method" search:"type:contains;column:method;table:sys_opera_log" comment:"函数"` - RequestMethod string `form:"requestMethod" search:"type:contains;column:request_method;table:sys_opera_log" comment:"请求方式"` + RequestMethod string `form:"requestMethod" search:"type:contains;column:request_method;table:sys_opera_log" comment:"请求方式: GET POST PUT DELETE"` OperUrl string `form:"operUrl" search:"type:contains;column:oper_url;table:sys_opera_log" comment:"访问地址"` OperIp string `form:"operIp" search:"type:exact;column:oper_ip;table:sys_opera_log" comment:"客户端ip"` - Status int `form:"status" search:"type:exact;column:status;table:sys_opera_log" comment:"状态"` - BeginTime string `form:"beginTime" search:"type:gte;column:ctime;table:sys_opera_log" comment:"创建时间"` - EndTime string `form:"endTime" search:"type:lte;column:ctime;table:sys_opera_log" comment:"创建时间"` + Status int `form:"status" search:"type:exact;column:status;table:sys_opera_log" comment:"状态 1:正常 2:关闭"` + BeginTime string `form:"beginTime" search:"type:gte;column:created_at;table:sys_opera_log" comment:"创建时间"` + EndTime string `form:"endTime" search:"type:lte;column:created_at;table:sys_opera_log" comment:"更新时间"` SysOperaLogOrder } diff --git a/app/admin/service/dto/sys_role.go b/app/admin/service/dto/sys_role.go index 0fb31f5d5..789b85e14 100644 --- a/app/admin/service/dto/sys_role.go +++ b/app/admin/service/dto/sys_role.go @@ -36,7 +36,7 @@ func (m *SysRoleGetPageReq) GetNeedSearch() interface{} { type SysRoleInsertReq struct { RoleId int `uri:"id" comment:"角色编码"` // 角色编码 RoleName string `form:"roleName" comment:"角色名称"` // 角色名称 - Status string `form:"status" comment:"状态"` // 状态 + Status string `form:"status" comment:"状态"` // 状态 1禁用 2正常 RoleKey string `form:"roleKey" comment:"角色代码"` // 角色代码 RoleSort int `form:"roleSort" comment:"角色排序"` // 角色排序 Flag string `form:"flag" comment:"标记"` // 标记 diff --git a/app/admin/service/dto/sys_user.go b/app/admin/service/dto/sys_user.go index 511234300..b1de09461 100644 --- a/app/admin/service/dto/sys_user.go +++ b/app/admin/service/dto/sys_user.go @@ -38,8 +38,8 @@ func (m *SysUserGetPageReq) GetNeedSearch() interface{} { } type ResetSysUserPwdReq struct { - UserId int `json:"userId" comment:"用户ID" binding:"required"` // 用户ID - Password string `json:"password" comment:"密码" binding:"required"` + UserId int `json:"userId" comment:"用户ID" vd:"$>0"` // 用户ID + Password string `json:"password" comment:"密码" vd:"len($)>0"` common.ControlBy } @@ -121,6 +121,7 @@ func (s *SysUserInsertReq) Generate(model *models.SysUser) { model.PostId = s.PostId model.Remark = s.Remark model.Status = s.Status + model.CreateBy = s.CreateBy } func (s *SysUserInsertReq) GetId() interface{} { diff --git a/app/admin/service/sys_api.go b/app/admin/service/sys_api.go index 1818a8877..b098022f7 100644 --- a/app/admin/service/sys_api.go +++ b/app/admin/service/sys_api.go @@ -6,12 +6,11 @@ import ( "github.com/go-admin-team/go-admin-core/sdk/runtime" "github.com/go-admin-team/go-admin-core/sdk/service" - "gorm.io/gorm" - "go-admin/app/admin/models" "go-admin/app/admin/service/dto" "go-admin/common/actions" cDto "go-admin/common/dto" + "go-admin/common/global" ) type SysApi struct { @@ -23,13 +22,25 @@ func (e *SysApi) GetPage(c *dto.SysApiGetPageReq, p *actions.DataPermission, lis var err error var data models.SysApi - err = e.Orm.Debug().Model(&data). + orm := e.Orm.Debug().Model(&data). Scopes( cDto.MakeCondition(c.GetNeedSearch()), cDto.Paginate(c.GetPageSize(), c.GetPageIndex()), actions.Permission(data.TableName(), p), - ). - Find(list).Limit(-1).Offset(-1). + ) + if c.Type != "" { + qType := c.Type + if qType == "暂无" { + qType = "" + } + if global.Driver == "postgres" { + orm = orm.Where("type = ?", qType) + } else { + orm = orm.Where("`type` = ?", qType) + } + + } + err = orm.Find(list).Limit(-1).Offset(-1). Count(count).Error if err != nil { e.Log.Errorf("Service GetSysApiPage error:%s", err) @@ -45,15 +56,15 @@ func (e *SysApi) Get(d *dto.SysApiGetReq, p *actions.DataPermission, model *mode Scopes( actions.Permission(data.TableName(), p), ). - First(model, d.GetId()).Error - if err != nil && errors.Is(err, gorm.ErrRecordNotFound) { - err = errors.New("查看对象不存在或无权查看") - e.Log.Errorf("Service GetSysApi error:%s", err) + FirstOrInit(model, d.GetId()).Error + if err != nil { + e.Log.Errorf("db error:%s", err) _ = e.AddError(err) return e } - if err != nil { - e.Log.Errorf("db error:%s", err) + if model.Id == 0 { + err = errors.New("查看对象不存在或无权查看") + e.Log.Errorf("Service GetSysApi error: %s", err) _ = e.AddError(err) return e } diff --git a/app/admin/service/sys_config.go b/app/admin/service/sys_config.go index a7a99f627..016177f4b 100644 --- a/app/admin/service/sys_config.go +++ b/app/admin/service/sys_config.go @@ -8,7 +8,6 @@ import ( cDto "go-admin/common/dto" "github.com/go-admin-team/go-admin-core/sdk/service" - "gorm.io/gorm" ) type SysConfig struct { @@ -33,14 +32,18 @@ func (e *SysConfig) GetPage(c *dto.SysConfigGetPageReq, list *[]models.SysConfig // Get 获取SysConfig对象 func (e *SysConfig) Get(d *dto.SysConfigGetReq, model *models.SysConfig) error { - err := e.Orm.First(model, d.GetId()).Error - if err != nil && errors.Is(err, gorm.ErrRecordNotFound) { - err = errors.New("查看对象不存在或无权查看") - e.Log.Errorf("Service GetSysConfigPage error:%s", err) + err := e.Orm. + FirstOrInit(model, d.GetId()). + Error + if err != nil { + e.Log.Errorf("db error:%s", err) + _ = e.AddError(err) return err } - if err != nil { - e.Log.Errorf("Service GetSysConfig error:%s", err) + if model.Id == 0 { + err = errors.New("查看对象不存在或无权查看") + e.Log.Errorf("Service GetSysApi error: %s", err) + _ = e.AddError(err) return err } return nil @@ -142,8 +145,7 @@ func (e *SysConfig) Remove(d *dto.SysConfigDeleteReq) error { var data models.SysConfig db := e.Orm.Delete(&data, d.Ids) - if db.Error != nil { - err = db.Error + if err = db.Error; err != nil { e.Log.Errorf("Service RemoveSysConfig error:%s", err) return err } @@ -168,8 +170,7 @@ func (e *SysConfig) GetWithKey(c *dto.SysConfigByKeyReq, resp *dto.GetSysConfigB } func (e *SysConfig) GetWithKeyList(c *dto.SysConfigGetToSysAppReq, list *[]models.SysConfig) error { - var err error - err = e.Orm. + err := e.Orm. Scopes( cDto.MakeCondition(c.GetNeedSearch()), ). diff --git a/app/admin/service/sys_dept.go b/app/admin/service/sys_dept.go index 80fe0a77b..9e11f3894 100644 --- a/app/admin/service/sys_dept.go +++ b/app/admin/service/sys_dept.go @@ -7,8 +7,6 @@ import ( log "github.com/go-admin-team/go-admin-core/logger" "github.com/go-admin-team/go-admin-core/sdk/pkg" - "gorm.io/gorm" - "go-admin/app/admin/service/dto" cDto "go-admin/common/dto" @@ -41,16 +39,18 @@ func (e *SysDept) Get(d *dto.SysDeptGetReq, model *models.SysDept) error { var err error var data models.SysDept - db := e.Orm.Model(&data). - First(model, d.GetId()) - err = db.Error - if err != nil && errors.Is(err, gorm.ErrRecordNotFound) { - err = errors.New("查看对象不存在或无权查看") + err = e.Orm.Model(&data). + FirstOrInit(model, d.GetId()). + Error + if err != nil { e.Log.Errorf("db error:%s", err) + _ = e.AddError(err) return err } - if db.Error != nil { - e.Log.Errorf("db error:%s", err) + if model.DeptId == 0 { + err = errors.New("查看对象不存在或无权查看") + e.Log.Errorf("Service GetSysApi error: %s", err) + _ = e.AddError(err) return err } return nil @@ -84,7 +84,7 @@ func (e *SysDept) Insert(c *dto.SysDeptInsertReq) error { } var mp = map[string]string{} mp["dept_path"] = deptPath - if err := tx.Model(&data).Update("dept_path", deptPath).Error; err != nil { + if err = tx.Model(&data).Update("dept_path", deptPath).Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -116,7 +116,7 @@ func (e *SysDept) Update(c *dto.SysDeptUpdateReq) error { } model.DeptPath = deptPath db := tx.Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("UpdateSysDept error:%s", err) return err } @@ -132,8 +132,7 @@ func (e *SysDept) Remove(d *dto.SysDeptDeleteReq) error { var data models.SysDept db := e.Orm.Model(&data).Delete(&data, d.GetId()) - if db.Error != nil { - err = db.Error + if err = db.Error; err != nil { e.Log.Errorf("Delete error: %s", err) return err } @@ -184,16 +183,16 @@ func (e *SysDept) SetDeptTree(c *dto.SysDeptGetPageReq) (m []dto.DeptLabel, err // Call 递归构造组织数据 func deptTreeCall(deptList *[]models.SysDept, dept dto.DeptLabel) dto.DeptLabel { list := *deptList - min := make([]dto.DeptLabel, 0) + childrenList := make([]dto.DeptLabel, 0) for j := 0; j < len(list); j++ { if dept.Id != list[j].ParentId { continue } mi := dto.DeptLabel{Id: list[j].DeptId, Label: list[j].DeptName, Children: []dto.DeptLabel{}} ms := deptTreeCall(deptList, mi) - min = append(min, ms) + childrenList = append(childrenList, ms) } - dept.Children = min + dept.Children = childrenList return dept } @@ -213,7 +212,7 @@ func (e *SysDept) SetDeptPage(c *dto.SysDeptGetPageReq) (m []models.SysDept, err func (e *SysDept) deptPageCall(deptlist *[]models.SysDept, menu models.SysDept) models.SysDept { list := *deptlist - min := make([]models.SysDept, 0) + childrenList := make([]models.SysDept, 0) for j := 0; j < len(list); j++ { if menu.DeptId != list[j].ParentId { continue @@ -231,13 +230,13 @@ func (e *SysDept) deptPageCall(deptlist *[]models.SysDept, menu models.SysDept) mi.CreatedAt = list[j].CreatedAt mi.Children = []models.SysDept{} ms := e.deptPageCall(deptlist, mi) - min = append(min, ms) + childrenList = append(childrenList, ms) } - menu.Children = min + menu.Children = childrenList return menu } -// GetRoleDeptId 获取角色的部门ID集合 +// GetWithRoleId 获取角色的部门ID集合 func (e *SysDept) GetWithRoleId(roleId int) ([]int, error) { deptIds := make([]int, 0) deptList := make([]dto.DeptIdList, 0) @@ -281,15 +280,15 @@ func (e *SysDept) SetDeptLabel() (m []dto.DeptLabel, err error) { func deptLabelCall(deptList *[]models.SysDept, dept dto.DeptLabel) dto.DeptLabel { list := *deptList var mi dto.DeptLabel - min := make([]dto.DeptLabel, 0) + childrenList := make([]dto.DeptLabel, 0) for j := 0; j < len(list); j++ { if dept.Id != list[j].ParentId { continue } mi = dto.DeptLabel{Id: list[j].DeptId, Label: list[j].DeptName, Children: []dto.DeptLabel{}} ms := deptLabelCall(deptList, mi) - min = append(min, ms) + childrenList = append(childrenList, ms) } - dept.Children = min + dept.Children = childrenList return dept } diff --git a/app/admin/service/sys_dict_data.go b/app/admin/service/sys_dict_data.go index 28eedbadd..7b2f6dc02 100644 --- a/app/admin/service/sys_dict_data.go +++ b/app/admin/service/sys_dict_data.go @@ -47,7 +47,7 @@ func (e *SysDictData) Get(d *dto.SysDictDataGetReq, model *models.SysDictData) e e.Log.Errorf("db error: %s", err) return err } - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error: %s", err) return err } @@ -91,8 +91,7 @@ func (e *SysDictData) Remove(c *dto.SysDictDataDeleteReq) error { var data models.SysDictData db := e.Orm.Delete(&data, c.GetId()) - if db.Error != nil { - err = db.Error + if err = db.Error; err != nil { e.Log.Errorf("Delete error: %s", err) return err } diff --git a/app/admin/service/sys_dict_type.go b/app/admin/service/sys_dict_type.go index 888bccb7a..bc45fe24c 100644 --- a/app/admin/service/sys_dict_type.go +++ b/app/admin/service/sys_dict_type.go @@ -3,6 +3,7 @@ package service import ( "errors" "fmt" + "github.com/go-admin-team/go-admin-core/sdk/service" "gorm.io/gorm" @@ -45,7 +46,7 @@ func (e *SysDictType) Get(d *dto.SysDictTypeGetReq, model *models.SysDictType) e e.Log.Errorf("db error: %s", err) return err } - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error: %s", err) return err } @@ -60,7 +61,7 @@ func (e *SysDictType) Insert(c *dto.SysDictTypeInsertReq) error { var count int64 e.Orm.Model(&data).Where("dict_type = ?", data.DictType).Count(&count) if count > 0 { - return errors.New(fmt.Sprintf("当前字典类型[%s]已经存在!", data.DictType)) + return fmt.Errorf("当前字典类型[%s]已经存在!", data.DictType) } err = e.Orm.Create(&data).Error if err != nil { @@ -77,7 +78,7 @@ func (e *SysDictType) Update(c *dto.SysDictTypeUpdateReq) error { e.Orm.First(&model, c.GetId()) c.Generate(&model) db := e.Orm.Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error: %s", err) return err } @@ -94,8 +95,7 @@ func (e *SysDictType) Remove(d *dto.SysDictTypeDeleteReq) error { var data models.SysDictType db := e.Orm.Delete(&data, d.GetId()) - if db.Error != nil { - err = db.Error + if err = db.Error; err != nil { e.Log.Errorf("Delete error: %s", err) return err } diff --git a/app/admin/service/sys_login_log.go b/app/admin/service/sys_login_log.go index 04db57d79..3e9f9b8b2 100644 --- a/app/admin/service/sys_login_log.go +++ b/app/admin/service/sys_login_log.go @@ -44,7 +44,7 @@ func (e *SysLoginLog) Get(d *dto.SysLoginLogGetReq, model *models.SysLoginLog) e e.Log.Errorf("db error:%s", err) return err } - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -57,8 +57,7 @@ func (e *SysLoginLog) Remove(c *dto.SysLoginLogDeleteReq) error { var data models.SysLoginLog db := e.Orm.Delete(&data, c.GetId()) - if db.Error != nil { - err = db.Error + if err = db.Error; err != nil { e.Log.Errorf("Delete error: %s", err) return err } diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index 9d3ed7ca9..7f2b48fa0 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -1,8 +1,12 @@ package service import ( - "errors" + "fmt" + "sort" + "strings" + "github.com/go-admin-team/go-admin-core/sdk/pkg" + "github.com/pkg/errors" "gorm.io/gorm" "go-admin/app/admin/models" @@ -86,21 +90,46 @@ func (e *SysMenu) Insert(c *dto.SysMenuInsertReq) *SysMenu { var err error var data models.SysMenu c.Generate(&data) - err = e.Orm.Create(&data).Error + tx := e.Orm.Debug().Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + err = tx.Where("id in ?", c.Apis).Find(&data.SysApi).Error if err != nil { + tx.Rollback() + e.Log.Errorf("db error:%s", err) + _ = e.AddError(err) + } + err = tx.Create(&data).Error + if err != nil { + tx.Rollback() e.Log.Errorf("db error:%s", err) _ = e.AddError(err) } c.MenuId = data.MenuId + err = e.initPaths(tx, &data) + if err != nil { + tx.Rollback() + e.Log.Errorf("db error:%s", err) + _ = e.AddError(err) + } + tx.Commit() return e } -func (e *SysMenu) initPaths(menu *models.SysMenu) error { +func (e *SysMenu) initPaths(tx *gorm.DB, menu *models.SysMenu) error { var err error var data models.SysMenu parentMenu := new(models.SysMenu) if menu.ParentId != 0 { - e.Orm.Model(&data).First(parentMenu, menu.ParentId) + err = tx.Model(&data).First(parentMenu, menu.ParentId).Error + if err != nil { + return err + } if parentMenu.Paths == "" { err = errors.New("父级paths异常,请尝试对当前节点父级菜单进行更新操作!") return err @@ -109,7 +138,7 @@ func (e *SysMenu) initPaths(menu *models.SysMenu) error { } else { menu.Paths = "/0/" + pkg.IntToString(menu.MenuId) } - e.Orm.Model(&data).Where("menu_id = ?", menu.MenuId).Update("paths", menu.Paths) + err = tx.Model(&data).Where("menu_id = ?", menu.MenuId).Update("paths", menu.Paths).Error return err } @@ -127,6 +156,7 @@ func (e *SysMenu) Update(c *dto.SysMenuUpdateReq) *SysMenu { var alist = make([]models.SysApi, 0) var model = models.SysMenu{} tx.Preload("SysApi").First(&model, c.GetId()) + oldPath := model.Paths tx.Where("id in ?", c.Apis).Find(&alist) err = tx.Model(&model).Association("SysApi").Delete(model.SysApi) if err != nil { @@ -137,7 +167,7 @@ func (e *SysMenu) Update(c *dto.SysMenuUpdateReq) *SysMenu { c.Generate(&model) model.SysApi = alist db := tx.Model(&model).Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) _ = e.AddError(err) return e @@ -146,6 +176,12 @@ func (e *SysMenu) Update(c *dto.SysMenuUpdateReq) *SysMenu { _ = e.AddError(errors.New("无权更新该数据")) return e } + var menuList []models.SysMenu + tx.Where("paths like ?", oldPath+"%").Find(&menuList) + for _, v := range menuList { + v.Paths = strings.Replace(v.Paths, oldPath, model.Paths, 1) + tx.Model(&v).Update("paths", v.Paths) + } return e } @@ -155,8 +191,7 @@ func (e *SysMenu) Remove(d *dto.SysMenuDeleteReq) *SysMenu { var data models.SysMenu db := e.Orm.Model(&data).Delete(&data, d.Ids) - if db.Error != nil { - err = db.Error + if err = db.Error; err != nil { e.Log.Errorf("Delete error: %s", err) _ = e.AddError(err) } @@ -306,6 +341,40 @@ func menuCall(menuList *[]models.SysMenu, menu models.SysMenu) models.SysMenu { return menu } +func menuDistinct(menuList []models.SysMenu) (result []models.SysMenu) { + distinctMap := make(map[int]struct{}, len(menuList)) + for _, menu := range menuList { + if _, ok := distinctMap[menu.MenuId]; !ok { + distinctMap[menu.MenuId] = struct{}{} + result = append(result, menu) + } + } + return result +} + +func recursiveSetMenu(orm *gorm.DB, mIds []int, menus *[]models.SysMenu) error { + if len(mIds) == 0 || menus == nil { + return nil + } + var subMenus []models.SysMenu + err := orm.Where(fmt.Sprintf(" menu_type in ('%s', '%s', '%s') and menu_id in ?", + cModels.Directory, cModels.Menu, cModels.Button), mIds).Order("sort").Find(&subMenus).Error + if err != nil { + return err + } + + subIds := make([]int, 0) + for _, menu := range subMenus { + if menu.ParentId != 0 { + subIds = append(subIds, menu.ParentId) + } + if menu.MenuType != cModels.Button { + *menus = append(*menus, menu) + } + } + return recursiveSetMenu(orm, subIds, menus) +} + // SetMenuRole 获取左侧菜单树使用 func (e *SysMenu) SetMenuRole(roleName string) (m []models.SysMenu, err error) { menus, err := e.getByRoleName(roleName) @@ -321,40 +390,33 @@ func (e *SysMenu) SetMenuRole(roleName string) (m []models.SysMenu, err error) { } func (e *SysMenu) getByRoleName(roleName string) ([]models.SysMenu, error) { - var MenuList []models.SysMenu var role models.SysRole var err error + data := make([]models.SysMenu, 0) if roleName == "admin" { - var data []models.SysMenu - err = e.Orm.Where(" menu_type in ('M','C')").Order("sort").Find(&data).Error - MenuList = data + err = e.Orm.Where(" menu_type in ('M','C') and deleted_at is null"). + Order("sort"). + Find(&data). + Error + err = errors.WithStack(err) } else { role.RoleKey = roleName - err = e.Orm.Debug().Model(&role).Where("role_key = ? ", roleName).Preload("SysMenu", func(db *gorm.DB) *gorm.DB { - return db.Where(" menu_type in ('C')").Order("sort") - }).Find(&role).Error + err = e.Orm.Model(&role).Where("role_key = ? ", roleName).Preload("SysMenu").First(&role).Error + if role.SysMenu != nil { - MenuList = *role.SysMenu - } - mIds := make([]int, 0) - for _, menu := range MenuList { - if menu.ParentId != 0 { - mIds = append(mIds, menu.ParentId) + mIds := make([]int, 0) + for _, menu := range *role.SysMenu { + mIds = append(mIds, menu.MenuId) } - } - var data []models.SysMenu - err = e.Orm.Where(" menu_type in ('M') and menu_id in ?", mIds).Order("sort").Find(&data).Error - if err != nil { - return nil, err - } - for _, datum := range data { - MenuList = append(MenuList, datum) + if err := recursiveSetMenu(e.Orm, mIds, &data); err != nil { + return nil, err + } + + data = menuDistinct(data) } } - if err != nil { - e.Log.Errorf("db error:%s", err) - } - return MenuList, err + sort.Sort(models.SysMenuSlice(data)) + return data, err } diff --git a/app/admin/service/sys_post.go b/app/admin/service/sys_post.go index 99f1213bc..04cc0c171 100644 --- a/app/admin/service/sys_post.go +++ b/app/admin/service/sys_post.go @@ -47,7 +47,7 @@ func (e *SysPost) Get(d *dto.SysPostGetReq, model *models.SysPost) error { e.Log.Errorf("db error:%s", err) return err } - if db.Error != nil { + if err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -75,7 +75,7 @@ func (e *SysPost) Update(c *dto.SysPostUpdateReq) error { c.Generate(&model) db := e.Orm.Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -92,8 +92,7 @@ func (e *SysPost) Remove(d *dto.SysPostDeleteReq) error { var data models.SysPost db := e.Orm.Model(&data).Delete(&data, d.GetId()) - if db.Error != nil { - err = db.Error + if err = db.Error; err != nil { e.Log.Errorf("Delete error: %s", err) return err } @@ -102,4 +101,4 @@ func (e *SysPost) Remove(d *dto.SysPostDeleteReq) error { return err } return nil -} \ No newline at end of file +} diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index 7f9d71b5a..83b2c4690 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -2,6 +2,8 @@ package service import ( "errors" + + "github.com/go-admin-team/go-admin-core/sdk/config" "gorm.io/gorm/clause" "github.com/casbin/casbin/v2" @@ -71,14 +73,29 @@ func (e *SysRole) Insert(c *dto.SysRoleInsertReq, cb *casbin.SyncedEnforcer) err } c.SysMenu = dataMenu c.Generate(&data) - tx := e.Orm.Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx = e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } + var count int64 + err = tx.Model(&data).Where("role_key = ?", c.RoleKey).Count(&count).Error + if err != nil { + e.Log.Errorf("db error:%s", err) + return err + } + + if count > 0 { + err = errors.New("roleKey已存在,需更换在提交!") + e.Log.Errorf("db error:%s", err) + return err + } err = tx.Create(&data).Error if err != nil { @@ -86,36 +103,44 @@ func (e *SysRole) Insert(c *dto.SysRoleInsertReq, cb *casbin.SyncedEnforcer) err return err } + mp := make(map[string]interface{}, 0) + polices := make([][]string, 0) for _, menu := range dataMenu { for _, api := range menu.SysApi { - _, err = cb.AddNamedPolicy("p", data.RoleKey, api.Path, api.Action) + if mp[data.RoleKey+"-"+api.Path+"-"+api.Action] != "" { + mp[data.RoleKey+"-"+api.Path+"-"+api.Action] = "" + polices = append(polices, []string{data.RoleKey, api.Path, api.Action}) + } } } - _ = cb.SavePolicy() - //if len(c.MenuIds) > 0 { - // s := SysRoleMenu{} - // s.Orm = e.Orm - // s.Log = e.Log - // err = s.ReloadRule(tx, c.RoleId, c.MenuIds) - // if err != nil { - // e.Log.Errorf("reload casbin rule error, %", err.Error()) - // return err - // } - //} + + if len(polices) <= 0 { + return nil + } + + // 写入 sys_casbin_rule 权限表里 当前角色数据的记录 + _, err = cb.AddNamedPolicies("p", polices) + if err != nil { + return err + } + return nil } // Update 修改SysRole对象 func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) error { var err error - tx := e.Orm.Debug().Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx = e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } var model = models.SysRole{} var mlist = make([]models.SysMenu, 0) tx.Preload("SysMenu").First(&model, c.GetId()) @@ -127,9 +152,10 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err } c.Generate(&model) model.SysMenu = &mlist + // 更新关联的数据,使用 FullSaveAssociations 模式 db := tx.Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -137,43 +163,65 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err return errors.New("无权更新该数据") } + // 清除 sys_casbin_rule 权限表里 当前角色的所有记录 _, err = cb.RemoveFilteredPolicy(0, model.RoleKey) if err != nil { e.Log.Errorf("delete policy error:%s", err) return err } - + mp := make(map[string]interface{}, 0) + polices := make([][]string, 0) for _, menu := range mlist { for _, api := range menu.SysApi { - _, err = cb.AddNamedPolicy("p", model.RoleKey, api.Path, api.Action) + if mp[model.RoleKey+"-"+api.Path+"-"+api.Action] != "" { + mp[model.RoleKey+"-"+api.Path+"-"+api.Action] = "" + //_, err = cb.AddNamedPolicy("p", model.RoleKey, api.Path, api.Action) + polices = append(polices, []string{model.RoleKey, api.Path, api.Action}) + } } } - _ = cb.SavePolicy() + if len(polices) <= 0 { + return nil + } + + // 写入 sys_casbin_rule 权限表里 当前角色数据的记录 + _, err = cb.AddNamedPolicies("p", polices) + if err != nil { + return err + } return nil } // Remove 删除SysRole -func (e *SysRole) Remove(c *dto.SysRoleDeleteReq) error { +func (e *SysRole) Remove(c *dto.SysRoleDeleteReq, cb *casbin.SyncedEnforcer) error { var err error - tx := e.Orm.Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx = e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } var model = models.SysRole{} tx.Preload("SysMenu").Preload("SysDept").First(&model, c.GetId()) + //删除 SysRole 时,同时删除角色所有 关联其它表 记录 (SysMenu 和 SysMenu) db := tx.Select(clause.Associations).Delete(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } if db.RowsAffected == 0 { return errors.New("无权更新该数据") } + + // 清除 sys_casbin_rule 权限表里 当前角色的所有记录 + _, _ = cb.RemoveFilteredPolicy(0, model.RoleKey) + return nil } @@ -194,18 +242,22 @@ func (e *SysRole) GetRoleMenuId(roleId int) ([]int, error) { func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { var err error - tx := e.Orm.Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx = e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } var dlist = make([]models.SysDept, 0) var model = models.SysRole{} tx.Preload("SysDept").First(&model, c.RoleId) - tx.Where("id in ?", c.DeptIds).Find(&dlist) + tx.Where("dept_id in ?", c.DeptIds).Find(&dlist) + // 删除SysRole 和 SysDept 的关联关系 err = tx.Model(&model).Association("SysDept").Delete(model.SysDept) if err != nil { e.Log.Errorf("delete SysDept error:%s", err) @@ -214,8 +266,9 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { } c.Generate(&model) model.SysDept = dlist + // 更新关联的数据,使用 FullSaveAssociations 模式 db := tx.Model(&model).Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) _ = e.AddError(err) return e @@ -230,19 +283,23 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { // UpdateStatus 修改SysRole对象status func (e *SysRole) UpdateStatus(c *dto.UpdateStatusReq) error { var err error - tx := e.Orm.Debug().Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx = e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } var model = models.SysRole{} tx.First(&model, c.GetId()) c.Generate(&model) + // 更新关联的数据,使用 FullSaveAssociations 模式 db := tx.Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -287,7 +344,9 @@ func (e *SysRole) GetById(roleId int) ([]string, error) { } l := *model.SysMenu for i := 0; i < len(l); i++ { - permissions = append(permissions, l[i].Permission) + if l[i].Permission != "" { + permissions = append(permissions, l[i].Permission) + } } return permissions, nil -} \ No newline at end of file +} diff --git a/app/admin/service/sys_user.go b/app/admin/service/sys_user.go index 24a6e28bf..2a03c034a 100644 --- a/app/admin/service/sys_user.go +++ b/app/admin/service/sys_user.go @@ -127,8 +127,7 @@ func (e *SysUser) UpdateAvatar(c *dto.UpdateSysUserAvatarReq, p *actions.DataPer return errors.New("无权更新该数据") } - c.Generate(&model) - err = e.Orm.Save(&model).Error + err = e.Orm.Table(model.TableName()).Where("user_id =? ", c.UserId).Updates(c).Error if err != nil { e.Log.Errorf("Service UpdateSysUser error: %s", err) return err @@ -151,8 +150,7 @@ func (e *SysUser) UpdateStatus(c *dto.UpdateSysUserStatusReq, p *actions.DataPer return errors.New("无权更新该数据") } - c.Generate(&model) - err = e.Orm.Save(&model).Error + err = e.Orm.Table(model.TableName()).Where("user_id =? ", c.UserId).Updates(c).Error if err != nil { e.Log.Errorf("Service UpdateSysUser error: %s", err) return err @@ -175,7 +173,7 @@ func (e *SysUser) ResetPwd(c *dto.ResetSysUserPwdReq, p *actions.DataPermission) return errors.New("无权更新该数据") } c.Generate(&model) - err = e.Orm.Save(&model).Error + err = e.Orm.Omit("username", "nick_name", "phone", "role_id", "avatar", "sex").Save(&model).Error if err != nil { e.Log.Errorf("At Service ResetSysUserPwd error: %s", err) return err @@ -235,7 +233,9 @@ func (e *SysUser) UpdatePwd(id int, oldPassword, newPassword string, p *actions. return err } c.Password = newPassword - db := e.Orm.Model(c).Where("user_id = ?", id).Select("Password", "Salt").Updates(c) + db := e.Orm.Model(c).Where("user_id = ?", id). + Select("Password", "Salt"). + Updates(c) if err = db.Error; err != nil { e.Log.Errorf("db error: %s", err) return err diff --git a/app/jobs/apis/sys_job.go b/app/jobs/apis/sys_job.go index 581740025..296138dde 100644 --- a/app/jobs/apis/sys_job.go +++ b/app/jobs/apis/sys_job.go @@ -62,7 +62,7 @@ func (e SysJob) StartJobForService(c *gin.Context) { err = s.StartJob(&v) if err != nil { log.Errorf("GetCrontabKey error, %s", err.Error()) - e.Error(500, err, "") + e.Error(500, err, err.Error()) return } e.OK(nil, s.Msg) diff --git a/app/jobs/examples.go b/app/jobs/examples.go index cc0ba8537..ed233cc39 100644 --- a/app/jobs/examples.go +++ b/app/jobs/examples.go @@ -5,15 +5,17 @@ import ( "time" ) +// InitJob // 需要将定义的struct 添加到字典中; // 字典 key 可以配置到 自动任务 调用目标 中; func InitJob() { - jobList = map[string]JobsExec{ + jobList = map[string]JobExec{ "ExamplesOne": ExamplesOne{}, // ... } } +// ExamplesOne // 新添加的job 必须按照以下格式定义,并实现Exec函数 type ExamplesOne struct { } diff --git a/app/jobs/jobbase.go b/app/jobs/jobbase.go index 3e09b8889..2ec5d94fb 100644 --- a/app/jobs/jobbase.go +++ b/app/jobs/jobbase.go @@ -6,7 +6,6 @@ import ( "github.com/go-admin-team/go-admin-core/sdk" models2 "go-admin/app/jobs/models" "gorm.io/gorm" - "sync" "time" "github.com/robfig/cron/v3" @@ -18,8 +17,9 @@ import ( var timeFormat = "2006-01-02 15:04:05" var retryCount = 3 -var jobList map[string]JobsExec -var lock sync.Mutex +var jobList map[string]JobExec + +//var lock sync.Mutex type JobCore struct { InvokeTarget string @@ -30,7 +30,7 @@ type JobCore struct { Args string } -// 任务类型 http +// HttpJob 任务类型 http type HttpJob struct { JobCore } @@ -46,7 +46,7 @@ func (e *ExecJob) Run() { log.Warn("[Job] ExecJob Run job nil") return } - err := CallExec(obj.(JobsExec), e.Args) + err := CallExec(obj.(JobExec), e.Args) if err != nil { // 如果失败暂停一段时间重试 fmt.Println(time.Now().Format(timeFormat), " [ERROR] mission failed! ", err) @@ -59,11 +59,11 @@ func (e *ExecJob) Run() { //TODO: 待完善部分 //str := time.Now().Format(timeFormat) + " [INFO] JobCore " + string(e.EntryId) + "exec success , spend :" + latencyTime.String() //ws.SendAll(str) - log.Info("[Job] JobCore %s exec success , spend :%v", e.Name, latencyTime) + log.Infof("[Job] JobCore %s exec success , spend :%v", e.Name, latencyTime) return } -//http 任务接口 +// Run http 任务接口 func (h *HttpJob) Run() { startTime := time.Now() @@ -77,8 +77,8 @@ LOOP: str, err = pkg.Get(h.InvokeTarget) if err != nil { // 如果失败暂停一段时间重试 - fmt.Println(time.Now().Format(timeFormat), " [ERROR] mission failed! ", err) - fmt.Printf(time.Now().Format(timeFormat)+" [INFO] Retry after the task fails %d seconds! %s \n", (count+1)*5, str) + log.Warnf("[Job] mission failed! %v", err) + log.Warnf("[Job] Retry after the task fails %d seconds! %s \n", (count+1)*5, str) time.Sleep(time.Duration(count+1) * 5 * time.Second) count = count + 1 goto LOOP @@ -95,7 +95,7 @@ LOOP: return } -// 初始化 +// Setup 初始化 func Setup(dbs map[string]*gorm.DB) { fmt.Println(time.Now().Format(timeFormat), " [INFO] JobCore Starting...") @@ -152,7 +152,7 @@ func setup(key string, db *gorm.DB) { select {} } -// 添加任务 AddJob(invokeTarget string, jobId int, jobName string, cronExpression string) +// AddJob 添加任务 AddJob(invokeTarget string, jobId int, jobName string, cronExpression string) func AddJob(c *cron.Cron, job Job) (int, error) { if job == nil { fmt.Println("unknown") @@ -171,8 +171,8 @@ func (h *HttpJob) addJob(c *cron.Cron) (int, error) { return EntryId, nil } -func (h *ExecJob) addJob(c *cron.Cron) (int, error) { - id, err := c.AddJob(h.CronExpression, h) +func (e *ExecJob) addJob(c *cron.Cron) (int, error) { + id, err := c.AddJob(e.CronExpression, e) if err != nil { fmt.Println(time.Now().Format(timeFormat), " [ERROR] JobCore AddJob error", err) return 0, err @@ -181,7 +181,7 @@ func (h *ExecJob) addJob(c *cron.Cron) (int, error) { return EntryId, nil } -// 移除任务 +// Remove 移除任务 func Remove(c *cron.Cron, entryID int) chan bool { ch := make(chan bool) go func() { diff --git a/app/jobs/models/sys_job.go b/app/jobs/models/sys_job.go index 5a62f9d0e..a8cc6bf9a 100644 --- a/app/jobs/models/sys_job.go +++ b/app/jobs/models/sys_job.go @@ -23,7 +23,7 @@ type SysJob struct { DataScope string `json:"dataScope" gorm:"-"` } -func (SysJob) TableName() string { +func (*SysJob) TableName() string { return "sys_job" } @@ -48,7 +48,7 @@ func (e *SysJob) GetList(tx *gorm.DB, list interface{}) (err error) { return tx.Table(e.TableName()).Where("status = ?", 2).Find(list).Error } -// 更新SysJob +// Update 更新SysJob func (e *SysJob) Update(tx *gorm.DB, id interface{}) (err error) { return tx.Table(e.TableName()).Where(id).Updates(&e).Error } diff --git a/app/jobs/service/sys_job.go b/app/jobs/service/sys_job.go index 4e566d004..a1ab81081 100644 --- a/app/jobs/service/sys_job.go +++ b/app/jobs/service/sys_job.go @@ -1,6 +1,7 @@ package service import ( + "errors" "time" "github.com/go-admin-team/go-admin-core/sdk/service" @@ -52,6 +53,12 @@ func (e *SysJob) StartJob(c *dto.GeneralGetDto) error { e.Log.Errorf("db error: %s", err) return err } + + if data.Status == 1 { + err = errors.New("当前Job是关闭状态不能被启动,请先启用。") + return err + } + if data.JobType == 1 { var j = &jobs.HttpJob{} j.InvokeTarget = data.InvokeTarget diff --git a/app/jobs/type.go b/app/jobs/type.go index b29b6b9da..1b5c30bfc 100644 --- a/app/jobs/type.go +++ b/app/jobs/type.go @@ -7,10 +7,10 @@ type Job interface { addJob(*cron.Cron) (int, error) } -type JobsExec interface { +type JobExec interface { Exec(arg interface{}) error } -func CallExec(e JobsExec, arg interface{}) error { +func CallExec(e JobExec, arg interface{}) error { return e.Exec(arg) } diff --git a/app/other/apis/file.go b/app/other/apis/file.go index 4548edd9e..94d2ec76e 100644 --- a/app/other/apis/file.go +++ b/app/other/apis/file.go @@ -44,63 +44,61 @@ type File struct { func (e File) UploadFile(c *gin.Context) { e.MakeContext(c) tag, _ := c.GetPostForm("type") - urlPrefix := fmt.Sprintf("http://%s/", c.Request.Host) - var fileResponse FileResponse + urlPrefix := fmt.Sprintf("%s://%s/", "http", c.Request.Host) switch tag { case "1": // 单图 - var done bool - fileResponse, done = e.singleFile(c, fileResponse, urlPrefix) - if done { - return - } - e.OK(fileResponse, "上传成功") - return + e.handleSingleFile(c, urlPrefix) case "2": // 多图 - multipartFile := e.multipleFile(c, urlPrefix) - e.OK(multipartFile, "上传成功") - return + e.handleMultipleFiles(c, urlPrefix) case "3": // base64 - fileResponse = e.baseImg(c, fileResponse, urlPrefix) - e.OK(fileResponse, "上传成功") + e.handleBase64File(c, urlPrefix) default: - var done bool - fileResponse, done = e.singleFile(c, fileResponse, urlPrefix) - if done { - return - } - e.OK(fileResponse, "上传成功") + e.handleSingleFile(c, urlPrefix) + } +} + +func (e File) handleSingleFile(c *gin.Context, urlPrefix string) { + fileResponse, done := e.singleFile(c, FileResponse{}, urlPrefix) + if done { return } + e.OK(fileResponse, "上传成功") +} + +func (e File) handleMultipleFiles(c *gin.Context, urlPrefix string) { + multipartFile := e.multipleFile(c, urlPrefix) + e.OK(multipartFile, "上传成功") +} +func (e File) handleBase64File(c *gin.Context, urlPrefix string) { + fileResponse := e.baseImg(c, FileResponse{}, urlPrefix) + e.OK(fileResponse, "上传成功") } -func (e File) baseImg(c *gin.Context, fileResponse FileResponse, urlPerfix string) FileResponse { +func (e File) baseImg(c *gin.Context, fileResponse FileResponse, urlPrefix string) FileResponse { files, _ := c.GetPostForm("file") file2list := strings.Split(files, ",") - ddd, _ := base64.StdEncoding.DecodeString(file2list[1]) - guid := uuid.New().String() - fileName := guid + ".jpg" - err := utils.IsNotExistMkDir(path) - if err != nil { + decodedData, _ := base64.StdEncoding.DecodeString(file2list[1]) + fileName := uuid.New().String() + ".jpg" + + if err := utils.IsNotExistMkDir(path); err != nil { e.Error(500, errors.New(""), "初始化文件路径失败") + return fileResponse } + base64File := path + fileName - _ = ioutil.WriteFile(base64File, ddd, 0666) + _ = ioutil.WriteFile(base64File, decodedData, 0666) typeStr := strings.Replace(strings.Replace(file2list[0], "data:", "", -1), ";base64", "", -1) - fileResponse = FileResponse{ - Size: pkg.GetFileSize(base64File), - Path: base64File, - FullPath: urlPerfix + base64File, - Name: "", - Type: typeStr, - } + + fileResponse = e.buildFileResponse(base64File, urlPrefix, "", typeStr) source, _ := c.GetPostForm("source") - err = thirdUpload(source, fileName, base64File) - if err != nil { + + if err := thirdUpload(source, fileName, base64File); err != nil { e.Error(200, errors.New(""), "上传第三方失败") return fileResponse } + if source != "1" { fileResponse.Path = "/static/uploadfile/" + fileName fileResponse.FullPath = "/static/uploadfile/" + fileName @@ -108,81 +106,76 @@ func (e File) baseImg(c *gin.Context, fileResponse FileResponse, urlPerfix strin return fileResponse } -func (e File) multipleFile(c *gin.Context, urlPerfix string) []FileResponse { +func (e File) multipleFile(c *gin.Context, urlPrefix string) []FileResponse { files := c.Request.MultipartForm.File["file"] source, _ := c.GetPostForm("source") var multipartFile []FileResponse + for _, f := range files { - guid := uuid.New().String() - fileName := guid + utils.GetExt(f.Filename) + fileName := uuid.New().String() + utils.GetExt(f.Filename) - err := utils.IsNotExistMkDir(path) - if err != nil { + if err := utils.IsNotExistMkDir(path); err != nil { e.Error(500, errors.New(""), "初始化文件路径失败") + continue } + multipartFileName := path + fileName - err1 := c.SaveUploadedFile(f, multipartFileName) + if err := c.SaveUploadedFile(f, multipartFileName); err != nil { + continue + } + fileType, _ := utils.GetType(multipartFileName) - if err1 == nil { - err := thirdUpload(source, fileName, multipartFileName) - if err != nil { - e.Error(500, errors.New(""), "上传第三方失败") - } else { - fileResponse := FileResponse{ - Size: pkg.GetFileSize(multipartFileName), - Path: multipartFileName, - FullPath: urlPerfix + multipartFileName, - Name: f.Filename, - Type: fileType, - } - if source != "1" { - fileResponse.Path = "/static/uploadfile/" + fileName - fileResponse.FullPath = "/static/uploadfile/" + fileName - } - multipartFile = append(multipartFile, fileResponse) - } + if err := thirdUpload(source, fileName, multipartFileName); err != nil { + e.Error(500, errors.New(""), "上传第三方失败") + continue + } + + fileResponse := e.buildFileResponse(multipartFileName, urlPrefix, f.Filename, fileType) + if source != "1" { + fileResponse.Path = "/static/uploadfile/" + fileName + fileResponse.FullPath = "/static/uploadfile/" + fileName } + multipartFile = append(multipartFile, fileResponse) } return multipartFile } -func (e File) singleFile(c *gin.Context, fileResponse FileResponse, urlPerfix string) (FileResponse, bool) { +func (e File) singleFile(c *gin.Context, fileResponse FileResponse, urlPrefix string) (FileResponse, bool) { files, err := c.FormFile("file") - if err != nil { e.Error(200, errors.New(""), "图片不能为空") return FileResponse{}, true } - // 上传文件至指定目录 - guid := uuid.New().String() - - fileName := guid + utils.GetExt(files.Filename) - err = utils.IsNotExistMkDir(path) - if err != nil { + fileName := uuid.New().String() + utils.GetExt(files.Filename) + if err := utils.IsNotExistMkDir(path); err != nil { e.Error(500, errors.New(""), "初始化文件路径失败") + return FileResponse{}, true } + singleFile := path + fileName - _ = c.SaveUploadedFile(files, singleFile) - fileType, _ := utils.GetType(singleFile) - fileResponse = FileResponse{ - Size: pkg.GetFileSize(singleFile), - Path: singleFile, - FullPath: urlPerfix + singleFile, - Name: files.Filename, - Type: fileType, + if err := c.SaveUploadedFile(files, singleFile); err != nil { + e.Error(500, errors.New(""), "文件保存失败") + return FileResponse{}, true } - //source, _ := c.GetPostForm("source") - //err = thirdUpload(source, fileName, singleFile) - //if err != nil { - // e.Error(200, errors.New(""), "上传第三方失败") - // return FileResponse{}, true - //} + + fileType, _ := utils.GetType(singleFile) + fileResponse = e.buildFileResponse(singleFile, urlPrefix, files.Filename, fileType) fileResponse.Path = "/static/uploadfile/" + fileName fileResponse.FullPath = "/static/uploadfile/" + fileName return fileResponse, false } +func (e File) buildFileResponse(filePath, urlPrefix, fileName, fileType string) FileResponse { + return FileResponse{ + Size: pkg.GetFileSize(filePath), + Path: filePath, + FullPath: urlPrefix + filePath, + Name: fileName, + Type: fileType, + } +} + func thirdUpload(source string, name string, path string) error { switch source { case "2": @@ -201,4 +194,4 @@ func ossUpload(name string, path string) error { func qiniuUpload(name string, path string) error { oss := file_store.ALiYunOSS{} return oss.UpLoad(name, path) -} \ No newline at end of file +} diff --git a/app/other/apis/sys_server_monitor.go b/app/other/apis/sys_server_monitor.go index a80540528..699b6337c 100644 --- a/app/other/apis/sys_server_monitor.go +++ b/app/other/apis/sys_server_monitor.go @@ -2,18 +2,19 @@ package apis import ( "fmt" - "github.com/shirou/gopsutil/host" + "github.com/shirou/gopsutil/v3/net" "runtime" "strconv" + "strings" "time" "github.com/gin-gonic/gin" "github.com/go-admin-team/go-admin-core/sdk/api" "github.com/go-admin-team/go-admin-core/sdk/pkg" - _ "github.com/go-admin-team/go-admin-core/sdk/pkg/response" - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/disk" - "github.com/shirou/gopsutil/mem" + "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v3/disk" + "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v3/mem" ) const ( @@ -23,94 +24,160 @@ const ( GB = 1024 * MB ) +var excludeNetInterfaces = []string{ + "lo", "tun", "docker", "veth", "br-", "vmbr", "vnet", "kube", +} + type ServerMonitor struct { api.Api } -//获取相差时间 +// GetHourDiffer 获取相差时间 func GetHourDiffer(startTime, endTime string) int64 { - var hour int64 - t1, err := time.ParseInLocation("2006-01-02 15:04:05", startTime, time.Local) - t2, err := time.ParseInLocation("2006-01-02 15:04:05", endTime, time.Local) - if err == nil && t1.Before(t2) { - diff := t2.Unix() - t1.Unix() // - hour = diff / 3600 - return hour - } else { - return hour + t1, err1 := time.ParseInLocation("2006-01-02 15:04:05", startTime, time.Local) + t2, err2 := time.ParseInLocation("2006-01-02 15:04:05", endTime, time.Local) + if err1 != nil || err2 != nil || !t1.Before(t2) { + return 0 } + return (t2.Unix() - t1.Unix()) / 3600 } // ServerInfo 获取系统信息 -// @Summary 系统信息 -// @Description 获取JSON -// @Tags 系统信息 -// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" -// @Router /api/v1/server-monitor [get] -// @Security Bearer func (e ServerMonitor) ServerInfo(c *gin.Context) { e.Context = c - sysInfo, err := host.Info() - osDic := make(map[string]interface{}, 0) - osDic["goOs"] = runtime.GOOS - osDic["arch"] = runtime.GOARCH - osDic["mem"] = runtime.MemProfileRate - osDic["compiler"] = runtime.Compiler - osDic["version"] = runtime.Version() - osDic["numGoroutine"] = runtime.NumGoroutine() - osDic["ip"] = pkg.GetLocaHonst() - osDic["projectDir"] = pkg.GetCurrentPath() - osDic["hostName"] = sysInfo.Hostname - osDic["time"] = time.Now().Format("2006-01-02 15:04:05") - - dis, _ := disk.Usage("/") - diskTotalGB := int(dis.Total) / GB - diskFreeGB := int(dis.Free) / GB - diskDic := make(map[string]interface{}, 0) - diskDic["total"] = diskTotalGB - diskDic["free"] = diskFreeGB - - mem, _ := mem.VirtualMemory() - memUsedMB := int(mem.Used) / GB - memTotalMB := int(mem.Total) / GB - memFreeMB := int(mem.Free) / GB - memUsedPercent := int(mem.UsedPercent) - memDic := make(map[string]interface{}, 0) - memDic["total"] = memTotalMB - memDic["used"] = memUsedMB - memDic["free"] = memFreeMB - memDic["usage"] = memUsedPercent - - cpuDic := make(map[string]interface{}, 0) - cpuDic["cpuInfo"], _ = cpu.Info() + osInfo := getOSInfo() + memInfo := getMemoryInfo() + swapInfo := getSwapInfo() + cpuInfo := getCPUInfo() + diskInfo := getDiskInfo() + netInfo := getNetworkInfo() + + bootTime, _ := host.BootTime() + cachedBootTime := time.Unix(int64(bootTime), 0) + + e.Custom(gin.H{ + "code": 200, + "os": osInfo, + "mem": memInfo, + "cpu": cpuInfo, + "disk": diskInfo, + "net": netInfo, + "swap": swapInfo, + "location": "Aliyun", + "bootTime": GetHourDiffer(cachedBootTime.Format("2006-01-02 15:04:05"), time.Now().Format("2006-01-02 15:04:05")), + }) +} + +func getOSInfo() map[string]interface{} { + sysInfo, _ := host.Info() + return map[string]interface{}{ + "goOs": runtime.GOOS, + "arch": runtime.GOARCH, + "mem": runtime.MemProfileRate, + "compiler": runtime.Compiler, + "version": runtime.Version(), + "numGoroutine": runtime.NumGoroutine(), + "ip": pkg.GetLocalHost(), + "projectDir": pkg.GetCurrentPath(), + "hostName": sysInfo.Hostname, + "time": time.Now().Format("2006-01-02 15:04:05"), + } +} + +func getMemoryInfo() map[string]interface{} { + memory, _ := mem.VirtualMemory() + return map[string]interface{}{ + "used": memory.Used / MB, + "total": memory.Total / MB, + "percent": pkg.Round(memory.UsedPercent, 2), + } +} + +func getSwapInfo() map[string]interface{} { + memory, _ := mem.VirtualMemory() + return map[string]interface{}{ + "used": memory.SwapTotal - memory.SwapFree, + "total": memory.SwapTotal, + } +} + +func getCPUInfo() map[string]interface{} { + cpuInfo, _ := cpu.Info() percent, _ := cpu.Percent(0, false) - cpuDic["Percent"] = pkg.Round(percent[0], 2) - cpuDic["cpuNum"], _ = cpu.Counts(false) + cpuNum, _ := cpu.Counts(false) + return map[string]interface{}{ + "cpuInfo": cpuInfo, + "percent": pkg.Round(percent[0], 2), + "cpuNum": cpuNum, + } +} + +func getDiskInfo() map[string]interface{} { + var diskTotal, diskUsed, diskUsedPercent float64 + diskList := make([]disk.UsageStat, 0) - //服务器磁盘信息 - disklist := make([]disk.UsageStat, 0) - //所有分区 diskInfo, err := disk.Partitions(true) if err == nil { for _, p := range diskInfo { diskDetail, err := disk.Usage(p.Mountpoint) if err == nil { diskDetail.UsedPercent, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", diskDetail.UsedPercent), 64) - diskDetail.Total = diskDetail.Total / 1024 / 1024 - diskDetail.Used = diskDetail.Used / 1024 / 1024 - diskDetail.Free = diskDetail.Free / 1024 / 1024 - disklist = append(disklist, *diskDetail) + diskDetail.Total /= MB + diskDetail.Used /= MB + diskDetail.Free /= MB + diskList = append(diskList, *diskDetail) } } } - e.Custom(gin.H{ - "code": 200, - "os": osDic, - "mem": memDic, - "cpu": cpuDic, - "disk": diskDic, - "diskList": disklist, - }) + d, _ := disk.Usage("/") + diskTotal = float64(d.Total / GB) + diskUsed = float64(d.Used / GB) + diskUsedPercent, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", d.UsedPercent), 64) + + return map[string]interface{}{ + "total": diskTotal, + "used": diskUsed, + "percent": diskUsedPercent, + } +} + +func getNetworkInfo() map[string]interface{} { + netInSpeed, netOutSpeed := trackNetworkSpeed() + return map[string]interface{}{ + "in": pkg.Round(float64(netInSpeed/KB), 2), + "out": pkg.Round(float64(netOutSpeed/KB), 2), + } +} + +func trackNetworkSpeed() (uint64, uint64) { + var netInSpeed, netOutSpeed, netInTransfer, netOutTransfer, lastUpdateNetStats uint64 + nc, err := net.IOCounters(true) + if err == nil { + for _, v := range nc { + if isListContainsStr(excludeNetInterfaces, v.Name) { + continue + } + netInTransfer += v.BytesRecv + netOutTransfer += v.BytesSent + } + now := uint64(time.Now().Unix()) + diff := now - lastUpdateNetStats + if diff > 0 { + netInSpeed = (netInTransfer - netInTransfer) / diff + netOutSpeed = (netOutTransfer - netOutTransfer) / diff + } + lastUpdateNetStats = now + } + return netInSpeed, netOutSpeed +} + +func isListContainsStr(list []string, str string) bool { + for _, item := range list { + if strings.Contains(str, item) { + return true + } + } + return false } diff --git a/app/other/apis/tools/db_columns.go b/app/other/apis/tools/db_columns.go index 51786f914..e0b8390a0 100644 --- a/app/other/apis/tools/db_columns.go +++ b/app/other/apis/tools/db_columns.go @@ -17,7 +17,7 @@ import ( // @Param pageIndex query int false "pageIndex / 页码" // @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/db/columns/page [get] -func (e *Gen) GetDBColumnList(c *gin.Context) { +func (e Gen) GetDBColumnList(c *gin.Context) { e.Context = c log := e.GetLogger() var data tools.DBColumns diff --git a/app/other/apis/tools/db_tables.go b/app/other/apis/tools/db_tables.go index 7076700d6..d1ec3c4ad 100644 --- a/app/other/apis/tools/db_tables.go +++ b/app/other/apis/tools/db_tables.go @@ -19,7 +19,7 @@ import ( // @Param pageIndex query int false "pageIndex / 页码" // @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/db/tables/page [get] -func (e *Gen) GetDBTableList(c *gin.Context) { +func (e Gen) GetDBTableList(c *gin.Context) { //var res response.Response var data tools.DBTables var err error diff --git a/app/other/models/tools/sys_columns.go b/app/other/models/tools/sys_columns.go index 34fe27c7b..ff6b8ddf9 100644 --- a/app/other/models/tools/sys_columns.go +++ b/app/other/models/tools/sys_columns.go @@ -1,7 +1,8 @@ package tools import ( - "go-admin/app/admin/models" + common "go-admin/common/models" + "gorm.io/gorm" ) @@ -44,10 +45,10 @@ type SysColumns struct { CreateBy int `gorm:"column:create_by;size:20;" json:"createBy"` UpdateBy int `gorm:"column:update_By;size:20;" json:"updateBy"` - models.BaseModel + common.ModelTime } -func (SysColumns) TableName() string { +func (*SysColumns) TableName() string { return "sys_columns" } @@ -56,7 +57,7 @@ func (e *SysColumns) GetList(tx *gorm.DB, exclude bool) ([]SysColumns, error) { table := tx.Table("sys_columns") table = table.Where("table_id = ? ", e.TableId) if exclude { - notIn := make([]string, 6) + notIn := make([]string, 0, 6) notIn = append(notIn, "id") notIn = append(notIn, "create_by") notIn = append(notIn, "update_by") diff --git a/app/other/models/tools/sys_tables.go b/app/other/models/tools/sys_tables.go index 426740273..4417a3e01 100644 --- a/app/other/models/tools/sys_tables.go +++ b/app/other/models/tools/sys_tables.go @@ -5,8 +5,6 @@ import ( "strings" "gorm.io/gorm" - - "go-admin/app/admin/models" ) type SysTables struct { @@ -43,11 +41,9 @@ type SysTables struct { DataScope string `gorm:"-" json:"dataScope"` Params Params `gorm:"-" json:"params"` Columns []SysColumns `gorm:"-" json:"columns"` - - models.BaseModel } -func (SysTables) TableName() string { +func (*SysTables) TableName() string { return "sys_tables" } diff --git a/cmd/api/server.go b/cmd/api/server.go index b5769d6d0..3f922e8a2 100644 --- a/cmd/api/server.go +++ b/cmd/api/server.go @@ -3,7 +3,6 @@ package api import ( "context" "fmt" - "log" "net/http" "os" "os/signal" @@ -11,11 +10,12 @@ import ( "github.com/gin-gonic/gin" "github.com/go-admin-team/go-admin-core/config/source/file" + log "github.com/go-admin-team/go-admin-core/logger" "github.com/go-admin-team/go-admin-core/sdk" "github.com/go-admin-team/go-admin-core/sdk/api" "github.com/go-admin-team/go-admin-core/sdk/config" "github.com/go-admin-team/go-admin-core/sdk/pkg" - "github.com/go-admin-team/go-admin-core/sdk/runtime" + "github.com/pkg/errors" "github.com/spf13/cobra" "go-admin/app/admin/models" @@ -73,7 +73,7 @@ func setup() { go queue.Run() usageStr := `starting api server...` - log.Println(usageStr) + log.Info(usageStr) } func run() error { @@ -100,30 +100,28 @@ func run() error { if apiCheck { var routers = sdk.Runtime.GetRouter() q := sdk.Runtime.GetMemoryQueue("") - mp := make(map[string]interface{}, 0) + mp := make(map[string]interface{}) mp["List"] = routers message, err := sdk.Runtime.GetStreamMessage("", global.ApiCheck, mp) if err != nil { - log.Printf("GetStreamMessage error, %s \n", err.Error()) + log.Infof("GetStreamMessage error, %s \n", err.Error()) //日志报错错误,不中断请求 } else { err = q.Append(message) if err != nil { - log.Printf("Append message error, %s \n", err.Error()) + log.Infof("Append message error, %s \n", err.Error()) } } } - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() go func() { // 服务连接 if config.SslConfig.Enable { - if err := srv.ListenAndServeTLS(config.SslConfig.Pem, config.SslConfig.KeyStr); err != nil && err != http.ErrServerClosed { + if err := srv.ListenAndServeTLS(config.SslConfig.Pem, config.SslConfig.KeyStr); err != nil && !errors.Is(err, http.ErrServerClosed) { log.Fatal("listen: ", err) } } else { - if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed { + if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) { log.Fatal("listen: ", err) } } @@ -131,27 +129,30 @@ func run() error { fmt.Println(pkg.Red(string(global.LogoContent))) tip() fmt.Println(pkg.Green("Server run at:")) - fmt.Printf("- Local: http://localhost:%d/ \r\n", config.ApplicationConfig.Port) - fmt.Printf("- Network: http://%s:%d/ \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) + fmt.Printf("- Local: %s://localhost:%d/ \r\n", "http", config.ApplicationConfig.Port) + fmt.Printf("- Network: %s://%s:%d/ \r\n", "http", pkg.GetLocalHost(), config.ApplicationConfig.Port) fmt.Println(pkg.Green("Swagger run at:")) - fmt.Printf("- Local: http://localhost:%d/swagger/index.html \r\n", config.ApplicationConfig.Port) - fmt.Printf("- Network: http://%s:%d/swagger/index.html \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) + fmt.Printf("- Local: http://localhost:%d/swagger/admin/index.html \r\n", config.ApplicationConfig.Port) + fmt.Printf("- Network: %s://%s:%d/swagger/admin/index.html \r\n", "http", pkg.GetLocalHost(), config.ApplicationConfig.Port) fmt.Printf("%s Enter Control + C Shutdown Server \r\n", pkg.GetCurrentTimeStr()) // 等待中断信号以优雅地关闭服务器(设置 5 秒的超时时间) - quit := make(chan os.Signal) + quit := make(chan os.Signal, 1) signal.Notify(quit, os.Interrupt) <-quit - fmt.Printf("%s Shutdown Server ... \r\n", pkg.GetCurrentTimeStr()) + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + log.Info("Shutdown Server ... ") if err := srv.Shutdown(ctx); err != nil { log.Fatal("Server Shutdown:", err) } - log.Println("Server exiting") + log.Info("Server exiting") return nil } -var Router runtime.Router +//var Router runtime.Router func tip() { usageStr := `欢迎使用 ` + pkg.Green(`go-admin `+global.Version) + ` 可以使用 ` + pkg.Red(`-h`) + ` 查看命令` @@ -170,7 +171,7 @@ func initRouter() { r = h.(*gin.Engine) default: log.Fatal("not support other engine") - os.Exit(-1) + //os.Exit(-1) } if config.SslConfig.Enable { r.Use(handler.TlsHandler()) diff --git a/cmd/app/server.go b/cmd/app/server.go index 8eaae50eb..013ac3843 100644 --- a/cmd/app/server.go +++ b/cmd/app/server.go @@ -13,10 +13,10 @@ import ( var ( appName string StartCmd = &cobra.Command{ - Use: "createapp", + Use: "app", Short: "Create a new app", Long: "Use when you need to create a new app", - Example: "go-admin createapp -n admin", + Example: "go-admin app -n admin", Run: func(cmd *cobra.Command, args []string) { run() }, @@ -87,4 +87,4 @@ func genFile() error { err = t2.Execute(&b2, nil) pkg.FileCreate(b2, appPath+"/router/router.go") return nil -} \ No newline at end of file +} diff --git a/cmd/cobra.go b/cmd/cobra.go index 6c69d355e..d6030a979 100644 --- a/cmd/cobra.go +++ b/cmd/cobra.go @@ -36,7 +36,7 @@ var rootCmd = &cobra.Command{ func tip() { usageStr := `欢迎使用 ` + pkg.Green(`go-admin `+global.Version) + ` 可以使用 ` + pkg.Red(`-h`) + ` 查看命令` - usageStr1 := `也可以参考 https://doc.go-admin.dev/guide/ksks.html 里边的【启动】章节` + usageStr1 := `也可以参考 https://doc.go-admin.dev/guide/ksks 的相关内容` fmt.Printf("%s\n", usageStr) fmt.Printf("%s\n", usageStr1) } diff --git a/cmd/migrate/migration/init.go b/cmd/migrate/migration/init.go index 54261d1eb..739e6b40e 100644 --- a/cmd/migrate/migration/init.go +++ b/cmd/migrate/migration/init.go @@ -4,20 +4,18 @@ import ( "log" "path/filepath" "sort" - "strconv" "sync" - "github.com/spf13/cast" "gorm.io/gorm" ) var Migrate = &Migration{ - version: make(map[int]func(db *gorm.DB, version string) error), + version: make(map[string]func(db *gorm.DB, version string) error), } type Migration struct { db *gorm.DB - version map[int]func(db *gorm.DB, version string) error + version map[string]func(db *gorm.DB, version string) error mutex sync.Mutex } @@ -29,24 +27,24 @@ func (e *Migration) SetDb(db *gorm.DB) { e.db = db } -func (e *Migration) SetVersion(k int, f func(db *gorm.DB, version string) error) { +func (e *Migration) SetVersion(k string, f func(db *gorm.DB, version string) error) { e.mutex.Lock() defer e.mutex.Unlock() e.version[k] = f } func (e *Migration) Migrate() { - versions := make([]int, 0) + versions := make([]string, 0) for k := range e.version { versions = append(versions, k) } - if !sort.IntsAreSorted(versions) { - sort.Ints(versions) + if !sort.StringsAreSorted(versions) { + sort.Strings(versions) } var err error var count int64 for _, v := range versions { - err = e.db.Debug().Table("sys_migration").Where("version = ?", v).Count(&count).Error + err = e.db.Table("sys_migration").Where("version = ?", v).Count(&count).Error if err != nil { log.Fatalln(err) } @@ -55,14 +53,14 @@ func (e *Migration) Migrate() { count = 0 continue } - err = (e.version[v])(e.db.Debug(), strconv.Itoa(v)) + err = (e.version[v])(e.db.Debug(), v) if err != nil { log.Fatalln(err) } } } -func GetFilename(s string) int { +func GetFilename(s string) string { s = filepath.Base(s) - return cast.ToInt(s[:13]) + return s[:13] } diff --git a/cmd/migrate/migration/models/casbin_rule.go b/cmd/migrate/migration/models/casbin_rule.go index 014e2fd18..bab7203f6 100644 --- a/cmd/migrate/migration/models/casbin_rule.go +++ b/cmd/migrate/migration/models/casbin_rule.go @@ -1,14 +1,15 @@ package models -//sys_casbin_rule +// CasbinRule sys_casbin_rule type CasbinRule struct { - PType string `json:"p_type" gorm:"size:100;"` - V0 string `json:"v0" gorm:"size:100;"` - V1 string `json:"v1" gorm:"size:100;"` - V2 string `json:"v2" gorm:"size:100;"` - V3 string `json:"v3" gorm:"size:100;"` - V4 string `json:"v4" gorm:"size:100;"` - V5 string `json:"v5" gorm:"size:100;"` + ID uint `gorm:"primaryKey;autoIncrement"` + Ptype string `gorm:"size:512;uniqueIndex:unique_index"` + V0 string `gorm:"size:512;uniqueIndex:unique_index"` + V1 string `gorm:"size:512;uniqueIndex:unique_index"` + V2 string `gorm:"size:512;uniqueIndex:unique_index"` + V3 string `gorm:"size:512;uniqueIndex:unique_index"` + V4 string `gorm:"size:512;uniqueIndex:unique_index"` + V5 string `gorm:"size:512;uniqueIndex:unique_index"` } func (CasbinRule) TableName() string { diff --git a/cmd/migrate/migration/models/initdb.go b/cmd/migrate/migration/models/initdb.go index 9bb37a2ab..ba7f4ca76 100644 --- a/cmd/migrate/migration/models/initdb.go +++ b/cmd/migrate/migration/models/initdb.go @@ -3,18 +3,35 @@ package models import ( "fmt" "go-admin/common/global" - "gorm.io/gorm" "io/ioutil" "log" "strings" + + "gorm.io/gorm" ) func InitDb(db *gorm.DB) (err error) { filePath := "config/db.sql" - err = ExecSql(db, filePath) if global.Driver == "postgres" { + filePath := "config/db.sql" + if err = ExecSql(db, filePath); err != nil { + return err + } filePath = "config/pg.sql" err = ExecSql(db, filePath) + } else if global.Driver == "mysql" { + filePath = "config/db-begin-mysql.sql" + if err = ExecSql(db, filePath); err != nil { + return err + } + filePath = "config/db.sql" + if err = ExecSql(db, filePath); err != nil { + return err + } + filePath = "config/db-end-mysql.sql" + err = ExecSql(db, filePath) + } else { + err = ExecSql(db, filePath) } return err } @@ -31,7 +48,7 @@ func ExecSql(db *gorm.DB, filePath string) error { fmt.Println(sqlList[i]) continue } - sql := strings.Replace(sqlList[i]+";", "\n", "", 0) + sql := strings.Replace(sqlList[i]+";", "\n", "", -1) sql = strings.TrimSpace(sql) if err = db.Exec(sql).Error; err != nil { log.Printf("error sql: %s", sql) diff --git a/cmd/migrate/migration/models/role_dept.go b/cmd/migrate/migration/models/role_dept.go index 0a794e007..0aae7052b 100644 --- a/cmd/migrate/migration/models/role_dept.go +++ b/cmd/migrate/migration/models/role_dept.go @@ -1,6 +1,5 @@ package models -//sys_role_dept type SysRoleDept struct { RoleId int `gorm:"size:11;primaryKey"` DeptId int `gorm:"size:11;primaryKey"` diff --git a/cmd/migrate/migration/models/sys_opera_log.go b/cmd/migrate/migration/models/sys_opera_log.go index 3143dba4e..5055b96b8 100644 --- a/cmd/migrate/migration/models/sys_opera_log.go +++ b/cmd/migrate/migration/models/sys_opera_log.go @@ -10,15 +10,15 @@ type SysOperaLog struct { BusinessType string `json:"businessType" gorm:"type:varchar(128);comment:操作类型"` BusinessTypes string `json:"businessTypes" gorm:"type:varchar(128);comment:BusinessTypes"` Method string `json:"method" gorm:"type:varchar(128);comment:函数"` - RequestMethod string `json:"requestMethod" gorm:"type:varchar(128);comment:请求方式"` + RequestMethod string `json:"requestMethod" gorm:"type:varchar(128);comment:请求方式: GET POST PUT DELETE"` OperatorType string `json:"operatorType" gorm:"type:varchar(128);comment:操作类型"` OperName string `json:"operName" gorm:"type:varchar(128);comment:操作者"` DeptName string `json:"deptName" gorm:"type:varchar(128);comment:部门名称"` OperUrl string `json:"operUrl" gorm:"type:varchar(255);comment:访问地址"` OperIp string `json:"operIp" gorm:"type:varchar(128);comment:客户端ip"` OperLocation string `json:"operLocation" gorm:"type:varchar(128);comment:访问位置"` - OperParam string `json:"operParam" gorm:"type:varchar(255);comment:请求参数"` - Status string `json:"status" gorm:"type:varchar(4);comment:操作状态"` + OperParam string `json:"operParam" gorm:"type:text;comment:请求参数"` + Status string `json:"status" gorm:"type:varchar(4);comment:操作状态 1:正常 2:关闭"` OperTime time.Time `json:"operTime" gorm:"type:timestamp;comment:操作时间"` JsonResult string `json:"jsonResult" gorm:"type:varchar(255);comment:返回数据"` Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` diff --git a/cmd/migrate/migration/models/sys_user.go b/cmd/migrate/migration/models/sys_user.go index ab22a6c48..31e363759 100644 --- a/cmd/migrate/migration/models/sys_user.go +++ b/cmd/migrate/migration/models/sys_user.go @@ -11,20 +11,20 @@ type SysUser struct { Password string `json:"-" gorm:"type:varchar(128);comment:密码"` NickName string `json:"nickName" gorm:"type:varchar(128);comment:昵称"` Phone string `json:"phone" gorm:"type:varchar(11);comment:手机号"` - RoleId int `json:"roleId" gorm:"type:bigint(20);comment:角色ID"` + RoleId int `json:"roleId" gorm:"type:bigint;comment:角色ID"` Salt string `json:"-" gorm:"type:varchar(255);comment:加盐"` Avatar string `json:"avatar" gorm:"type:varchar(255);comment:头像"` Sex string `json:"sex" gorm:"type:varchar(255);comment:性别"` Email string `json:"email" gorm:"type:varchar(128);comment:邮箱"` - DeptId int `json:"deptId" gorm:"type:bigint(20);comment:部门"` - PostId int `json:"postId" gorm:"type:bigint(20);comment:岗位"` + DeptId int `json:"deptId" gorm:"type:bigint;comment:部门"` + PostId int `json:"postId" gorm:"type:bigint;comment:岗位"` Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` Status string `json:"status" gorm:"type:varchar(4);comment:状态"` ControlBy ModelTime } -func (SysUser) TableName() string { +func (*SysUser) TableName() string { return "sys_user" } @@ -45,4 +45,4 @@ func (e *SysUser) Encrypt() (err error) { func (e *SysUser) BeforeCreate(_ *gorm.DB) error { return e.Encrypt() -} \ No newline at end of file +} diff --git a/cmd/migrate/migration/version/1599190683659_tables.go b/cmd/migrate/migration/version/1599190683659_tables.go index ef3076dac..df2dafa8b 100644 --- a/cmd/migrate/migration/version/1599190683659_tables.go +++ b/cmd/migrate/migration/version/1599190683659_tables.go @@ -1,13 +1,14 @@ package version import ( + "github.com/go-admin-team/go-admin-core/sdk/config" "runtime" - "gorm.io/gorm" - "go-admin/cmd/migrate/migration" "go-admin/cmd/migrate/migration/models" common "go-admin/common/models" + + "gorm.io/gorm" ) func init() { @@ -17,8 +18,10 @@ func init() { func _1599190683659Tables(db *gorm.DB, version string) error { return db.Transaction(func(tx *gorm.DB) error { - err := tx.Debug().Migrator().AutoMigrate( - new(models.CasbinRule), + if config.DatabaseConfig.Driver == "mysql" { + tx = tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4") + } + err := tx.Migrator().AutoMigrate( new(models.SysDept), new(models.SysConfig), new(models.SysTables), @@ -41,10 +44,10 @@ func _1599190683659Tables(db *gorm.DB, version string) error { return err } if err := models.InitDb(tx); err != nil { - + return err } - return db.Create(&common.Migration{ + return tx.Create(&common.Migration{ Version: version, }).Error }) -} \ No newline at end of file +} diff --git a/cmd/migrate/migration/version/1653638869132_migrate.go b/cmd/migrate/migration/version/1653638869132_migrate.go new file mode 100644 index 000000000..59a8fa049 --- /dev/null +++ b/cmd/migrate/migration/version/1653638869132_migrate.go @@ -0,0 +1,48 @@ +package version + +import ( + "go-admin/cmd/migrate/migration/models" + common "go-admin/common/models" + "gorm.io/gorm" + "runtime" + "strconv" + + "go-admin/cmd/migrate/migration" +) + +func init() { + _, fileName, _, _ := runtime.Caller(0) + migration.Migrate.SetVersion(migration.GetFilename(fileName), _1653638869132Test) +} + +func _1653638869132Test(db *gorm.DB, version string) error { + return db.Transaction(func(tx *gorm.DB) error { + var list []models.SysMenu + err := tx.Model(&models.SysMenu{}).Order("parent_id,menu_id").Find(&list).Error + if err != nil { + return err + } + for _, v := range list { + if v.ParentId == 0 { + v.Paths = "/0/" + strconv.Itoa(v.MenuId) + } else { + var e models.SysMenu + err = tx.Model(&models.SysMenu{}).Where("menu_id=?", v.ParentId).First(&e).Error + if err != nil { + if err == gorm.ErrRecordNotFound { + continue + } + return err + } + v.Paths = e.Paths + "/" + strconv.Itoa(v.MenuId) + } + err = tx.Model(&v).Update("paths", v.Paths).Error + if err != nil { + return err + } + } + return tx.Create(&common.Migration{ + Version: version, + }).Error + }) +} diff --git a/cmd/migrate/server.go b/cmd/migrate/server.go index fa25741d0..b1667ca67 100644 --- a/cmd/migrate/server.go +++ b/cmd/migrate/server.go @@ -63,6 +63,18 @@ func migrateModel() error { host = "*" } db := sdk.Runtime.GetDbByKey(host) + if db == nil { + if len(sdk.Runtime.GetDb()) == 1 && host == "*" { + for k, v := range sdk.Runtime.GetDb() { + db = v + host = k + break + } + } + } + if db == nil { + return fmt.Errorf("未找到数据库配置") + } if config.DatabasesConfig[host].Driver == "mysql" { //初始化数据库时候用 db.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4") diff --git a/common/actions/delete.go b/common/actions/delete.go index f98e1fb04..811b9bf90 100644 --- a/common/actions/delete.go +++ b/common/actions/delete.go @@ -46,7 +46,7 @@ func DeleteAction(control dto.Control) gin.HandlerFunc { db = db.WithContext(c).Scopes( Permission(object.TableName(), p), ).Where(req.GetId()).Delete(object) - if db.Error != nil { + if err = db.Error; err != nil { log.Errorf("MsgID[%s] Delete error: %s", msgID, err) response.Error(c, 500, err, "删除失败") return diff --git a/common/actions/update.go b/common/actions/update.go index 3dd63b1e3..705233451 100644 --- a/common/actions/update.go +++ b/common/actions/update.go @@ -44,7 +44,7 @@ func UpdateAction(control dto.Control) gin.HandlerFunc { db = db.WithContext(c).Scopes( Permission(object.TableName(), p), ).Where(req.GetId()).Updates(object) - if db.Error != nil { + if err = db.Error; err != nil { log.Errorf("MsgID[%s] Update error: %s", msgID, err) response.Error(c, 500, err, "更新失败") return diff --git a/common/apis/api.go b/common/apis/api.go index 9b542b28d..4b2c58b83 100644 --- a/common/apis/api.go +++ b/common/apis/api.go @@ -27,7 +27,7 @@ func (e *Api) AddError(err error) { e.Errors = err } else if err != nil { e.Logger.Error(err) - e.Errors = fmt.Errorf("%v; %w", e.Error, err) + e.Errors = fmt.Errorf("%v; %w", e.Errors, err) } } @@ -39,7 +39,7 @@ func (e *Api) MakeContext(c *gin.Context) *Api { } // GetLogger 获取上下文提供的日志 -func (e Api) GetLogger() *logger.Helper { +func (e *Api) GetLogger() *logger.Helper { return api.GetRequestLogger(e.Context) } @@ -81,7 +81,7 @@ func (e *Api) Bind(d interface{}, bindings ...binding.Binding) *Api { } // GetOrm 获取Orm DB -func (e Api) GetOrm() (*gorm.DB, error) { +func (e *Api) GetOrm() (*gorm.DB, error) { db, err := pkg.GetOrm(e.Context) if err != nil { e.Error(500, err, "数据库连接获取失败") @@ -115,21 +115,21 @@ func (e *Api) MakeService(c *service.Service) *Api { } // Error 通常错误数据处理 -func (e Api) Error(code int, err error, msg string) { +func (e *Api) Error(code int, err error, msg string) { response.Error(e.Context, code, err, msg) } // OK 通常成功数据处理 -func (e Api) OK(data interface{}, msg string) { +func (e *Api) OK(data interface{}, msg string) { response.OK(e.Context, data, msg) } // PageOK 分页数据处理 -func (e Api) PageOK(result interface{}, count int, pageIndex int, pageSize int, msg string) { +func (e *Api) PageOK(result interface{}, count int, pageIndex int, pageSize int, msg string) { response.PageOK(e.Context, result, count, pageIndex, pageSize, msg) } // Custom 兼容函数 -func (e Api) Custom(data gin.H) { +func (e *Api) Custom(data gin.H) { response.Custum(e.Context, data) } diff --git a/common/database/initialize.go b/common/database/initialize.go index 501f523b5..22e6d6170 100644 --- a/common/database/initialize.go +++ b/common/database/initialize.go @@ -58,7 +58,7 @@ func setupSimpleDatabase(host string, c *toolsConfig.Database) { log.Info(pkg.Green(c.Driver + " connect success !")) } - e := mycasbin.Setup(db, "sys_") + e := mycasbin.Setup(db, "") sdk.Runtime.SetDb(host, db) sdk.Runtime.SetCasbin(host, e) diff --git a/common/database/open.go b/common/database/open.go index 50c10feac..de02868e4 100644 --- a/common/database/open.go +++ b/common/database/open.go @@ -1,14 +1,16 @@ -// +build !sqlite3 +//go:build !sqlite3 package database import ( "gorm.io/driver/mysql" "gorm.io/driver/postgres" + "gorm.io/driver/sqlserver" "gorm.io/gorm" ) var opens = map[string]func(string) gorm.Dialector{ - "mysql": mysql.Open, - "postgres": postgres.Open, + "mysql": mysql.Open, + "postgres": postgres.Open, + "sqlserver": sqlserver.Open, } diff --git a/common/database/open_sqlite3.go b/common/database/open_sqlite3.go index 51754190d..aaebe94d2 100644 --- a/common/database/open_sqlite3.go +++ b/common/database/open_sqlite3.go @@ -1,3 +1,4 @@ +//go:build sqlite3 // +build sqlite3 package database @@ -6,11 +7,13 @@ import ( "gorm.io/driver/mysql" "gorm.io/driver/postgres" "gorm.io/driver/sqlite" + "gorm.io/driver/sqlserver" "gorm.io/gorm" ) var opens = map[string]func(string) gorm.Dialector{ - "mysql": mysql.Open, - "postgres": postgres.Open, - "sqlite3": sqlite.Open, + "mysql": mysql.Open, + "postgres": postgres.Open, + "sqlite3": sqlite.Open, + "sqlserver": sqlserver.Open, } diff --git a/common/file_store/initialize.go b/common/file_store/initialize.go index 2190b2174..fabce9fbd 100644 --- a/common/file_store/initialize.go +++ b/common/file_store/initialize.go @@ -1,13 +1,45 @@ package file_store -type FileStore struct { +import "fmt" + +type OXS struct { + // Endpoint 访问域名 + Endpoint string + // AccessKeyID AK + AccessKeyID string + // AccessKeySecret AKS + AccessKeySecret string + // BucketName 桶名称 + BucketName string } -// Setup 配置数据库 -func (e *FileStore) Setup(driver string) { - //fileStoreType := driver - //if fileStoreType == "ALiYunOSS" { - // var store = new(ALiYunOSS) - // store.Setup() - //} +// Setup 配置文件存储driver +func (e *OXS) Setup(driver DriverType, options ...ClientOption) FileStoreType { + fileStoreType := driver + var fileStore FileStoreType + switch fileStoreType { + case AliYunOSS: + fileStore = new(ALiYunOSS) + err := fileStore.Setup(e.Endpoint, e.AccessKeyID, e.AccessKeySecret, e.BucketName) + if err != nil { + fmt.Println(err) + } + return fileStore + case HuaweiOBS: + fileStore = new(HuaWeiOBS) + err := fileStore.Setup(e.Endpoint, e.AccessKeyID, e.AccessKeySecret, e.BucketName) + if err != nil { + fmt.Println(err) + } + return fileStore + case QiNiuKodo: + fileStore = new(QiNiuKODO) + err := fileStore.Setup(e.Endpoint, e.AccessKeyID, e.AccessKeySecret, e.BucketName) + if err != nil { + fmt.Println(err) + } + return fileStore + } + + return nil } diff --git a/common/file_store/interface.go b/common/file_store/interface.go index 5ba5c4277..acecbe908 100644 --- a/common/file_store/interface.go +++ b/common/file_store/interface.go @@ -1,6 +1,27 @@ package file_store +// DriverType 驱动类型 +type DriverType string + +const ( + // HuaweiOBS 华为云OBS + HuaweiOBS DriverType = "HuaweiOBS" + // AliYunOSS 阿里云OSS + AliYunOSS DriverType = "AliYunOSS" + // QiNiuKodo 七牛云kodo + QiNiuKodo DriverType = "QiNiuKodo" +) + +type ClientOption map[string]interface{} + +// TODO: FileStoreType名称待定 + +// FileStoreType OXS type FileStoreType interface { - Setup() error - UpLoad(yourObjectName string, localFile string) error + // Setup 装载 endpoint sss + Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error + // UpLoad 上传 + UpLoad(yourObjectName string, localFile interface{}) error + // GetTempToken 获取临时Token + GetTempToken() (string, error) } diff --git a/common/file_store/kodo.go b/common/file_store/kodo.go new file mode 100644 index 000000000..db896e270 --- /dev/null +++ b/common/file_store/kodo.go @@ -0,0 +1,111 @@ +package file_store + +import ( + "context" + "fmt" + "github.com/qiniu/go-sdk/v7/auth/qbox" + "github.com/qiniu/go-sdk/v7/storage" +) + +type Zone string + +const ( + // HuaDong 华东 + HuaDong Zone = "HuaDong" + // HuaBei 华北 + HuaBei Zone = "HuaBei" + // HuaNan 华南 + HuaNan Zone = "HuaNan" + // BeiMei 北美 + BeiMei Zone = "BeiMei" + // XinJiaPo 新加坡 + XinJiaPo Zone = "XinJiaPo" +) + +type QiNiuKODO struct { + Client interface{} + BucketName string + cfg storage.Config + options []ClientOption +} + +func (e *QiNiuKODO) getToken() string { + putPolicy := storage.PutPolicy{ + Scope: e.BucketName, + } + if len(e.options) > 0 && e.options[0]["Expires"] != nil { + putPolicy.Expires = e.options[0]["Expires"].(uint64) + } + upToken := putPolicy.UploadToken(e.Client.(*qbox.Mac)) + return upToken +} + +//Setup 装载 +//endpoint sss +func (e *QiNiuKODO) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error { + + mac := qbox.NewMac(accessKeyID, accessKeySecret) + // 获取存储空间。 + cfg := storage.Config{} + // 空间对应的机房 + e.setZoneORDefault(cfg, options...) + // 是否使用https域名 + cfg.UseHTTPS = true + // 上传是否使用CDN上传加速 + cfg.UseCdnDomains = false + + e.Client = mac + e.BucketName = BucketName + e.cfg = cfg + e.options = options + return nil +} + +// setZoneORDefault 设置Zone或者默认华东 +func (e *QiNiuKODO) setZoneORDefault(cfg storage.Config, options ...ClientOption) { + if len(options) > 0 && options[0]["Zone"] != nil { + if _, ok := options[0]["Zone"].(Zone); !ok { + cfg.Zone = &storage.ZoneHuadong + } + switch options[0]["Zone"].(Zone) { + case HuaDong: + cfg.Zone = &storage.ZoneHuadong + case HuaBei: + cfg.Zone = &storage.ZoneHuabei + case HuaNan: + cfg.Zone = &storage.ZoneHuanan + case BeiMei: + cfg.Zone = &storage.ZoneBeimei + case XinJiaPo: + cfg.Zone = &storage.ZoneXinjiapo + default: + cfg.Zone = &storage.ZoneHuadong + } + } +} + +// UpLoad 文件上传 +func (e *QiNiuKODO) UpLoad(yourObjectName string, localFile interface{}) error { + + // 构建表单上传的对象 + formUploader := storage.NewFormUploader(&e.cfg) + ret := storage.PutRet{} + // 可选配置 + putExtra := storage.PutExtra{ + Params: map[string]string{ + "x:name": "github logo", + }, + } + err := formUploader.PutFile(context.Background(), &ret, e.getToken(), yourObjectName, localFile.(string), &putExtra) + if err != nil { + fmt.Println(err) + return err + } + fmt.Println(ret.Key, ret.Hash) + return nil +} + +func (e *QiNiuKODO) GetTempToken() (string, error) { + token := e.getToken() + return token, nil +} diff --git a/common/file_store/kodo_test.go b/common/file_store/kodo_test.go new file mode 100644 index 000000000..a8767ae7c --- /dev/null +++ b/common/file_store/kodo_test.go @@ -0,0 +1,23 @@ +package file_store + +import ( + "testing" +) + +func TestKODOUpload(t *testing.T) { + e := OXS{"", "", "", ""} + var oxs = e.Setup(QiNiuKodo, map[string]interface{}{"Zone": "华东"}) + err := oxs.UpLoad("test.png", "./test.png") + if err != nil { + t.Error(err) + } + t.Log("ok") +} + +func TestKODOGetTempToken(t *testing.T) { + e := OXS{"", "", "", ""} + var oxs = e.Setup(QiNiuKodo, map[string]interface{}{"Zone": "华东"}) + token, _ := oxs.GetTempToken() + t.Log(token) + t.Log("ok") +} diff --git a/common/file_store/obs.go b/common/file_store/obs.go new file mode 100644 index 000000000..e9377291f --- /dev/null +++ b/common/file_store/obs.go @@ -0,0 +1,52 @@ +package file_store + +import ( + "fmt" + "github.com/huaweicloud/huaweicloud-sdk-go-obs/obs" + "log" +) + +type HuaWeiOBS struct { + Client interface{} + BucketName string +} + +func (e *HuaWeiOBS) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error { + // 创建ObsClient结构体 + client, err := obs.New(accessKeyID, accessKeySecret, endpoint) + if err != nil { + log.Println("Error:", err) + return err + } + e.Client = client + e.BucketName = BucketName + return nil +} + +// UpLoad 文件上传 +// yourObjectName 文件路径名称,与objectKey是同一概念,表示断点续传上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg +func (e *HuaWeiOBS) UpLoad(yourObjectName string, localFile interface{}) error { + // 获取存储空间。 + input := &obs.PutFileInput{} + input.Bucket = e.BucketName + input.Key = yourObjectName + input.SourceFile = localFile.(string) + output, err := e.Client.(*obs.ObsClient).PutFile(input) + + if err == nil { + fmt.Printf("RequestId:%s\n", output.RequestId) + fmt.Printf("ETag:%s, StorageClass:%s\n", output.ETag, output.StorageClass) + } else { + if obsError, ok := err.(obs.ObsError); ok { + fmt.Println(obsError.Code) + fmt.Println(obsError.Message) + } else { + fmt.Println(err) + } + } + return nil +} + +func (e *HuaWeiOBS) GetTempToken() (string, error) { + return "", nil +} diff --git a/common/file_store/obs_test.go b/common/file_store/obs_test.go new file mode 100644 index 000000000..096075085 --- /dev/null +++ b/common/file_store/obs_test.go @@ -0,0 +1,15 @@ +package file_store + +import ( + "testing" +) + +func TestOBSUpload(t *testing.T) { + e := OXS{"", "", "", ""} + var oxs = e.Setup(HuaweiOBS) + err := oxs.UpLoad("test.png", "./test.png") + if err != nil { + t.Error(err) + } + t.Log("ok") +} diff --git a/common/file_store/oss.go b/common/file_store/oss.go index fb7a2a454..c35627b9f 100644 --- a/common/file_store/oss.go +++ b/common/file_store/oss.go @@ -6,50 +6,43 @@ import ( ) type ALiYunOSS struct { - Client interface{} - Endpoint string - AccessKeyId string - AccessKeySecret string - BucketName string + Client interface{} + BucketName string } -func (e *ALiYunOSS) Setup() error { - // TODO: 如果需要使用阿里云OSS请在此处填写对应信息 - e.AccessKeyId = "" - e.AccessKeySecret = "" - e.Endpoint = "" - e.BucketName = "" - - client, err := oss.New(e.Endpoint, e.AccessKeyId, e.AccessKeySecret) +//Setup 装载 +//endpoint sss +func (e *ALiYunOSS) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error { + client, err := oss.New(endpoint, accessKeyID, accessKeySecret) if err != nil { log.Println("Error:", err) return err } e.Client = client + e.BucketName = BucketName + return nil } // UpLoad 文件上传 -func (e *ALiYunOSS) UpLoad(yourObjectName string, localFile string) error { - err := e.Setup() - if err != nil { - log.Println("Error:", err) - return err - } +func (e *ALiYunOSS) UpLoad(yourObjectName string, localFile interface{}) error { // 获取存储空间。 bucket, err := e.Client.(*oss.Client).Bucket(e.BucketName) if err != nil { log.Println("Error:", err) return err } - // 设置分片大小为100 KB,指定分片上传并发数为3,并开启断点续传上传。 // 其中与objectKey是同一概念,表示断点续传上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。 // "LocalFile"为filePath,100*1024为partSize。 - err = bucket.UploadFile(yourObjectName, localFile, 100*1024, oss.Routines(3), oss.Checkpoint(true, "")) + err = bucket.UploadFile(yourObjectName, localFile.(string), 100*1024, oss.Routines(3), oss.Checkpoint(true, "")) if err != nil { log.Println("Error:", err) return err } return nil } + +func (e *ALiYunOSS) GetTempToken() (string, error) { + return "", nil +} diff --git a/common/file_store/oss_test.go b/common/file_store/oss_test.go new file mode 100644 index 000000000..f04dd225b --- /dev/null +++ b/common/file_store/oss_test.go @@ -0,0 +1,16 @@ +package file_store + +import ( + "testing" +) + +func TestOSSUpload(t *testing.T) { + // 打括号内填写自己的测试信息即可 + e := OXS{} + var oxs = e.Setup(AliYunOSS) + err := oxs.UpLoad("test.png", "./test.png") + if err != nil { + t.Error(err) + } + t.Log("ok") +} diff --git a/common/global/adm.go b/common/global/adm.go index e06b63e06..6b19d7c6e 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,11 +2,10 @@ package global const ( // Version go-admin version info - Version = "2.0.3" + Version = "2.2.0" ) var ( - Source string + // Driver 数据库驱动 Driver string - DBName string ) diff --git a/common/ip.go b/common/ip.go index ab3414837..ec95a8b34 100644 --- a/common/ip.go +++ b/common/ip.go @@ -6,22 +6,23 @@ import ( ) func GetClientIP(c *gin.Context) string { - ClientIP := c.ClientIP() - //fmt.Println("ClientIP:", ClientIP) - RemoteIP, _ := c.RemoteIP() - //fmt.Println("RemoteIP:", RemoteIP) + // 优先从 X-Forwarded-For 获取 IP ip := c.Request.Header.Get("X-Forwarded-For") - if strings.Contains(ip, "127.0.0.1") || ip == "" { + if ip == "" || strings.Contains(ip, "127.0.0.1") { + // 如果为空或为本地地址,则尝试从 X-Real-IP 获取 ip = c.Request.Header.Get("X-real-ip") } if ip == "" { - ip = "127.0.0.1" + // 如果仍为空,则使用 RemoteIP + ip = c.RemoteIP() } - if RemoteIP.String() != "127.0.0.1" { - ip = RemoteIP.String() + if ip == "" || ip == "127.0.0.1" { + // 如果仍为空或为本地地址,则使用 ClientIP + ip = c.ClientIP() } - if ClientIP != "127.0.0.1" { - ip = ClientIP + if ip == "" { + // 最后兜底为本地地址 + ip = "127.0.0.1" } return ip } diff --git a/common/middleware/auth.go b/common/middleware/auth.go index 95e035a1f..6562cff83 100644 --- a/common/middleware/auth.go +++ b/common/middleware/auth.go @@ -20,7 +20,7 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) { } return jwt.New(&jwt.GinJWTMiddleware{ Realm: "test zone", - Key: []byte(config.ApplicationConfig.JwtSecret), + Key: []byte(config.JwtConfig.Secret), Timeout: timeout, MaxRefresh: time.Hour, PayloadFunc: handler.PayloadFunc, @@ -33,4 +33,4 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) { TimeFunc: time.Now, }) -} +} \ No newline at end of file diff --git a/common/middleware/customerror.go b/common/middleware/customerror.go index a16dccbb2..1f9262879 100644 --- a/common/middleware/customerror.go +++ b/common/middleware/customerror.go @@ -2,8 +2,8 @@ package middleware import ( "fmt" - "go-admin/common" "net/http" + "runtime" "strconv" "strings" "time" @@ -34,14 +34,24 @@ func CustomError(c *gin.Context) { c.Request.URL, statusCode, c.Request.RequestURI, - common.GetClientIP(c), + c.ClientIP(), p[2], ) c.JSON(http.StatusOK, gin.H{ "code": statusCode, "msg": p[2], }) + } else { + c.JSON(http.StatusOK, gin.H{ + "code": 500, + "msg": errStr, + }) } + case runtime.Error: + c.JSON(http.StatusOK, gin.H{ + "code": 500, + "msg": errStr.Error(), + }) default: panic(err) } diff --git a/common/middleware/demo.go b/common/middleware/demo.go index f2cc9533e..f13f28fdb 100644 --- a/common/middleware/demo.go +++ b/common/middleware/demo.go @@ -2,25 +2,28 @@ package middleware import ( "github.com/gin-gonic/gin" + "github.com/go-admin-team/go-admin-core/sdk/config" "net/http" ) func DemoEvn() gin.HandlerFunc { return func(c *gin.Context) { method := c.Request.Method - if method == "GET" || - method == "OPTIONS" || - c.Request.RequestURI == "/api/v1/login" || - c.Request.RequestURI == "/api/v1/logout" { - c.Next() - } else { - c.JSON(http.StatusOK, gin.H{ - "code": 500, - "msg": "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600", - }) - c.Abort() - return + if config.ApplicationConfig.Mode == "demo" { + if method == "GET" || + method == "OPTIONS" || + c.Request.RequestURI == "/api/v1/login" || + c.Request.RequestURI == "/api/v1/logout" { + c.Next() + } else { + c.JSON(http.StatusOK, gin.H{ + "code": 500, + "msg": "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600", + }) + c.Abort() + return + } } - + c.Next() } -} \ No newline at end of file +} diff --git a/common/middleware/handler/auth.go b/common/middleware/handler/auth.go index 222bd65d5..ddb67917c 100644 --- a/common/middleware/handler/auth.go +++ b/common/middleware/handler/auth.go @@ -1,7 +1,6 @@ package handler import ( - "fmt" "go-admin/app/admin/models" "go-admin/common" "net/http" @@ -16,8 +15,6 @@ import ( "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user" "github.com/go-admin-team/go-admin-core/sdk/pkg/response" "github.com/mssola/user_agent" - gaConfig "go-admin/config" - "go-admin/common/global" ) @@ -96,11 +93,11 @@ func Authenticator(c *gin.Context) (interface{}, error) { return nil, jwt.ErrInvalidVerificationode } } - user, role, e := loginVals.GetUser(db) + sysUser, role, e := loginVals.GetUser(db) if e == nil { username = loginVals.Username - return map[string]interface{}{"user": user, "role": role}, nil + return map[string]interface{}{"user": sysUser, "role": role}, nil } else { msg = "登录失败" status = "1" @@ -119,8 +116,7 @@ func LoginLogToDB(c *gin.Context, status string, msg string, username string) { ua := user_agent.New(c.Request.UserAgent()) l["ipaddr"] = common.GetClientIP(c) - fmt.Println("gaConfig.ExtConfig.AMap.Key", gaConfig.ExtConfig.AMap.Key) - l["loginLocation"] = pkg.GetLocation(common.GetClientIP(c),gaConfig.ExtConfig.AMap.Key) + l["loginLocation"] = "" // pkg.GetLocation(common.GetClientIP(c),gaConfig.ExtConfig.AMap.Key) l["loginTime"] = pkg.GetCurrentTime() l["status"] = status l["remark"] = c.Request.UserAgent() diff --git a/common/middleware/handler/login.go b/common/middleware/handler/login.go index 619ac0f52..d17626c00 100644 --- a/common/middleware/handler/login.go +++ b/common/middleware/handler/login.go @@ -14,7 +14,7 @@ type Login struct { } func (u *Login) GetUser(tx *gorm.DB) (user SysUser, role SysRole, err error) { - err = tx.Table("sys_user").Where("username = ? and status = 2", u.Username).First(&user).Error + err = tx.Table("sys_user").Where("username = ? and status = '2'", u.Username).First(&user).Error if err != nil { log.Errorf("get user error, %s", err.Error()) return diff --git a/common/middleware/handler/user.go b/common/middleware/handler/user.go index 644773771..b34d4db01 100644 --- a/common/middleware/handler/user.go +++ b/common/middleware/handler/user.go @@ -28,7 +28,7 @@ type SysUser struct { models.ModelTime } -func (SysUser) TableName() string { +func (*SysUser) TableName() string { return "sys_user" } diff --git a/common/middleware/init.go b/common/middleware/init.go index c82521ad6..990269816 100644 --- a/common/middleware/init.go +++ b/common/middleware/init.go @@ -14,6 +14,7 @@ const ( ) func InitMiddleware(r *gin.Engine) { + r.Use(DemoEvn()) // 数据库链接 r.Use(WithContextDb) // 日志处理 @@ -26,10 +27,9 @@ func InitMiddleware(r *gin.Engine) { r.Use(Options) // Secure is a middleware function that appends security r.Use(Secure) - //r.Use(DemoEvn()) // 链路追踪 //r.Use(middleware.Trace()) sdk.Runtime.SetMiddleware(JwtTokenCheck, (*jwt.GinJWTMiddleware).MiddlewareFunc) sdk.Runtime.SetMiddleware(RoleCheck, AuthCheckRole()) sdk.Runtime.SetMiddleware(PermissionCheck, actions.PermissionAction()) -} \ No newline at end of file +} diff --git a/common/middleware/logger.go b/common/middleware/logger.go index e449916e2..c662edbfc 100644 --- a/common/middleware/logger.go +++ b/common/middleware/logger.go @@ -4,9 +4,8 @@ import ( "bufio" "bytes" "encoding/json" - "fmt" + "go-admin/app/admin/service/dto" "go-admin/common" - gaConfig "go-admin/config" "io" "io/ioutil" "net/http" @@ -17,7 +16,6 @@ import ( "github.com/go-admin-team/go-admin-core/sdk" "github.com/go-admin-team/go-admin-core/sdk/api" "github.com/go-admin-team/go-admin-core/sdk/config" - "github.com/go-admin-team/go-admin-core/sdk/pkg" "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user" "go-admin/common/global" @@ -93,7 +91,9 @@ func LoggerToFile() gin.HandlerFunc { "uri": reqUri, } log.WithFields(logData).Info() - + defer func() { + log.Fields(map[string]interface{}{}) + }() if c.Request.Method != "OPTIONS" && config.LoggerConfig.EnabledDB && statusCode != 404 { SetDBOperLog(c, clientIP, statusCode, reqUri, reqMethod, latencyTime, body, result, statusBus) } @@ -102,34 +102,37 @@ func LoggerToFile() gin.HandlerFunc { // SetDBOperLog 写入操作日志表 fixme 该方法后续即将弃用 func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string, reqMethod string, latencyTime time.Duration, body string, result string, status int) { + log := api.GetRequestLogger(c) l := make(map[string]interface{}) l["_fullPath"] = c.FullPath() l["operUrl"] = reqUri l["operIp"] = clientIP - fmt.Println("gaConfig.ExtConfig.AMap.Key", gaConfig.ExtConfig.AMap.Key) - l["operLocation"] = pkg.GetLocation(clientIP, gaConfig.ExtConfig.AMap.Key) + l["operLocation"] = "" // pkg.GetLocation(clientIP, gaConfig.ExtConfig.AMap.Key) l["operName"] = user.GetUserName(c) - l["requestMethod"] = c.Request.Method + l["requestMethod"] = reqMethod l["operParam"] = body l["operTime"] = time.Now() l["jsonResult"] = result l["latencyTime"] = latencyTime.String() l["statusCode"] = statusCode + l["userAgent"] = c.Request.UserAgent() + l["createBy"] = user.GetUserId(c) + l["updateBy"] = user.GetUserId(c) if status == http.StatusOK { - l["status"] = "2" + l["status"] = dto.OperaStatusEnabel } else { - l["status"] = "1" + l["status"] = dto.OperaStatusDisable } q := sdk.Runtime.GetMemoryQueue(c.Request.Host) message, err := sdk.Runtime.GetStreamMessage("", global.OperateLog, l) if err != nil { log.Errorf("GetStreamMessage error, %s", err.Error()) - //日志报错错误,不中断请求 + // 日志报错错误,不中断请求 } else { err = q.Append(message) if err != nil { log.Errorf("Append message error, %s", err.Error()) } } -} \ No newline at end of file +} diff --git a/common/middleware/sentinel.go b/common/middleware/sentinel.go index c4ea95a14..603559ac4 100644 --- a/common/middleware/sentinel.go +++ b/common/middleware/sentinel.go @@ -1,8 +1,8 @@ package middleware import ( - sentinelPlugin "github.com/alibaba/sentinel-golang/adapter/gin" "github.com/alibaba/sentinel-golang/core/system" + sentinel "github.com/alibaba/sentinel-golang/pkg/adapters/gin" "github.com/gin-gonic/gin" log "github.com/go-admin-team/go-admin-core/logger" @@ -19,5 +19,12 @@ func Sentinel() gin.HandlerFunc { }); err != nil { log.Fatalf("Unexpected error: %+v", err) } - return sentinelPlugin.SentinelMiddleware() + return sentinel.SentinelMiddleware( + sentinel.WithBlockFallback(func(ctx *gin.Context) { + ctx.AbortWithStatusJSON(200, map[string]interface{}{ + "msg": "too many request; the quota used up!", + "code": 500, + }) + }), + ) } diff --git a/common/middleware/settings.go b/common/middleware/settings.go index b333f4802..daf8d3058 100644 --- a/common/middleware/settings.go +++ b/common/middleware/settings.go @@ -38,4 +38,6 @@ var CasbinExclude = []UrlInfo{ {Url: "/", Method: "GET"}, {Url: "/api/v1/server-monitor", Method: "GET"}, {Url: "/api/v1/public/uploadFile", Method: "POST"}, + {Url: "/api/v1/user/pwd/set", Method: "PUT"}, + {Url: "/api/v1/sys-user", Method: "PUT"}, } diff --git a/common/middleware/trace.go b/common/middleware/trace.go index 84a32c804..6cce4a350 100644 --- a/common/middleware/trace.go +++ b/common/middleware/trace.go @@ -15,7 +15,7 @@ func Trace() gin.HandlerFunc { opentracing.TextMap, opentracing.HTTPHeadersCarrier(ctx.Request.Header)) if err != nil { - // If for whatever reason we can't join, go ahead an start a new root span. + // If for whatever reason we can't join, go ahead and start a new root span. sp = opentracing.StartSpan(opName) } else { sp = opentracing.StartSpan(opName, opentracing.ChildOf(wireContext)) diff --git a/common/response/binding.go b/common/response/binding.go index da8244e54..6cf279a85 100644 --- a/common/response/binding.go +++ b/common/response/binding.go @@ -17,7 +17,7 @@ const ( query ) -var constructor = &bindConstructor{} +//var constructor = &bindConstructor{} type bindConstructor struct { cache map[string][]uint8 diff --git a/common/storage/initialize.go b/common/storage/initialize.go index 6fa323dc9..f1e6933c5 100644 --- a/common/storage/initialize.go +++ b/common/storage/initialize.go @@ -1,8 +1,8 @@ /* - * @Author: lwnmengjing - * @Date: 2021/6/10 3:39 下午 - * @Last Modified by: lwnmengjing - * @Last Modified time: 2021/6/10 3:39 下午 + * @Author: zhangwenjian + * @Date: 2025/04/13 22:03 + * @Last Modified by: zhangwenjian + * @Last Modified time: 2025/04/13 22:03 */ package storage @@ -17,36 +17,34 @@ import ( // Setup 配置storage组件 func Setup() { - //4. 设置缓存 + setupCache() + setupCaptcha() + setupQueue() +} + +func setupCache() { cacheAdapter, err := config.CacheConfig.Setup() if err != nil { log.Fatalf("cache setup error, %s\n", err.Error()) } sdk.Runtime.SetCacheAdapter(cacheAdapter) - //5. 设置验证码store - captcha.SetStore(captcha.NewCacheStore(cacheAdapter, 600)) +} - //6. 设置队列 - if !config.QueueConfig.Empty() { - if q := sdk.Runtime.GetQueueAdapter(); q != nil { - q.Shutdown() - } - queueAdapter, err := config.QueueConfig.Setup() - if err != nil { - log.Fatalf("queue setup error, %s\n", err.Error()) - } - sdk.Runtime.SetQueueAdapter(queueAdapter) - defer func() { - go queueAdapter.Run() - }() - } +func setupCaptcha() { + captcha.SetStore(captcha.NewCacheStore(sdk.Runtime.GetCacheAdapter(), 600)) +} - //7. 设置分布式锁 - if !config.LockerConfig.Empty() { - lockerAdapter, err := config.LockerConfig.Setup() - if err != nil { - log.Fatalf("locker setup error, %s\n", err.Error()) - } - sdk.Runtime.SetLockerAdapter(lockerAdapter) +func setupQueue() { + if config.QueueConfig.Empty() { + return + } + if q := sdk.Runtime.GetQueueAdapter(); q != nil { + q.Shutdown() + } + queueAdapter, err := config.QueueConfig.Setup() + if err != nil { + log.Fatalf("queue setup error, %s\n", err.Error()) } + sdk.Runtime.SetQueueAdapter(queueAdapter) + go queueAdapter.Run() } diff --git a/config/READMEN.md b/config/READMEN.md index 8ff880d1e..154119e01 100644 --- a/config/READMEN.md +++ b/config/READMEN.md @@ -5,7 +5,7 @@ settings: application: # 项目启动环境 - mode: dev # dev开发环境 test测试环境 prod线上环境; + mode: dev # dev开发环境 prod线上环境; host: 0.0.0.0 # 主机ip 或者域名,默认0.0.0.0 # 服务名称 name: go-admin diff --git a/config/db-begin-mysql.sql b/config/db-begin-mysql.sql new file mode 100644 index 000000000..04da2f1a2 --- /dev/null +++ b/config/db-begin-mysql.sql @@ -0,0 +1,2 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; \ No newline at end of file diff --git a/config/db-end-mysql.sql b/config/db-end-mysql.sql new file mode 100644 index 000000000..4bd9d01eb --- /dev/null +++ b/config/db-end-mysql.sql @@ -0,0 +1 @@ +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/config/db-sqlserver.sql b/config/db-sqlserver.sql new file mode 100644 index 000000000..0ba4168c0 --- /dev/null +++ b/config/db-sqlserver.sql @@ -0,0 +1,342 @@ +-- 开始初始化数据 ; +SET IDENTITY_INSERT sys_api ON; +INSERT INTO sys_api (id, handle, title, path, type, "action", created_at, updated_at, deleted_at, create_by, update_by)VALUES +(5, 'go-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', NULL, 0, 0), +(6, 'go-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', NULL, 0, 0), +(7, 'go-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', NULL, 0, 0), +(8, 'go-admin/common/actions.IndexAction.func1', '分类列表', '/api/v1/syscategory', 'BUS', 'GET', '2021-05-13 19:59:00.870', '2021-06-13 20:53:47.883', NULL, 0, 0), +(9, 'go-admin/common/actions.ViewAction.func1', '分类通过id获取', '/api/v1/syscategory/:id', 'BUS', 'GET', '2021-05-13 19:59:00.945', '2021-06-13 20:53:47.926', NULL, 0, 0), +(10, 'go-admin/common/actions.IndexAction.func1', '内容列表', '/api/v1/syscontent', 'BUS', 'GET', '2021-05-13 19:59:01.005', '2021-06-13 20:53:47.966', NULL, 0, 0), +(11, 'go-admin/common/actions.ViewAction.func1', '内容通过id获取', '/api/v1/syscontent/:id', 'BUS', 'GET', '2021-05-13 19:59:01.056', '2021-06-13 20:53:48.005', NULL, 0, 0), +(15, 'go-admin/common/actions.IndexAction.func1', 'job列表', '/api/v1/sysjob', 'BUS', 'GET', '2021-05-13 19:59:01.248', '2021-06-13 20:53:48.169', NULL, 0, 0), +(16, 'go-admin/common/actions.ViewAction.func1', 'job通过id获取', '/api/v1/sysjob/:id', 'BUS', 'GET', '2021-05-13 19:59:01.298', '2021-06-13 20:53:48.214', NULL, 0, 0), +(21, 'go-admin/app/admin/apis.SysDictType.GetPage-fm', '字典类型列表', '/api/v1/dict/type', 'BUS', 'GET', '2021-05-13 19:59:01.525', '2021-06-17 11:48:40.732', NULL, 0, 0), +(22, 'go-admin/app/admin/apis.SysDictType.GetAll-fm', '字典类型查询【代码生成】', '/api/v1/dict/type-option-select', 'SYS', 'GET', '2021-05-13 19:59:01.582', '2021-06-13 20:53:48.388', NULL, 0, 0), +(23, 'go-admin/app/admin/apis.SysDictType.Get-fm', '字典类型通过id获取', '/api/v1/dict/type/:id', 'BUS', 'GET', '2021-05-13 19:59:01.632', '2021-06-17 11:48:40.732', NULL, 0, 0), +(24, 'go-admin/app/admin/apis.SysDictData.GetPage-fm', '字典数据列表', '/api/v1/dict/data', 'BUS', 'GET', '2021-05-13 19:59:01.684', '2021-06-17 11:48:40.732', NULL, 0, 0), +(25, 'go-admin/app/admin/apis.SysDictData.Get-fm', '字典数据通过code获取', '/api/v1/dict/data/:dictCode', 'BUS', 'GET', '2021-05-13 19:59:01.732', '2021-06-17 11:48:40.732', NULL, 0, 0), +(26, 'go-admin/app/admin/apis.SysDictData.GetSysDictDataAll-fm', '数据字典根据key获取', '/api/v1/dict-data/option-select', 'SYS', 'GET', '2021-05-13 19:59:01.832', '2021-06-17 11:48:40.732', NULL, 0, 0), +(27, 'go-admin/app/admin/apis.SysDept.GetPage-fm', '部门列表', '/api/v1/dept', 'BUS', 'GET', '2021-05-13 19:59:01.940', '2021-06-17 11:48:40.732', NULL, 0, 0), +(28, 'go-admin/app/admin/apis.SysDept.Get-fm', '部门通过id获取', '/api/v1/dept/:id', 'BUS', 'GET', '2021-05-13 19:59:02.009', '2021-06-17 11:48:40.732', NULL, 0, 0), +(29, 'go-admin/app/admin/apis.SysDept.Get2Tree-fm', '查询部门下拉树【角色权限-自定权限】', '/api/v1/deptTree', 'SYS', 'GET', '2021-05-13 19:59:02.050', '2021-06-17 11:48:40.732', NULL, 0, 0), +(30, 'go-admin/app/admin/apis/tools.(*Gen).GetDBTableList-fm', '数据库表列表', '/api/v1/db/tables/page', 'SYS', 'GET', '2021-05-13 19:59:02.098', '2021-06-13 20:53:48.730', NULL, 0, 0), +(31, 'go-admin/app/admin/apis/tools.(*Gen).GetDBColumnList-fm', '数据表列列表', '/api/v1/db/columns/page', 'SYS', 'GET', '2021-05-13 19:59:02.140', '2021-06-13 20:53:48.771', NULL, 0, 0), +(32, 'go-admin/app/admin/apis/tools.Gen.GenCode-fm', '数据库表生成到项目', '/api/v1/gen/toproject/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.183', '2021-06-13 20:53:48.812', NULL, 0, 0), +(33, 'go-admin/app/admin/apis/tools.Gen.GenMenuAndApi-fm', '数据库表生成到DB', '/api/v1/gen/todb/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.227', '2021-06-13 20:53:48.853', NULL, 0, 0), +(34, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesTree-fm', '关系表数据【代码生成】', '/api/v1/gen/tabletree', 'SYS', 'GET', '2021-05-13 19:59:02.271', '2021-06-13 20:53:48.893', NULL, 0, 0), +(35, 'go-admin/app/admin/apis/tools.Gen.Preview-fm', '生成预览通过id获取', '/api/v1/gen/preview/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.315', '2021-06-13 20:53:48.935', NULL, 0, 0), +(36, 'go-admin/app/admin/apis/tools.Gen.GenApiToFile-fm', '生成api带文件', '/api/v1/gen/apitofile/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.357', '2021-06-13 20:53:48.977', NULL, 0, 0), +(37, 'go-admin/app/admin/apis.System.GenerateCaptchaHandler-fm', '验证码获取', '/api/v1/getCaptcha', 'SYS', 'GET', '2021-05-13 19:59:02.405', '2021-06-13 20:53:49.020', NULL, 0, 0), +(38, 'go-admin/app/admin/apis.SysUser.GetInfo-fm', '用户信息获取', '/api/v1/getinfo', 'SYS', 'GET', '2021-05-13 19:59:02.447', '2021-06-13 20:53:49.065', NULL, 0, 0), +(39, 'go-admin/app/admin/apis.SysMenu.GetPage-fm', '菜单列表', '/api/v1/menu', 'BUS', 'GET', '2021-05-13 19:59:02.497', '2021-06-17 11:48:40.732', NULL, 0, 0), +(40, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '查询菜单下拉树结构【废弃】', '/api/v1/menuTreeselect', 'SYS', 'GET', '2021-05-13 19:59:02.542', '2021-06-03 22:37:21.857', NULL, 0, 0), +(41, 'go-admin/app/admin/apis.SysMenu.Get-fm', '菜单通过id获取', '/api/v1/menu/:id', 'BUS', 'GET', '2021-05-13 19:59:02.584', '2021-06-17 11:48:40.732', NULL, 0, 0), +(42, 'go-admin/app/admin/apis.SysMenu.GetMenuRole-fm', '角色菜单【顶部左侧菜单】', '/api/v1/menurole', 'SYS', 'GET', '2021-05-13 19:59:02.630', '2021-06-13 20:53:49.574', NULL, 0, 0), +(43, 'go-admin/app/admin/apis.SysMenu.GetMenuIDS-fm', '获取角色对应的菜单id数组【废弃】', '/api/v1/menuids', 'SYS', 'GET', '2021-05-13 19:59:02.675', '2021-06-03 22:39:52.500', NULL, 0, 0), +(44, 'go-admin/app/admin/apis.SysRole.GetPage-fm', '角色列表', '/api/v1/role', 'BUS', 'GET', '2021-05-13 19:59:02.720', '2021-06-17 11:48:40.732', NULL, 0, 0), +(45, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '菜单权限列表【角色配菜单使用】', '/api/v1/roleMenuTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.762', '2021-06-17 11:48:40.732', NULL, 0, 0), +(46, 'go-admin/app/admin/apis.SysDept.GetDeptTreeRoleSelect-fm', '角色部门结构树【自定义数据权限】', '/api/v1/roleDeptTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.809', '2021-06-17 11:48:40.732', NULL, 0, 0), +(47, 'go-admin/app/admin/apis.SysRole.Get-fm', '角色通过id获取', '/api/v1/role/:id', 'BUS', 'GET', '2021-05-13 19:59:02.850', '2021-06-17 11:48:40.732', NULL, 0, 0), +(48, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).RefreshHandler-fm', '刷新token', '/api/v1/refresh_token', 'SYS', 'GET', '2021-05-13 19:59:02.892', '2021-06-13 20:53:49.278', NULL, 0, 0), +(53, 'go-admin/app/admin/apis.SysConfig.GetPage-fm', '参数列表', '/api/v1/config', 'BUS', 'GET', '2021-05-13 19:59:03.116', '2021-06-17 11:48:40.732', NULL, 0, 0), +(54, 'go-admin/app/admin/apis.SysConfig.Get-fm', '参数通过id获取', '/api/v1/config/:id', 'BUS', 'GET', '2021-05-13 19:59:03.157', '2021-06-17 11:48:40.732', NULL, 0, 0), +(55, 'go-admin/app/admin/apis.SysConfig.GetSysConfigByKEYForService-fm', '参数通过键名搜索【基础默认配置】', '/api/v1/configKey/:configKey', 'SYS', 'GET', '2021-05-13 19:59:03.198', '2021-06-13 20:53:49.745', NULL, 0, 0), +(57, 'go-admin/app/jobs/apis.SysJob.RemoveJobForService-fm', 'job移除', '/api/v1/job/remove/:id', 'BUS', 'GET', '2021-05-13 19:59:03.295', '2021-06-13 20:53:49.786', NULL, 0, 0), +(58, 'go-admin/app/jobs/apis.SysJob.StartJobForService-fm', 'job启动', '/api/v1/job/start/:id', 'BUS', 'GET', '2021-05-13 19:59:03.339', '2021-06-13 20:53:49.829', NULL, 0, 0), +(59, 'go-admin/app/admin/apis.SysPost.GetPage-fm', '岗位列表', '/api/v1/post', 'BUS', 'GET', '2021-05-13 19:59:03.381', '2021-06-17 11:48:40.732', NULL, 0, 0), +(60, 'go-admin/app/admin/apis.SysPost.Get-fm', '岗位通过id获取', '/api/v1/post/:id', 'BUS', 'GET', '2021-05-13 19:59:03.433', '2021-06-17 11:48:40.732', NULL, 0, 0), +(62, 'go-admin/app/admin/apis.SysConfig.GetSysConfigBySysApp-fm', '系统前端参数', '/api/v1/app-config', 'SYS', 'GET', '2021-05-13 19:59:03.526', '2021-06-13 20:53:49.994', NULL, 0, 0), +(63, 'go-admin/app/admin/apis.SysUser.GetProfile-fm', '*用户信息获取', '/api/v1/user/profile', 'SYS', 'GET', '2021-05-13 19:59:03.567', '2021-06-13 20:53:50.038', NULL, 0, 0), +(66, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).WsClient-fm', '链接ws【定时任务log】', '/ws/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.705', '2021-06-13 20:53:50.167', NULL, 0, 0), +(67, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).UnWsClient-fm', '退出ws【定时任务log】', '/wslogout/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.756', '2021-06-13 20:53:50.209', NULL, 0, 0), +(68, 'go-admin/common/middleware/handler.Ping', '*用户基本信息', '/info', 'SYS', 'GET', '2021-05-13 19:59:03.800', '2021-06-13 20:53:50.251', NULL, 0, 0), +(72, 'go-admin/common/actions.CreateAction.func1', '分类创建', '/api/v1/syscategory', 'BUS', 'POST', '2021-05-13 19:59:03.982', '2021-06-13 20:53:50.336', NULL, 0, 0), +(73, 'go-admin/common/actions.CreateAction.func1', '内容创建', '/api/v1/syscontent', 'BUS', 'POST', '2021-05-13 19:59:04.027', '2021-06-13 20:53:50.375', NULL, 0, 0), +(76, 'go-admin/common/actions.CreateAction.func1', 'job创建', '/api/v1/sysjob', 'BUS', 'POST', '2021-05-13 19:59:04.164', '2021-06-13 20:53:50.500', NULL, 0, 0), +(80, 'go-admin/app/admin/apis.SysDictData.Insert-fm', '字典数据创建', '/api/v1/dict/data', 'BUS', 'POST', '2021-05-13 19:59:04.347', '2021-06-17 11:48:40.732', NULL, 0, 0), +(81, 'go-admin/app/admin/apis.SysDictType.Insert-fm', '字典类型创建', '/api/v1/dict/type', 'BUS', 'POST', '2021-05-13 19:59:04.391', '2021-06-17 11:48:40.732', NULL, 0, 0), +(82, 'go-admin/app/admin/apis.SysDept.Insert-fm', '部门创建', '/api/v1/dept', 'BUS', 'POST', '2021-05-13 19:59:04.435', '2021-06-17 11:48:40.732', NULL, 0, 0), +(85, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).LoginHandler-fm', '*登录', '/api/v1/login', 'SYS', 'POST', '2021-05-13 19:59:04.597', '2021-06-13 20:53:50.784', NULL, 0, 0), +(86, 'go-admin/common/middleware/handler.LogOut', '*退出', '/api/v1/logout', 'SYS', 'POST', '2021-05-13 19:59:04.642', '2021-06-13 20:53:50.824', NULL, 0, 0), +(87, 'go-admin/app/admin/apis.SysConfig.Insert-fm', '参数创建', '/api/v1/config', 'BUS', 'POST', '2021-05-13 19:59:04.685', '2021-06-17 11:48:40.732', NULL, 0, 0), +(88, 'go-admin/app/admin/apis.SysMenu.Insert-fm', '菜单创建', '/api/v1/menu', 'BUS', 'POST', '2021-05-13 19:59:04.777', '2021-06-17 11:48:40.732', NULL, 0, 0), +(89, 'go-admin/app/admin/apis.SysPost.Insert-fm', '岗位创建', '/api/v1/post', 'BUS', 'POST', '2021-05-13 19:59:04.886', '2021-06-17 11:48:40.732', NULL, 0, 0), +(90, 'go-admin/app/admin/apis.SysRole.Insert-fm', '角色创建', '/api/v1/role', 'BUS', 'POST', '2021-05-13 19:59:04.975', '2021-06-17 11:48:40.732', NULL, 0, 0), +(91, 'go-admin/app/admin/apis.SysUser.InsetAvatar-fm', '*用户头像编辑', '/api/v1/user/avatar', 'SYS', 'POST', '2021-05-13 19:59:05.058', '2021-06-13 20:53:51.079', NULL, 0, 0), +(92, 'go-admin/app/admin/apis.SysApi.Update-fm', '接口编辑', '/api/v1/sys-api/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.122', '2021-06-17 11:48:40.732', NULL, 0, 0), +(95, 'go-admin/common/actions.UpdateAction.func1', '分类编辑', '/api/v1/syscategory/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.255', '2021-06-13 20:53:51.247', NULL, 0, 0), +(96, 'go-admin/common/actions.UpdateAction.func1', '内容编辑', '/api/v1/syscontent/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.299', '2021-06-13 20:53:51.289', NULL, 0, 0), +(97, 'go-admin/common/actions.UpdateAction.func1', 'job编辑', '/api/v1/sysjob', 'BUS', 'PUT', '2021-05-13 19:59:05.343', '2021-06-13 20:53:51.331', NULL, 0, 0), +(101, 'go-admin/app/admin/apis.SysDictData.Update-fm', '字典数据编辑', '/api/v1/dict/data/:dictCode', 'BUS', 'PUT', '2021-05-13 19:59:05.519', '2021-06-17 11:48:40.732', NULL, 0, 0), +(102, 'go-admin/app/admin/apis.SysDictType.Update-fm', '字典类型编辑', '/api/v1/dict/type/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.569', '2021-06-17 11:48:40.732', NULL, 0, 0), +(103, 'go-admin/app/admin/apis.SysDept.Update-fm', '部门编辑', '/api/v1/dept/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.613', '2021-06-17 11:48:40.732', NULL, 0, 0), +(104, 'go-admin/app/other/apis.SysFileDir.Update-fm', '文件夹编辑', '/api/v1/file-dir/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.662', '2021-06-13 20:53:51.847', NULL, 0, 0), +(105, 'go-admin/app/other/apis.SysFileInfo.Update-fm', '文件编辑', '/api/v1/file-info/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.709', '2021-06-13 20:53:51.892', NULL, 0, 0), +(106, 'go-admin/app/admin/apis.SysRole.Update-fm', '角色编辑', '/api/v1/role/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.752', '2021-06-17 11:48:40.732', NULL, 0, 0), +(107, 'go-admin/app/admin/apis.SysRole.Update2DataScope-fm', '角色数据权限修改', '/api/v1/roledatascope', 'BUS', 'PUT', '2021-05-13 19:59:05.803', '2021-06-17 11:48:40.732', NULL, 0, 0), +(108, 'go-admin/app/admin/apis.SysConfig.Update-fm', '参数编辑', '/api/v1/config/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.848', '2021-06-17 11:48:40.732', NULL, 0, 0), +(109, 'go-admin/app/admin/apis.SysMenu.Update-fm', '编辑菜单', '/api/v1/menu/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.891', '2021-06-17 11:48:40.732', NULL, 0, 0), +(110, 'go-admin/app/admin/apis.SysPost.Update-fm', '岗位编辑', '/api/v1/post/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.934', '2021-06-17 11:48:40.732', NULL, 0, 0), +(111, 'go-admin/app/admin/apis.SysUser.UpdatePwd-fm', '*用户修改密码', '/api/v1/user/pwd', 'SYS', 'PUT', '2021-05-13 19:59:05.987', '2021-06-13 20:53:51.724', NULL, 0, 0), +(112, 'go-admin/common/actions.DeleteAction.func1', '分类删除', '/api/v1/syscategory', 'BUS', 'DELETE', '2021-05-13 19:59:06.030', '2021-06-13 20:53:52.237', NULL, 0, 0), +(113, 'go-admin/common/actions.DeleteAction.func1', '内容删除', '/api/v1/syscontent', 'BUS', 'DELETE', '2021-05-13 19:59:06.076', '2021-06-13 20:53:52.278', NULL, 0, 0), +(114, 'go-admin/app/admin/apis.SysLoginLog.Delete-fm', '登录日志删除', '/api/v1/sys-login-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.118', '2021-06-17 11:48:40.732', NULL, 0, 0), +(115, 'go-admin/app/admin/apis.SysOperaLog.Delete-fm', '操作日志删除', '/api/v1/sys-opera-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.162', '2021-06-17 11:48:40.732', NULL, 0, 0), +(116, 'go-admin/common/actions.DeleteAction.func1', 'job删除', '/api/v1/sysjob', 'BUS', 'DELETE', '2021-05-13 19:59:06.206', '2021-06-13 20:53:52.323', NULL, 0, 0), +(117, 'go-admin/app/other/apis.SysChinaAreaData.Delete-fm', '行政区删除', '/api/v1/sys-area-data', 'BUS', 'DELETE', '2021-05-13 19:59:06.249', '2021-06-13 20:53:52.061', NULL, 0, 0), +(120, 'go-admin/app/admin/apis.SysDictData.Delete-fm', '字典数据删除', '/api/v1/dict/data', 'BUS', 'DELETE', '2021-05-13 19:59:06.387', '2021-06-17 11:48:40.732', NULL, 0, 0), +(121, 'go-admin/app/admin/apis.SysDictType.Delete-fm', '字典类型删除', '/api/v1/dict/type', 'BUS', 'DELETE', '2021-05-13 19:59:06.432', '2021-06-17 11:48:40.732', NULL, 0, 0), +(122, 'go-admin/app/admin/apis.SysDept.Delete-fm', '部门删除', '/api/v1/dept/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.475', '2021-06-17 11:48:40.732', NULL, 0, 0), +(123, 'go-admin/app/other/apis.SysFileDir.Delete-fm', '文件夹删除', '/api/v1/file-dir/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.520', '2021-06-13 20:53:52.539', NULL, 0, 0), +(124, 'go-admin/app/other/apis.SysFileInfo.Delete-fm', '文件删除', '/api/v1/file-info/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.566', '2021-06-13 20:53:52.580', NULL, 0, 0), +(125, 'go-admin/app/admin/apis.SysConfig.Delete-fm', '参数删除', '/api/v1/config', 'BUS', 'DELETE', '2021-05-13 19:59:06.612', '2021-06-17 11:48:40.732', NULL, 0, 0), +(126, 'go-admin/app/admin/apis.SysMenu.Delete-fm', '删除菜单', '/api/v1/menu', 'BUS', 'DELETE', '2021-05-13 19:59:06.654', '2021-06-17 11:48:40.732', NULL, 0, 0), +(127, 'go-admin/app/admin/apis.SysPost.Delete-fm', '岗位删除', '/api/v1/post/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.702', '2021-06-17 11:48:40.732', NULL, 0, 0), +(128, 'go-admin/app/admin/apis.SysRole.Delete-fm', '角色删除', '/api/v1/role', 'BUS', 'DELETE', '2021-05-13 19:59:06.746', '2021-06-17 11:48:40.732', NULL, 0, 0), +(131, 'github.com/go-admin-team/go-admin-core/tools/transfer.Handler.func1', '系统指标', '/api/v1/metrics', 'SYS', 'GET', '2021-05-17 22:13:55.933', '2021-06-13 20:53:49.614', NULL, 0, 0), +(132, 'go-admin/app/other/router.registerMonitorRouter.func1', '健康状态', '/api/v1/health', 'SYS', 'GET', '2021-05-17 22:13:56.285', '2021-06-13 20:53:49.951', NULL, 0, 0), +(133, 'go-admin/app/admin/apis.HelloWorld', '项目默认接口', '/', 'SYS', 'GET', '2021-05-24 10:30:44.553', '2021-06-13 20:53:47.406', NULL, 0, 0), +(134, 'go-admin/app/other/apis.ServerMonitor.ServerInfo-fm', '服务器基本状态', '/api/v1/server-monitor', 'SYS', 'GET', '2021-05-24 10:30:44.937', '2021-06-13 20:53:48.255', NULL, 0, 0), +(135, 'go-admin/app/admin/apis.SysApi.GetPage-fm', '接口列表', '/api/v1/sys-api', 'BUS', 'GET', '2021-05-24 11:37:53.303', '2021-06-17 11:48:40.732', NULL, 0, 0), +(136, 'go-admin/app/admin/apis.SysApi.Get-fm', '接口通过id获取', '/api/v1/sys-api/:id', 'BUS', 'GET', '2021-05-24 11:37:53.359', '2021-06-17 11:48:40.732', NULL, 0, 0), +(137, 'go-admin/app/admin/apis.SysLoginLog.GetPage-fm', '登录日志列表', '/api/v1/sys-login-log', 'BUS', 'GET', '2021-05-24 11:47:30.397', '2021-06-17 11:48:40.732', NULL, 0, 0), +(138, 'go-admin/app/other/apis.File.UploadFile-fm', '文件上传', '/api/v1/public/uploadFile', 'SYS', 'POST', '2021-05-25 19:16:18.493', '2021-06-13 20:53:50.866', NULL, 0, 0), +(139, 'go-admin/app/admin/apis.SysConfig.Update2Set-fm', '参数信息修改【参数配置】', '/api/v1/set-config', 'BUS', 'PUT', '2021-05-27 09:45:14.853', '2021-06-17 11:48:40.732', NULL, 0, 0), +(140, 'go-admin/app/admin/apis.SysConfig.Get2Set-fm', '参数获取全部【配置使用】', '/api/v1/set-config', 'BUS', 'GET', '2021-05-27 11:54:14.384', '2021-06-17 11:48:40.732', NULL, 0, 0), +(141, 'go-admin/app/admin/apis.SysUser.GetPage-fm', '管理员列表', '/api/v1/sys-user', 'BUS', 'GET', '2021-06-13 19:24:57.111', '2021-06-17 20:31:14.318', NULL, 0, 0), +(142, 'go-admin/app/admin/apis.SysUser.Get-fm', '管理员通过id获取', '/api/v1/sys-user/:id', 'BUS', 'GET', '2021-06-13 19:24:57.188', '2021-06-17 20:31:14.318', NULL, 0, 0), +(143, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesInfo-fm', '', '/api/v1/sys/tables/info', '', 'GET', '2021-06-13 19:24:57.437', '2021-06-13 20:53:48.047', NULL, 0, 0), +(144, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'GET', '2021-06-13 19:24:57.510', '2021-06-13 20:53:48.088', NULL, 0, 0), +(145, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTableList-fm', '', '/api/v1/sys/tables/page', '', 'GET', '2021-06-13 19:24:57.582', '2021-06-13 20:53:48.128', NULL, 0, 0), +(146, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'GET', '2021-06-13 19:24:59.641', '2021-06-13 20:53:50.081', NULL, 0, 0), +(147, 'github.com/swaggo/gin-swagger.CustomWrapHandler.func1', '', '/swagger/*any', '', 'GET', '2021-06-13 19:24:59.713', '2021-06-13 20:53:50.123', NULL, 0, 0), +(148, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'GET', '2021-06-13 19:24:59.914', '2021-06-13 20:53:50.295', NULL, 0, 0), +(149, 'go-admin/app/admin/apis/tools.(*SysTable).InsertSysTable-fm', '', '/api/v1/sys/tables/info', '', 'POST', '2021-06-13 19:25:00.163', '2021-06-13 20:53:50.539', NULL, 0, 0), +(150, 'go-admin/app/admin/apis.SysUser.Insert-fm', '管理员创建', '/api/v1/sys-user', 'BUS', 'POST', '2021-06-13 19:25:00.233', '2021-06-17 20:31:14.318', NULL, 0, 0), +(151, 'go-admin/app/admin/apis.SysUser.Update-fm', '管理员编辑', '/api/v1/sys-user', 'BUS', 'PUT', '2021-06-13 19:25:00.986', '2021-06-17 20:31:14.318', NULL, 0, 0), +(152, 'go-admin/app/admin/apis/tools.(*SysTable).UpdateSysTable-fm', '', '/api/v1/sys/tables/info', '', 'PUT', '2021-06-13 19:25:01.149', '2021-06-13 20:53:51.375', NULL, 0, 0), +(153, 'go-admin/app/admin/apis.SysRole.Update2Status-fm', '', '/api/v1/role-status', '', 'PUT', '2021-06-13 19:25:01.446', '2021-06-13 20:53:51.636', NULL, 0, 0), +(154, 'go-admin/app/admin/apis.SysUser.ResetPwd-fm', '', '/api/v1/user/pwd/reset', '', 'PUT', '2021-06-13 19:25:01.601', '2021-06-13 20:53:51.764', NULL, 0, 0), +(155, 'go-admin/app/admin/apis.SysUser.UpdateStatus-fm', '', '/api/v1/user/status', '', 'PUT', '2021-06-13 19:25:01.671', '2021-06-13 20:53:51.806', NULL, 0, 0), +(156, 'go-admin/app/admin/apis.SysUser.Delete-fm', '管理员删除', '/api/v1/sys-user', 'BUS', 'DELETE', '2021-06-13 19:25:02.043', '2021-06-17 20:31:14.318', NULL, 0, 0), +(157, 'go-admin/app/admin/apis/tools.(*SysTable).DeleteSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'DELETE', '2021-06-13 19:25:02.283', '2021-06-13 20:53:52.367', NULL, 0, 0), +(158, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'HEAD', '2021-06-13 19:25:02.734', '2021-06-13 20:53:52.791', NULL, 0, 0), +(159, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'HEAD', '2021-06-13 19:25:02.808', '2021-06-13 20:53:52.838', NULL, 0, 0); +SET IDENTITY_INSERT sys_api OFF; + +INSERT INTO sys_config VALUES +(1, '皮肤样式', 'sys_index_skinName', 'skin-green', 'Y', '0', '主框架页-默认皮肤样式名称:蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 13:50:13.123', NULL), +(2, '初始密码', 'sys_user_initPassword', '123456', 'Y', '0', '用户管理-账号初始密码:123456', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL), +(3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL), +(4, '系统名称', 'sys_app_name', 'go-admin管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2021-05-28 10:08:25.248', NULL), +(5, '系统logo', 'sys_app_logo', 'https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); + +SET IDENTITY_INSERT sys_dept ON; +INSERT INTO sys_dept (dept_id, parent_id, dept_path, dept_name, sort, leader, phone, email, status, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(1, 0, '/0/1/', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:06:44.960', NULL), +(7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', NULL), +(8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', NULL), +(9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', NULL), +(10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', '1', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', NULL); +SET IDENTITY_INSERT sys_dept OFF; + +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, + status, "default", remark, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(1, 0, '正常', '2', 'sys_normal_disable', '', '', '', '2', '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', NULL); +INSERT INTO sys_dict_data VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', '2', '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', '2', '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (4, 0, '女', '1', 'sys_user_sex', '', '', '', '2', '', '性别女', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (5, 0, '未知', '2', 'sys_user_sex', '', '', '', '2', '', '性别未知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (6, 0, '显示', '0', 'sys_show_hide', '', '', '', '2', '', '显示菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (7, 0, '隐藏', '1', 'sys_show_hide', '', '', '', '2', '', '隐藏菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (8, 0, '是', 'Y', 'sys_yes_no', '', '', '', '2', '', '系统默认是', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (9, 0, '否', 'N', 'sys_yes_no', '', '', '', '2', '', '系统默认否', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (10, 0, '正常', '2', 'sys_job_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (11, 0, '停用', '1', 'sys_job_status', '', '', '', '2', '', '停用状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (12, 0, '默认', 'DEFAULT', 'sys_job_group', '', '', '', '2', '', '默认分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (13, 0, '系统', 'SYSTEM', 'sys_job_group', '', '', '', '2', '', '系统分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (14, 0, '通知', '1', 'sys_notice_type', '', '', '', '2', '', '通知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (15, 0, '公告', '2', 'sys_notice_type', '', '', '', '2', '', '公告', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (16, 0, '正常', '2', 'sys_common_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (17, 0, '关闭', '1', 'sys_common_status', '', '', '', '2', '', '关闭状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (18, 0, '新增', '1', 'sys_oper_type', '', '', '', '2', '', '新增操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (19, 0, '修改', '2', 'sys_oper_type', '', '', '', '2', '', '修改操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (20, 0, '删除', '3', 'sys_oper_type', '', '', '', '2', '', '删除操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (21, 0, '授权', '4', 'sys_oper_type', '', '', '', '2', '', '授权操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (22, 0, '导出', '5', 'sys_oper_type', '', '', '', '2', '', '导出操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (23, 0, '导入', '6', 'sys_oper_type', '', '', '', '2', '', '导入操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (24, 0, '强退', '7', 'sys_oper_type', '', '', '', '2', '', '强退操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (25, 0, '生成代码', '8', 'sys_oper_type', '', '', '', '2', '', '生成操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (26, 0, '清空数据', '9', 'sys_oper_type', '', '', '', '2', '', '清空操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (27, 0, '成功', '0', 'sys_notice_status', '', '', '', '2', '', '成功状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (28, 0, '失败', '1', 'sys_notice_status', '', '', '', '2', '', '失败状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (29, 0, '登录', '10', 'sys_oper_type', '', '', '', '2', '', '登录操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (30, 0, '退出', '11', 'sys_oper_type', '', '', '', '2', '', '', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', '2', '', '获取验证码', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (32, 0, '正常', '1', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); +INSERT INTO sys_dict_data VALUES (33, 1, '禁用', '2', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); + + +INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, remark, create_by, update_by, created_at, updated_at, + deleted_at)VALUES (1, '系统开关', 'sys_normal_disable', '2', '系统开关列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (2, '用户性别', 'sys_user_sex', '2', '用户性别列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (3, '菜单状态', 'sys_show_hide', '2', '菜单状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (4, '系统是否', 'sys_yes_no', '2', '系统是否列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (5, '任务状态', 'sys_job_status', '2', '任务状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (6, '任务分组', 'sys_job_group', '2', '任务分组列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (7, '通知类型', 'sys_notice_type', '2', '通知类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (8, '系统状态', 'sys_common_status', '2', '登录状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (9, '操作类型', 'sys_oper_type', '2', '操作类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (10, '通知状态', 'sys_notice_status', '2', '通知状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (11, '内容状态', 'sys_content_status', '2', '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', NULL); + + +INSERT INTO sys_job (job_id, job_name, job_group, job_type, cron_expression, invoke_target, args, misfire_policy, concurrent, status, entry_id, created_at, updated_at, deleted_at, create_by, update_by)VALUES +(1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', NULL, 1, 1), +(2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', NULL, 1, 1); + +SET IDENTITY_INSERT sys_menu ON; +INSERT INTO sys_menu (menu_id, menu_name, title, icon, path, paths, menu_type, "action", permission, parent_id, no_cache, breadcrumb, component, sort, visible, is_frame, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL), +(3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(44, '', '查询管理员', 'app-group-fill', '', '/0/2/3/44', 'F', 'GET', 'admin:sysUser:query', 3, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(45, '', '修改管理员', 'app-group-fill', '', '/0/2/3/45', 'F', 'PUT', 'admin:sysUser:edit', 3, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(46, '', '删除管理员', 'app-group-fill', '', '/0/2/3/46', 'F', 'DELETE', 'admin:sysUser:remove', 3, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(51, 'SysMenuManage', '菜单管理', 'tree-table', '/admin/sys-menu', '/0/2/51', 'C', '无', 'admin:sysMenu:list', 2, 1, '', '/admin/sys-menu/index', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(52, 'SysRoleManage', '角色管理', 'peoples', '/admin/sys-role', '/0/2/52', 'C', '无', 'admin:sysRole:list', 2, 1, '', '/admin/sys-role/index', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(56, 'SysDeptManage', '部门管理', 'tree', '/admin/sys-dept', '/0/2/56', 'C', '无', 'admin:sysDept:list', 2, 0, '', '/admin/sys-dept/index', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(57, 'SysPostManage', '岗位管理', 'pass', '/admin/sys-post', '/0/2/57', 'C', '无', 'admin:sysPost:list', 2, 0, '', '/admin/sys-post/index', 50, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(58, 'Dict', '字典管理', 'education', '/admin/dict', '/0/2/58', 'C', '无', 'admin:sysDictType:list', 2, 0, '', '/admin/dict/index', 60, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(59, 'SysDictDataManage', '字典数据', 'education', '/admin/dict/data/:dictId', '/0/2/59', 'C', '无', 'admin:sysDictData:list', 2, 0, '', '/admin/dict/data', 100, '1', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(60, 'Tools', '开发工具', 'dev-tools', '/dev-tools', '/0/60', 'M', '无', '', 0, 0, '', 'Layout', 40, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL), +(61, 'Swagger', '系统接口', 'guide', '/dev-tools/swagger', '/0/60/61', 'C', '无', '', 60, 0, '', '/dev-tools/swagger/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL), +(62, 'SysConfigManage', '参数管理', 'swagger', '/admin/sys-config', '/0/2/62', 'C', '无', 'admin:sysConfig:list', 2, 0, '', '/admin/sys-config/index', 70, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(211, 'Log', '日志管理', 'log', '/log', '/0/2/211', 'M', '', '', 2, 0, '', '/log/index', 80, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(212, 'SysLoginLogManage', '登录日志', 'logininfor', '/admin/sys-login-log', '/0/2/211/212', 'C', '', 'admin:sysLoginLog:list', 211, 0, '', '/admin/sys-login-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(216, 'OperLog', '操作日志', 'skill', '/admin/sys-oper-log', '/0/2/211/216', 'C', '', 'admin:sysOperLog:list', 211, 0, '', '/admin/sys-oper-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(220, '', '新增菜单', 'app-group-fill', '', '/0/2/51/220', 'F', '', 'admin:sysMenu:add', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(221, '', '修改菜单', 'app-group-fill', '', '/0/2/51/221', 'F', '', 'admin:sysMenu:edit', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(222, '', '查询菜单', 'app-group-fill', '', '/0/2/51/222', 'F', '', 'admin:sysMenu:query', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(223, '', '删除菜单', 'app-group-fill', '', '/0/2/51/223', 'F', '', 'admin:sysMenu:remove', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(224, '', '新增角色', 'app-group-fill', '', '/0/2/52/224', 'F', '', 'admin:sysRole:add', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(225, '', '查询角色', 'app-group-fill', '', '/0/2/52/225', 'F', '', 'admin:sysRole:query', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(226, '', '修改角色', 'app-group-fill', '', '/0/2/52/226', 'F', '', 'admin:sysRole:update', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(227, '', '删除角色', 'app-group-fill', '', '/0/2/52/227', 'F', '', 'admin:sysRole:remove', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(228, '', '查询部门', 'app-group-fill', '', '/0/2/56/228', 'F', '', 'admin:sysDept:query', 56, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(229, '', '新增部门', 'app-group-fill', '', '/0/2/56/229', 'F', '', 'admin:sysDept:add', 56, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(230, '', '修改部门', 'app-group-fill', '', '/0/2/56/230', 'F', '', 'admin:sysDept:edit', 56, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(231, '', '删除部门', 'app-group-fill', '', '/0/2/56/231', 'F', '', 'admin:sysDept:remove', 56, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(232, '', '查询岗位', 'app-group-fill', '', '/0/2/57/232', 'F', '', 'admin:sysPost:query', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(233, '', '新增岗位', 'app-group-fill', '', '/0/2/57/233', 'F', '', 'admin:sysPost:add', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(234, '', '修改岗位', 'app-group-fill', '', '/0/2/57/234', 'F', '', 'admin:sysPost:edit', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(235, '', '删除岗位', 'app-group-fill', '', '/0/2/57/235', 'F', '', 'admin:sysPost:remove', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(236, '', '查询字典', 'app-group-fill', '', '/0/2/58/236', 'F', '', 'admin:sysDictType:query', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(237, '', '新增类型', 'app-group-fill', '', '/0/2/58/237', 'F', '', 'admin:sysDictType:add', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(238, '', '修改类型', 'app-group-fill', '', '/0/2/58/238', 'F', '', 'admin:sysDictType:edit', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(239, '', '删除类型', 'app-group-fill', '', '/0/2/58/239', 'F', '', 'system:sysdicttype:remove', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(240, '', '查询数据', 'app-group-fill', '', '/0/2/59/240', 'F', '', 'admin:sysDictData:query', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(241, '', '新增数据', 'app-group-fill', '', '/0/2/59/241', 'F', '', 'admin:sysDictData:add', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(242, '', '修改数据', 'app-group-fill', '', '/0/2/59/242', 'F', '', 'admin:sysDictData:edit', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(243, '', '删除数据', 'app-group-fill', '', '/0/2/59/243', 'F', '', 'admin:sysDictData:remove', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(244, '', '查询参数', 'app-group-fill', '', '/0/2/62/244', 'F', '', 'admin:sysConfig:query', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(245, '', '新增参数', 'app-group-fill', '', '/0/2/62/245', 'F', '', 'admin:sysConfig:add', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(246, '', '修改参数', 'app-group-fill', '', '/0/2/62/246', 'F', '', 'admin:sysConfig:edit', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(247, '', '删除参数', 'app-group-fill', '', '/0/2/62/247', 'F', '', 'admin:sysConfig:remove', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(248, '', '查询登录日志', 'app-group-fill', '', '/0/2/211/212/248', 'F', '', 'admin:sysLoginLog:query', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(249, '', '删除登录日志', 'app-group-fill', '', '/0/2/211/212/249', 'F', '', 'admin:sysLoginLog:remove', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(250, '', '查询操作日志', 'app-group-fill', '', '/0/2/211/216/250', 'F', '', 'admin:sysOperLog:query', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(251, '', '删除操作日志', 'app-group-fill', '', '/0/2/211/216/251', 'F', '', 'admin:sysOperLog:remove', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(261, 'Gen', '代码生成', 'code', '/dev-tools/gen', '/0/60/261', 'C', '', '', 60, 0, '', '/dev-tools/gen/index', 2, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL), +(262, 'EditTable', '代码生成修改', 'build', '/dev-tools/editTable', '/0/60/262', 'C', '', '', 60, 0, '', '/dev-tools/gen/editTable', 100, '1', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL), +(264, 'Build', '表单构建', 'build', '/dev-tools/build', '/0/60/264', 'C', '', '', 60, 0, '', '/dev-tools/build/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL), +(269, 'ServerMonitor', '服务监控', 'druid', '/sys-tools/monitor', '/0/60/269', 'C', '', 'sysTools:serverMonitor:list', 537, 0, '', '/sys-tools/monitor', 0, '0', '1', 1, 1, '2020-04-14 00:28:19.000', '2021-06-16 21:26:12.446', NULL), +(459, 'Schedule', '定时任务', 'time-range', '/schedule', '/0/459', 'M', '无', '', 0, 0, '', 'Layout', 20, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(460, 'ScheduleManage', 'Schedule', 'job', '/schedule/manage', '/0/459/460', 'C', '无', 'job:sysJob:list', 459, 0, '', '/schedule/index', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(461, 'sys_job', '分页获取定时任务', 'app-group-fill', '', '/0/459/460/461', 'F', '无', 'job:sysJob:query', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(462, 'sys_job', '创建定时任务', 'app-group-fill', '', '/0/459/460/462', 'F', '无', 'job:sysJob:add', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(463, 'sys_job', '修改定时任务', 'app-group-fill', '', '/0/459/460/463', 'F', '无', 'job:sysJob:edit', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(464, 'sys_job', '删除定时任务', 'app-group-fill', '', '/0/459/460/464', 'F', '无', 'job:sysJob:remove', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(471, 'JobLog', '日志', 'bug', '/schedule/log', '/0/459/471', 'C', '', '', 459, 0, '', '/schedule/log', 0, '1', '1', 1, 1, '2020-08-05 21:24:46.000', '2021-06-05 22:15:03.465', NULL), +(528, 'SysApiManage', '接口管理', 'api-doc', '/admin/sys-api', '/0/527/528', 'C', '无', 'admin:sysApi:list', 2, 0, '', '/admin/sys-api/index', 0, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(529, '', '查询接口', 'app-group-fill', '', '/0/527/528/529', 'F', '无', 'admin:sysApi:query', 528, 0, '', '', 40, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(531, '', '修改接口', 'app-group-fill', '', '/0/527/528/531', 'F', '无', 'admin:sysApi:edit', 528, 0, '', '', 30, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(537, 'SysTools', '系统工具', 'system-tools', '/sys-tools', '', 'M', '', '', 0, 0, '', 'Layout', 30, '0', '1', 1, 1, '2021-05-21 11:13:32.166', '2021-06-16 21:26:12.446', NULL), +(540, 'SysConfigSet', '参数设置', 'system-tools', '/admin/sys-config/set', '', 'C', '', 'admin:sysConfigSet:list', 2, 0, '', '/admin/sys-config/set', 0, '0', '1', 1, 1, '2021-05-25 16:06:52.560', '2021-06-17 11:48:40.703', NULL), +(542, '', '修改', 'upload', '', '', 'F', '', 'admin:sysConfigSet:update', 540, 0, '', '', 0, '0', '1', 1, 1, '2021-06-13 11:45:48.670', '2021-06-17 11:48:40.703', NULL); +SET IDENTITY_INSERT sys_menu OFF; +INSERT INTO sys_menu_api_rule (sys_menu_menu_id, sys_api_id)VALUES (216, 6); +(250, 6), +(58, 21), +(236, 21), +(238, 23), +(59, 24), +(240, 24), +(242, 25), +(58, 26), +(236, 26), +(56, 27), +(228, 27), +(230, 28), +(226, 29), +(51, 39), +(51, 135), +(222, 39), +(221, 41), +(52, 44), +(225, 44), +(226, 45), +(226, 46), +(226, 47), +(62, 53), +(244, 53), +(246, 54), +(57, 59), +(232, 59), +(234, 60), +(241, 80), +(237, 81), +(229, 82), +(245, 87), +(220, 88), +(233, 89), +(224, 90), +(531, 92), +(242, 101), +(238, 102), +(230, 103), +(226, 106), +(226, 107), +(246, 108), +(221, 109), +(234, 110), +(249, 114), +(251, 115), +(243, 120), +(239, 121), +(231, 122), +(247, 125), +(223, 126), +(235, 127), +(227, 128), +(528, 135), +(529, 135), +(531, 136), +(212, 137), +(248, 137), +(542, 139), +(540, 140), +(3, 141), +(44, 141), +(45, 142), +(43, 150), +(45, 151), +(46, 156); +INSERT INTO sys_post (post_id, post_name, post_code, sort, status, remark, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(1, '首席执行官', 'CEO', 0, '2','首席执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL), +(2, '首席技术执行官', 'CTO', 2, '2','首席技术执行官', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL), +(3, '首席运营官', 'COO', 3, '2','测试工程师', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_role (role_id, role_name, status, role_key, role_sort, flag, remark, admin, data_scope, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(1, '系统管理员', '2', 'admin', 1, '', '', 1, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_user VALUES (1, 'admin', '$2a$10$/Glr4g9Svr6O0kvjsRJCXu3f0W8/dsP3XZyVNi1019ratWpSPMyw.', 'zhangwj', '13818888888', 1, '', '', '1', '1@qq.com', 1, 1, '', '2', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.205', NULL); +-- 数据完成 ; \ No newline at end of file diff --git a/config/db.sql b/config/db.sql index a4a5421b1..5c84adf05 100644 --- a/config/db.sql +++ b/config/db.sql @@ -1,366 +1,324 @@ -- 开始初始化数据 ; -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; +INSERT INTO sys_api VALUES (5, 'go-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', NULL, 0, 0); +INSERT INTO sys_api VALUES (6, 'go-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (7, 'go-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', NULL, 0, 0); +INSERT INTO sys_api VALUES (8, 'go-admin/common/actions.IndexAction.func1', '分类列表', '/api/v1/syscategory', 'BUS', 'GET', '2021-05-13 19:59:00.870', '2021-06-13 20:53:47.883', NULL, 0, 0); +INSERT INTO sys_api VALUES (9, 'go-admin/common/actions.ViewAction.func1', '分类通过id获取', '/api/v1/syscategory/:id', 'BUS', 'GET', '2021-05-13 19:59:00.945', '2021-06-13 20:53:47.926', NULL, 0, 0); +INSERT INTO sys_api VALUES (10, 'go-admin/common/actions.IndexAction.func1', '内容列表', '/api/v1/syscontent', 'BUS', 'GET', '2021-05-13 19:59:01.005', '2021-06-13 20:53:47.966', NULL, 0, 0); +INSERT INTO sys_api VALUES (11, 'go-admin/common/actions.ViewAction.func1', '内容通过id获取', '/api/v1/syscontent/:id', 'BUS', 'GET', '2021-05-13 19:59:01.056', '2021-06-13 20:53:48.005', NULL, 0, 0); +INSERT INTO sys_api VALUES (15, 'go-admin/common/actions.IndexAction.func1', 'job列表', '/api/v1/sysjob', 'BUS', 'GET', '2021-05-13 19:59:01.248', '2021-06-13 20:53:48.169', NULL, 0, 0); +INSERT INTO sys_api VALUES (16, 'go-admin/common/actions.ViewAction.func1', 'job通过id获取', '/api/v1/sysjob/:id', 'BUS', 'GET', '2021-05-13 19:59:01.298', '2021-06-13 20:53:48.214', NULL, 0, 0); +INSERT INTO sys_api VALUES (21, 'go-admin/app/admin/apis.SysDictType.GetPage-fm', '字典类型列表', '/api/v1/dict/type', 'BUS', 'GET', '2021-05-13 19:59:01.525', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (22, 'go-admin/app/admin/apis.SysDictType.GetAll-fm', '字典类型查询【代码生成】', '/api/v1/dict/type-option-select', 'SYS', 'GET', '2021-05-13 19:59:01.582', '2021-06-13 20:53:48.388', NULL, 0, 0); +INSERT INTO sys_api VALUES (23, 'go-admin/app/admin/apis.SysDictType.Get-fm', '字典类型通过id获取', '/api/v1/dict/type/:id', 'BUS', 'GET', '2021-05-13 19:59:01.632', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (24, 'go-admin/app/admin/apis.SysDictData.GetPage-fm', '字典数据列表', '/api/v1/dict/data', 'BUS', 'GET', '2021-05-13 19:59:01.684', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (25, 'go-admin/app/admin/apis.SysDictData.Get-fm', '字典数据通过code获取', '/api/v1/dict/data/:dictCode', 'BUS', 'GET', '2021-05-13 19:59:01.732', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (26, 'go-admin/app/admin/apis.SysDictData.GetSysDictDataAll-fm', '数据字典根据key获取', '/api/v1/dict-data/option-select', 'SYS', 'GET', '2021-05-13 19:59:01.832', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (27, 'go-admin/app/admin/apis.SysDept.GetPage-fm', '部门列表', '/api/v1/dept', 'BUS', 'GET', '2021-05-13 19:59:01.940', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (28, 'go-admin/app/admin/apis.SysDept.Get-fm', '部门通过id获取', '/api/v1/dept/:id', 'BUS', 'GET', '2021-05-13 19:59:02.009', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (29, 'go-admin/app/admin/apis.SysDept.Get2Tree-fm', '查询部门下拉树【角色权限-自定权限】', '/api/v1/deptTree', 'SYS', 'GET', '2021-05-13 19:59:02.050', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (30, 'go-admin/app/admin/apis/tools.(*Gen).GetDBTableList-fm', '数据库表列表', '/api/v1/db/tables/page', 'SYS', 'GET', '2021-05-13 19:59:02.098', '2021-06-13 20:53:48.730', NULL, 0, 0); +INSERT INTO sys_api VALUES (31, 'go-admin/app/admin/apis/tools.(*Gen).GetDBColumnList-fm', '数据表列列表', '/api/v1/db/columns/page', 'SYS', 'GET', '2021-05-13 19:59:02.140', '2021-06-13 20:53:48.771', NULL, 0, 0); +INSERT INTO sys_api VALUES (32, 'go-admin/app/admin/apis/tools.Gen.GenCode-fm', '数据库表生成到项目', '/api/v1/gen/toproject/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.183', '2021-06-13 20:53:48.812', NULL, 0, 0); +INSERT INTO sys_api VALUES (33, 'go-admin/app/admin/apis/tools.Gen.GenMenuAndApi-fm', '数据库表生成到DB', '/api/v1/gen/todb/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.227', '2021-06-13 20:53:48.853', NULL, 0, 0); +INSERT INTO sys_api VALUES (34, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesTree-fm', '关系表数据【代码生成】', '/api/v1/gen/tabletree', 'SYS', 'GET', '2021-05-13 19:59:02.271', '2021-06-13 20:53:48.893', NULL, 0, 0); +INSERT INTO sys_api VALUES (35, 'go-admin/app/admin/apis/tools.Gen.Preview-fm', '生成预览通过id获取', '/api/v1/gen/preview/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.315', '2021-06-13 20:53:48.935', NULL, 0, 0); +INSERT INTO sys_api VALUES (36, 'go-admin/app/admin/apis/tools.Gen.GenApiToFile-fm', '生成api带文件', '/api/v1/gen/apitofile/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.357', '2021-06-13 20:53:48.977', NULL, 0, 0); +INSERT INTO sys_api VALUES (37, 'go-admin/app/admin/apis.System.GenerateCaptchaHandler-fm', '验证码获取', '/api/v1/getCaptcha', 'SYS', 'GET', '2021-05-13 19:59:02.405', '2021-06-13 20:53:49.020', NULL, 0, 0); +INSERT INTO sys_api VALUES (38, 'go-admin/app/admin/apis.SysUser.GetInfo-fm', '用户信息获取', '/api/v1/getinfo', 'SYS', 'GET', '2021-05-13 19:59:02.447', '2021-06-13 20:53:49.065', NULL, 0, 0); +INSERT INTO sys_api VALUES (39, 'go-admin/app/admin/apis.SysMenu.GetPage-fm', '菜单列表', '/api/v1/menu', 'BUS', 'GET', '2021-05-13 19:59:02.497', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (40, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '查询菜单下拉树结构【废弃】', '/api/v1/menuTreeselect', 'SYS', 'GET', '2021-05-13 19:59:02.542', '2021-06-03 22:37:21.857', NULL, 0, 0); +INSERT INTO sys_api VALUES (41, 'go-admin/app/admin/apis.SysMenu.Get-fm', '菜单通过id获取', '/api/v1/menu/:id', 'BUS', 'GET', '2021-05-13 19:59:02.584', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (42, 'go-admin/app/admin/apis.SysMenu.GetMenuRole-fm', '角色菜单【顶部左侧菜单】', '/api/v1/menurole', 'SYS', 'GET', '2021-05-13 19:59:02.630', '2021-06-13 20:53:49.574', NULL, 0, 0); +INSERT INTO sys_api VALUES (43, 'go-admin/app/admin/apis.SysMenu.GetMenuIDS-fm', '获取角色对应的菜单id数组【废弃】', '/api/v1/menuids', 'SYS', 'GET', '2021-05-13 19:59:02.675', '2021-06-03 22:39:52.500', NULL, 0, 0); +INSERT INTO sys_api VALUES (44, 'go-admin/app/admin/apis.SysRole.GetPage-fm', '角色列表', '/api/v1/role', 'BUS', 'GET', '2021-05-13 19:59:02.720', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (45, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '菜单权限列表【角色配菜单使用】', '/api/v1/roleMenuTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.762', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (46, 'go-admin/app/admin/apis.SysDept.GetDeptTreeRoleSelect-fm', '角色部门结构树【自定义数据权限】', '/api/v1/roleDeptTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.809', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (47, 'go-admin/app/admin/apis.SysRole.Get-fm', '角色通过id获取', '/api/v1/role/:id', 'BUS', 'GET', '2021-05-13 19:59:02.850', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (48, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).RefreshHandler-fm', '刷新token', '/api/v1/refresh_token', 'SYS', 'GET', '2021-05-13 19:59:02.892', '2021-06-13 20:53:49.278', NULL, 0, 0); +INSERT INTO sys_api VALUES (53, 'go-admin/app/admin/apis.SysConfig.GetPage-fm', '参数列表', '/api/v1/config', 'BUS', 'GET', '2021-05-13 19:59:03.116', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (54, 'go-admin/app/admin/apis.SysConfig.Get-fm', '参数通过id获取', '/api/v1/config/:id', 'BUS', 'GET', '2021-05-13 19:59:03.157', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (55, 'go-admin/app/admin/apis.SysConfig.GetSysConfigByKEYForService-fm', '参数通过键名搜索【基础默认配置】', '/api/v1/configKey/:configKey', 'SYS', 'GET', '2021-05-13 19:59:03.198', '2021-06-13 20:53:49.745', NULL, 0, 0); +INSERT INTO sys_api VALUES (57, 'go-admin/app/jobs/apis.SysJob.RemoveJobForService-fm', 'job移除', '/api/v1/job/remove/:id', 'BUS', 'GET', '2021-05-13 19:59:03.295', '2021-06-13 20:53:49.786', NULL, 0, 0); +INSERT INTO sys_api VALUES (58, 'go-admin/app/jobs/apis.SysJob.StartJobForService-fm', 'job启动', '/api/v1/job/start/:id', 'BUS', 'GET', '2021-05-13 19:59:03.339', '2021-06-13 20:53:49.829', NULL, 0, 0); +INSERT INTO sys_api VALUES (59, 'go-admin/app/admin/apis.SysPost.GetPage-fm', '岗位列表', '/api/v1/post', 'BUS', 'GET', '2021-05-13 19:59:03.381', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (60, 'go-admin/app/admin/apis.SysPost.Get-fm', '岗位通过id获取', '/api/v1/post/:id', 'BUS', 'GET', '2021-05-13 19:59:03.433', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (62, 'go-admin/app/admin/apis.SysConfig.GetSysConfigBySysApp-fm', '系统前端参数', '/api/v1/app-config', 'SYS', 'GET', '2021-05-13 19:59:03.526', '2021-06-13 20:53:49.994', NULL, 0, 0); +INSERT INTO sys_api VALUES (63, 'go-admin/app/admin/apis.SysUser.GetProfile-fm', '*用户信息获取', '/api/v1/user/profile', 'SYS', 'GET', '2021-05-13 19:59:03.567', '2021-06-13 20:53:50.038', NULL, 0, 0); +INSERT INTO sys_api VALUES (66, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).WsClient-fm', '链接ws【定时任务log】', '/ws/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.705', '2021-06-13 20:53:50.167', NULL, 0, 0); +INSERT INTO sys_api VALUES (67, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).UnWsClient-fm', '退出ws【定时任务log】', '/wslogout/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.756', '2021-06-13 20:53:50.209', NULL, 0, 0); +INSERT INTO sys_api VALUES (68, 'go-admin/common/middleware/handler.Ping', '*用户基本信息', '/info', 'SYS', 'GET', '2021-05-13 19:59:03.800', '2021-06-13 20:53:50.251', NULL, 0, 0); +INSERT INTO sys_api VALUES (72, 'go-admin/common/actions.CreateAction.func1', '分类创建', '/api/v1/syscategory', 'BUS', 'POST', '2021-05-13 19:59:03.982', '2021-06-13 20:53:50.336', NULL, 0, 0); +INSERT INTO sys_api VALUES (73, 'go-admin/common/actions.CreateAction.func1', '内容创建', '/api/v1/syscontent', 'BUS', 'POST', '2021-05-13 19:59:04.027', '2021-06-13 20:53:50.375', NULL, 0, 0); +INSERT INTO sys_api VALUES (76, 'go-admin/common/actions.CreateAction.func1', 'job创建', '/api/v1/sysjob', 'BUS', 'POST', '2021-05-13 19:59:04.164', '2021-06-13 20:53:50.500', NULL, 0, 0); +INSERT INTO sys_api VALUES (80, 'go-admin/app/admin/apis.SysDictData.Insert-fm', '字典数据创建', '/api/v1/dict/data', 'BUS', 'POST', '2021-05-13 19:59:04.347', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (81, 'go-admin/app/admin/apis.SysDictType.Insert-fm', '字典类型创建', '/api/v1/dict/type', 'BUS', 'POST', '2021-05-13 19:59:04.391', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (82, 'go-admin/app/admin/apis.SysDept.Insert-fm', '部门创建', '/api/v1/dept', 'BUS', 'POST', '2021-05-13 19:59:04.435', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (85, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).LoginHandler-fm', '*登录', '/api/v1/login', 'SYS', 'POST', '2021-05-13 19:59:04.597', '2021-06-13 20:53:50.784', NULL, 0, 0); +INSERT INTO sys_api VALUES (86, 'go-admin/common/middleware/handler.LogOut', '*退出', '/api/v1/logout', 'SYS', 'POST', '2021-05-13 19:59:04.642', '2021-06-13 20:53:50.824', NULL, 0, 0); +INSERT INTO sys_api VALUES (87, 'go-admin/app/admin/apis.SysConfig.Insert-fm', '参数创建', '/api/v1/config', 'BUS', 'POST', '2021-05-13 19:59:04.685', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (88, 'go-admin/app/admin/apis.SysMenu.Insert-fm', '菜单创建', '/api/v1/menu', 'BUS', 'POST', '2021-05-13 19:59:04.777', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (89, 'go-admin/app/admin/apis.SysPost.Insert-fm', '岗位创建', '/api/v1/post', 'BUS', 'POST', '2021-05-13 19:59:04.886', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (90, 'go-admin/app/admin/apis.SysRole.Insert-fm', '角色创建', '/api/v1/role', 'BUS', 'POST', '2021-05-13 19:59:04.975', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (91, 'go-admin/app/admin/apis.SysUser.InsetAvatar-fm', '*用户头像编辑', '/api/v1/user/avatar', 'SYS', 'POST', '2021-05-13 19:59:05.058', '2021-06-13 20:53:51.079', NULL, 0, 0); +INSERT INTO sys_api VALUES (92, 'go-admin/app/admin/apis.SysApi.Update-fm', '接口编辑', '/api/v1/sys-api/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.122', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (95, 'go-admin/common/actions.UpdateAction.func1', '分类编辑', '/api/v1/syscategory/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.255', '2021-06-13 20:53:51.247', NULL, 0, 0); +INSERT INTO sys_api VALUES (96, 'go-admin/common/actions.UpdateAction.func1', '内容编辑', '/api/v1/syscontent/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.299', '2021-06-13 20:53:51.289', NULL, 0, 0); +INSERT INTO sys_api VALUES (97, 'go-admin/common/actions.UpdateAction.func1', 'job编辑', '/api/v1/sysjob', 'BUS', 'PUT', '2021-05-13 19:59:05.343', '2021-06-13 20:53:51.331', NULL, 0, 0); +INSERT INTO sys_api VALUES (101, 'go-admin/app/admin/apis.SysDictData.Update-fm', '字典数据编辑', '/api/v1/dict/data/:dictCode', 'BUS', 'PUT', '2021-05-13 19:59:05.519', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (102, 'go-admin/app/admin/apis.SysDictType.Update-fm', '字典类型编辑', '/api/v1/dict/type/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.569', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (103, 'go-admin/app/admin/apis.SysDept.Update-fm', '部门编辑', '/api/v1/dept/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.613', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (104, 'go-admin/app/other/apis.SysFileDir.Update-fm', '文件夹编辑', '/api/v1/file-dir/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.662', '2021-06-13 20:53:51.847', NULL, 0, 0); +INSERT INTO sys_api VALUES (105, 'go-admin/app/other/apis.SysFileInfo.Update-fm', '文件编辑', '/api/v1/file-info/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.709', '2021-06-13 20:53:51.892', NULL, 0, 0); +INSERT INTO sys_api VALUES (106, 'go-admin/app/admin/apis.SysRole.Update-fm', '角色编辑', '/api/v1/role/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.752', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (107, 'go-admin/app/admin/apis.SysRole.Update2DataScope-fm', '角色数据权限修改', '/api/v1/roledatascope', 'BUS', 'PUT', '2021-05-13 19:59:05.803', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (108, 'go-admin/app/admin/apis.SysConfig.Update-fm', '参数编辑', '/api/v1/config/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.848', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (109, 'go-admin/app/admin/apis.SysMenu.Update-fm', '编辑菜单', '/api/v1/menu/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.891', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (110, 'go-admin/app/admin/apis.SysPost.Update-fm', '岗位编辑', '/api/v1/post/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.934', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (111, 'go-admin/app/admin/apis.SysUser.UpdatePwd-fm', '*用户修改密码', '/api/v1/user/pwd', 'SYS', 'PUT', '2021-05-13 19:59:05.987', '2021-06-13 20:53:51.724', NULL, 0, 0); +INSERT INTO sys_api VALUES (112, 'go-admin/common/actions.DeleteAction.func1', '分类删除', '/api/v1/syscategory', 'BUS', 'DELETE', '2021-05-13 19:59:06.030', '2021-06-13 20:53:52.237', NULL, 0, 0); +INSERT INTO sys_api VALUES (113, 'go-admin/common/actions.DeleteAction.func1', '内容删除', '/api/v1/syscontent', 'BUS', 'DELETE', '2021-05-13 19:59:06.076', '2021-06-13 20:53:52.278', NULL, 0, 0); +INSERT INTO sys_api VALUES (114, 'go-admin/app/admin/apis.SysLoginLog.Delete-fm', '登录日志删除', '/api/v1/sys-login-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.118', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (115, 'go-admin/app/admin/apis.SysOperaLog.Delete-fm', '操作日志删除', '/api/v1/sys-opera-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.162', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (116, 'go-admin/common/actions.DeleteAction.func1', 'job删除', '/api/v1/sysjob', 'BUS', 'DELETE', '2021-05-13 19:59:06.206', '2021-06-13 20:53:52.323', NULL, 0, 0); +INSERT INTO sys_api VALUES (117, 'go-admin/app/other/apis.SysChinaAreaData.Delete-fm', '行政区删除', '/api/v1/sys-area-data', 'BUS', 'DELETE', '2021-05-13 19:59:06.249', '2021-06-13 20:53:52.061', NULL, 0, 0); +INSERT INTO sys_api VALUES (120, 'go-admin/app/admin/apis.SysDictData.Delete-fm', '字典数据删除', '/api/v1/dict/data', 'BUS', 'DELETE', '2021-05-13 19:59:06.387', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (121, 'go-admin/app/admin/apis.SysDictType.Delete-fm', '字典类型删除', '/api/v1/dict/type', 'BUS', 'DELETE', '2021-05-13 19:59:06.432', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (122, 'go-admin/app/admin/apis.SysDept.Delete-fm', '部门删除', '/api/v1/dept/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.475', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (123, 'go-admin/app/other/apis.SysFileDir.Delete-fm', '文件夹删除', '/api/v1/file-dir/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.520', '2021-06-13 20:53:52.539', NULL, 0, 0); +INSERT INTO sys_api VALUES (124, 'go-admin/app/other/apis.SysFileInfo.Delete-fm', '文件删除', '/api/v1/file-info/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.566', '2021-06-13 20:53:52.580', NULL, 0, 0); +INSERT INTO sys_api VALUES (125, 'go-admin/app/admin/apis.SysConfig.Delete-fm', '参数删除', '/api/v1/config', 'BUS', 'DELETE', '2021-05-13 19:59:06.612', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (126, 'go-admin/app/admin/apis.SysMenu.Delete-fm', '删除菜单', '/api/v1/menu', 'BUS', 'DELETE', '2021-05-13 19:59:06.654', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (127, 'go-admin/app/admin/apis.SysPost.Delete-fm', '岗位删除', '/api/v1/post/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.702', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (128, 'go-admin/app/admin/apis.SysRole.Delete-fm', '角色删除', '/api/v1/role', 'BUS', 'DELETE', '2021-05-13 19:59:06.746', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (131, 'github.com/go-admin-team/go-admin-core/tools/transfer.Handler.func1', '系统指标', '/api/v1/metrics', 'SYS', 'GET', '2021-05-17 22:13:55.933', '2021-06-13 20:53:49.614', NULL, 0, 0); +INSERT INTO sys_api VALUES (132, 'go-admin/app/other/router.registerMonitorRouter.func1', '健康状态', '/api/v1/health', 'SYS', 'GET', '2021-05-17 22:13:56.285', '2021-06-13 20:53:49.951', NULL, 0, 0); +INSERT INTO sys_api VALUES (133, 'go-admin/app/admin/apis.HelloWorld', '项目默认接口', '/', 'SYS', 'GET', '2021-05-24 10:30:44.553', '2021-06-13 20:53:47.406', NULL, 0, 0); +INSERT INTO sys_api VALUES (134, 'go-admin/app/other/apis.ServerMonitor.ServerInfo-fm', '服务器基本状态', '/api/v1/server-monitor', 'SYS', 'GET', '2021-05-24 10:30:44.937', '2021-06-13 20:53:48.255', NULL, 0, 0); +INSERT INTO sys_api VALUES (135, 'go-admin/app/admin/apis.SysApi.GetPage-fm', '接口列表', '/api/v1/sys-api', 'BUS', 'GET', '2021-05-24 11:37:53.303', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (136, 'go-admin/app/admin/apis.SysApi.Get-fm', '接口通过id获取', '/api/v1/sys-api/:id', 'BUS', 'GET', '2021-05-24 11:37:53.359', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (137, 'go-admin/app/admin/apis.SysLoginLog.GetPage-fm', '登录日志列表', '/api/v1/sys-login-log', 'BUS', 'GET', '2021-05-24 11:47:30.397', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (138, 'go-admin/app/other/apis.File.UploadFile-fm', '文件上传', '/api/v1/public/uploadFile', 'SYS', 'POST', '2021-05-25 19:16:18.493', '2021-06-13 20:53:50.866', NULL, 0, 0); +INSERT INTO sys_api VALUES (139, 'go-admin/app/admin/apis.SysConfig.Update2Set-fm', '参数信息修改【参数配置】', '/api/v1/set-config', 'BUS', 'PUT', '2021-05-27 09:45:14.853', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (140, 'go-admin/app/admin/apis.SysConfig.Get2Set-fm', '参数获取全部【配置使用】', '/api/v1/set-config', 'BUS', 'GET', '2021-05-27 11:54:14.384', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (141, 'go-admin/app/admin/apis.SysUser.GetPage-fm', '管理员列表', '/api/v1/sys-user', 'BUS', 'GET', '2021-06-13 19:24:57.111', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (142, 'go-admin/app/admin/apis.SysUser.Get-fm', '管理员通过id获取', '/api/v1/sys-user/:id', 'BUS', 'GET', '2021-06-13 19:24:57.188', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (143, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesInfo-fm', '', '/api/v1/sys/tables/info', '', 'GET', '2021-06-13 19:24:57.437', '2021-06-13 20:53:48.047', NULL, 0, 0); +INSERT INTO sys_api VALUES (144, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'GET', '2021-06-13 19:24:57.510', '2021-06-13 20:53:48.088', NULL, 0, 0); +INSERT INTO sys_api VALUES (145, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTableList-fm', '', '/api/v1/sys/tables/page', '', 'GET', '2021-06-13 19:24:57.582', '2021-06-13 20:53:48.128', NULL, 0, 0); +INSERT INTO sys_api VALUES (146, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'GET', '2021-06-13 19:24:59.641', '2021-06-13 20:53:50.081', NULL, 0, 0); +INSERT INTO sys_api VALUES (147, 'github.com/swaggo/gin-swagger.CustomWrapHandler.func1', '', '/swagger/*any', '', 'GET', '2021-06-13 19:24:59.713', '2021-06-13 20:53:50.123', NULL, 0, 0); +INSERT INTO sys_api VALUES (148, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'GET', '2021-06-13 19:24:59.914', '2021-06-13 20:53:50.295', NULL, 0, 0); +INSERT INTO sys_api VALUES (149, 'go-admin/app/admin/apis/tools.(*SysTable).InsertSysTable-fm', '', '/api/v1/sys/tables/info', '', 'POST', '2021-06-13 19:25:00.163', '2021-06-13 20:53:50.539', NULL, 0, 0); +INSERT INTO sys_api VALUES (150, 'go-admin/app/admin/apis.SysUser.Insert-fm', '管理员创建', '/api/v1/sys-user', 'BUS', 'POST', '2021-06-13 19:25:00.233', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (151, 'go-admin/app/admin/apis.SysUser.Update-fm', '管理员编辑', '/api/v1/sys-user', 'BUS', 'PUT', '2021-06-13 19:25:00.986', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (152, 'go-admin/app/admin/apis/tools.(*SysTable).UpdateSysTable-fm', '', '/api/v1/sys/tables/info', '', 'PUT', '2021-06-13 19:25:01.149', '2021-06-13 20:53:51.375', NULL, 0, 0); +INSERT INTO sys_api VALUES (153, 'go-admin/app/admin/apis.SysRole.Update2Status-fm', '', '/api/v1/role-status', '', 'PUT', '2021-06-13 19:25:01.446', '2021-06-13 20:53:51.636', NULL, 0, 0); +INSERT INTO sys_api VALUES (154, 'go-admin/app/admin/apis.SysUser.ResetPwd-fm', '', '/api/v1/user/pwd/reset', '', 'PUT', '2021-06-13 19:25:01.601', '2021-06-13 20:53:51.764', NULL, 0, 0); +INSERT INTO sys_api VALUES (155, 'go-admin/app/admin/apis.SysUser.UpdateStatus-fm', '', '/api/v1/user/status', '', 'PUT', '2021-06-13 19:25:01.671', '2021-06-13 20:53:51.806', NULL, 0, 0); +INSERT INTO sys_api VALUES (156, 'go-admin/app/admin/apis.SysUser.Delete-fm', '管理员删除', '/api/v1/sys-user', 'BUS', 'DELETE', '2021-06-13 19:25:02.043', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (157, 'go-admin/app/admin/apis/tools.(*SysTable).DeleteSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'DELETE', '2021-06-13 19:25:02.283', '2021-06-13 20:53:52.367', NULL, 0, 0); +INSERT INTO sys_api VALUES (158, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'HEAD', '2021-06-13 19:25:02.734', '2021-06-13 20:53:52.791', NULL, 0, 0); +INSERT INTO sys_api VALUES (159, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'HEAD', '2021-06-13 19:25:02.808', '2021-06-13 20:53:52.838', NULL, 0, 0); -BEGIN; -INSERT INTO `sys_api` VALUES (5, 'go-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (6, 'go-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (7, 'go-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (8, 'go-admin/common/actions.IndexAction.func1', '分类列表', '/api/v1/syscategory', 'BUS', 'GET', '2021-05-13 19:59:00.870', '2021-06-13 20:53:47.883', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (9, 'go-admin/common/actions.ViewAction.func1', '分类通过id获取', '/api/v1/syscategory/:id', 'BUS', 'GET', '2021-05-13 19:59:00.945', '2021-06-13 20:53:47.926', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (10, 'go-admin/common/actions.IndexAction.func1', '内容列表', '/api/v1/syscontent', 'BUS', 'GET', '2021-05-13 19:59:01.005', '2021-06-13 20:53:47.966', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (11, 'go-admin/common/actions.ViewAction.func1', '内容通过id获取', '/api/v1/syscontent/:id', 'BUS', 'GET', '2021-05-13 19:59:01.056', '2021-06-13 20:53:48.005', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (15, 'go-admin/common/actions.IndexAction.func1', 'job列表', '/api/v1/sysjob', 'BUS', 'GET', '2021-05-13 19:59:01.248', '2021-06-13 20:53:48.169', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (16, 'go-admin/common/actions.ViewAction.func1', 'job通过id获取', '/api/v1/sysjob/:id', 'BUS', 'GET', '2021-05-13 19:59:01.298', '2021-06-13 20:53:48.214', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (21, 'go-admin/app/admin/apis.SysDictType.GetPage-fm', '字典类型列表', '/api/v1/dict/type', 'BUS', 'GET', '2021-05-13 19:59:01.525', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (22, 'go-admin/app/admin/apis.SysDictType.GetAll-fm', '字典类型查询【代码生成】', '/api/v1/dict/type-option-select', 'SYS', 'GET', '2021-05-13 19:59:01.582', '2021-06-13 20:53:48.388', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (23, 'go-admin/app/admin/apis.SysDictType.Get-fm', '字典类型通过id获取', '/api/v1/dict/type/:id', 'BUS', 'GET', '2021-05-13 19:59:01.632', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (24, 'go-admin/app/admin/apis.SysDictData.GetPage-fm', '字典数据列表', '/api/v1/dict/data', 'BUS', 'GET', '2021-05-13 19:59:01.684', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (25, 'go-admin/app/admin/apis.SysDictData.Get-fm', '字典数据通过code获取', '/api/v1/dict/data/:dictCode', 'BUS', 'GET', '2021-05-13 19:59:01.732', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (26, 'go-admin/app/admin/apis.SysDictData.GetSysDictDataAll-fm', '数据字典根据key获取', '/api/v1/dict-data/option-select', 'SYS', 'GET', '2021-05-13 19:59:01.832', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (27, 'go-admin/app/admin/apis.SysDept.GetPage-fm', '部门列表', '/api/v1/dept', 'BUS', 'GET', '2021-05-13 19:59:01.940', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (28, 'go-admin/app/admin/apis.SysDept.Get-fm', '部门通过id获取', '/api/v1/dept/:id', 'BUS', 'GET', '2021-05-13 19:59:02.009', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (29, 'go-admin/app/admin/apis.SysDept.Get2Tree-fm', '查询部门下拉树【角色权限-自定权限】', '/api/v1/deptTree', 'SYS', 'GET', '2021-05-13 19:59:02.050', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (30, 'go-admin/app/admin/apis/tools.(*Gen).GetDBTableList-fm', '数据库表列表', '/api/v1/db/tables/page', 'SYS', 'GET', '2021-05-13 19:59:02.098', '2021-06-13 20:53:48.730', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (31, 'go-admin/app/admin/apis/tools.(*Gen).GetDBColumnList-fm', '数据表列列表', '/api/v1/db/columns/page', 'SYS', 'GET', '2021-05-13 19:59:02.140', '2021-06-13 20:53:48.771', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (32, 'go-admin/app/admin/apis/tools.Gen.GenCode-fm', '数据库表生成到项目', '/api/v1/gen/toproject/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.183', '2021-06-13 20:53:48.812', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (33, 'go-admin/app/admin/apis/tools.Gen.GenMenuAndApi-fm', '数据库表生成到DB', '/api/v1/gen/todb/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.227', '2021-06-13 20:53:48.853', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (34, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesTree-fm', '关系表数据【代码生成】', '/api/v1/gen/tabletree', 'SYS', 'GET', '2021-05-13 19:59:02.271', '2021-06-13 20:53:48.893', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (35, 'go-admin/app/admin/apis/tools.Gen.Preview-fm', '生成预览通过id获取', '/api/v1/gen/preview/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.315', '2021-06-13 20:53:48.935', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (36, 'go-admin/app/admin/apis/tools.Gen.GenApiToFile-fm', '生成api带文件', '/api/v1/gen/apitofile/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.357', '2021-06-13 20:53:48.977', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (37, 'go-admin/app/admin/apis.System.GenerateCaptchaHandler-fm', '验证码获取', '/api/v1/getCaptcha', 'SYS', 'GET', '2021-05-13 19:59:02.405', '2021-06-13 20:53:49.020', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (38, 'go-admin/app/admin/apis.SysUser.GetInfo-fm', '用户信息获取', '/api/v1/getinfo', 'SYS', 'GET', '2021-05-13 19:59:02.447', '2021-06-13 20:53:49.065', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (39, 'go-admin/app/admin/apis.SysMenu.GetPage-fm', '菜单列表', '/api/v1/menu', 'BUS', 'GET', '2021-05-13 19:59:02.497', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (40, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '查询菜单下拉树结构【废弃】', '/api/v1/menuTreeselect', 'SYS', 'GET', '2021-05-13 19:59:02.542', '2021-06-03 22:37:21.857', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (41, 'go-admin/app/admin/apis.SysMenu.Get-fm', '菜单通过id获取', '/api/v1/menu/:id', 'BUS', 'GET', '2021-05-13 19:59:02.584', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (42, 'go-admin/app/admin/apis.SysMenu.GetMenuRole-fm', '角色菜单【顶部左侧菜单】', '/api/v1/menurole', 'SYS', 'GET', '2021-05-13 19:59:02.630', '2021-06-13 20:53:49.574', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (43, 'go-admin/app/admin/apis.SysMenu.GetMenuIDS-fm', '获取角色对应的菜单id数组【废弃】', '/api/v1/menuids', 'SYS', 'GET', '2021-05-13 19:59:02.675', '2021-06-03 22:39:52.500', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (44, 'go-admin/app/admin/apis.SysRole.GetPage-fm', '角色列表', '/api/v1/role', 'BUS', 'GET', '2021-05-13 19:59:02.720', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (45, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '菜单权限列表【角色配菜单使用】', '/api/v1/roleMenuTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.762', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (46, 'go-admin/app/admin/apis.SysDept.GetDeptTreeRoleSelect-fm', '角色部门结构树【自定义数据权限】', '/api/v1/roleDeptTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.809', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (47, 'go-admin/app/admin/apis.SysRole.Get-fm', '角色通过id获取', '/api/v1/role/:id', 'BUS', 'GET', '2021-05-13 19:59:02.850', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (48, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).RefreshHandler-fm', '刷新token', '/api/v1/refresh_token', 'SYS', 'GET', '2021-05-13 19:59:02.892', '2021-06-13 20:53:49.278', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (53, 'go-admin/app/admin/apis.SysConfig.GetPage-fm', '参数列表', '/api/v1/config', 'BUS', 'GET', '2021-05-13 19:59:03.116', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (54, 'go-admin/app/admin/apis.SysConfig.Get-fm', '参数通过id获取', '/api/v1/config/:id', 'BUS', 'GET', '2021-05-13 19:59:03.157', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (55, 'go-admin/app/admin/apis.SysConfig.GetSysConfigByKEYForService-fm', '参数通过键名搜索【基础默认配置】', '/api/v1/configKey/:configKey', 'SYS', 'GET', '2021-05-13 19:59:03.198', '2021-06-13 20:53:49.745', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (57, 'go-admin/app/jobs/apis.SysJob.RemoveJobForService-fm', 'job移除', '/api/v1/job/remove/:id', 'BUS', 'GET', '2021-05-13 19:59:03.295', '2021-06-13 20:53:49.786', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (58, 'go-admin/app/jobs/apis.SysJob.StartJobForService-fm', 'job启动', '/api/v1/job/start/:id', 'BUS', 'GET', '2021-05-13 19:59:03.339', '2021-06-13 20:53:49.829', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (59, 'go-admin/app/admin/apis.SysPost.GetPage-fm', '岗位列表', '/api/v1/post', 'BUS', 'GET', '2021-05-13 19:59:03.381', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (60, 'go-admin/app/admin/apis.SysPost.Get-fm', '岗位通过id获取', '/api/v1/post/:id', 'BUS', 'GET', '2021-05-13 19:59:03.433', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (62, 'go-admin/app/admin/apis.SysConfig.GetSysConfigBySysApp-fm', '系统前端参数', '/api/v1/app-config', 'SYS', 'GET', '2021-05-13 19:59:03.526', '2021-06-13 20:53:49.994', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (63, 'go-admin/app/admin/apis.SysUser.GetProfile-fm', '*用户信息获取', '/api/v1/user/profile', 'SYS', 'GET', '2021-05-13 19:59:03.567', '2021-06-13 20:53:50.038', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (66, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).WsClient-fm', '链接ws【定时任务log】', '/ws/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.705', '2021-06-13 20:53:50.167', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (67, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).UnWsClient-fm', '退出ws【定时任务log】', '/wslogout/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.756', '2021-06-13 20:53:50.209', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (68, 'go-admin/common/middleware/handler.Ping', '*用户基本信息', '/info', 'SYS', 'GET', '2021-05-13 19:59:03.800', '2021-06-13 20:53:50.251', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (72, 'go-admin/common/actions.CreateAction.func1', '分类创建', '/api/v1/syscategory', 'BUS', 'POST', '2021-05-13 19:59:03.982', '2021-06-13 20:53:50.336', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (73, 'go-admin/common/actions.CreateAction.func1', '内容创建', '/api/v1/syscontent', 'BUS', 'POST', '2021-05-13 19:59:04.027', '2021-06-13 20:53:50.375', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (76, 'go-admin/common/actions.CreateAction.func1', 'job创建', '/api/v1/sysjob', 'BUS', 'POST', '2021-05-13 19:59:04.164', '2021-06-13 20:53:50.500', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (80, 'go-admin/app/admin/apis.SysDictData.Insert-fm', '字典数据创建', '/api/v1/dict/data', 'BUS', 'POST', '2021-05-13 19:59:04.347', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (81, 'go-admin/app/admin/apis.SysDictType.Insert-fm', '字典类型创建', '/api/v1/dict/type', 'BUS', 'POST', '2021-05-13 19:59:04.391', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (82, 'go-admin/app/admin/apis.SysDept.Insert-fm', '部门创建', '/api/v1/dept', 'BUS', 'POST', '2021-05-13 19:59:04.435', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (85, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).LoginHandler-fm', '*登录', '/api/v1/login', 'SYS', 'POST', '2021-05-13 19:59:04.597', '2021-06-13 20:53:50.784', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (86, 'go-admin/common/middleware/handler.LogOut', '*退出', '/api/v1/logout', 'SYS', 'POST', '2021-05-13 19:59:04.642', '2021-06-13 20:53:50.824', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (87, 'go-admin/app/admin/apis.SysConfig.Insert-fm', '参数创建', '/api/v1/config', 'BUS', 'POST', '2021-05-13 19:59:04.685', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (88, 'go-admin/app/admin/apis.SysMenu.Insert-fm', '菜单创建', '/api/v1/menu', 'BUS', 'POST', '2021-05-13 19:59:04.777', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (89, 'go-admin/app/admin/apis.SysPost.Insert-fm', '岗位创建', '/api/v1/post', 'BUS', 'POST', '2021-05-13 19:59:04.886', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (90, 'go-admin/app/admin/apis.SysRole.Insert-fm', '角色创建', '/api/v1/role', 'BUS', 'POST', '2021-05-13 19:59:04.975', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (91, 'go-admin/app/admin/apis.SysUser.InsetAvatar-fm', '*用户头像编辑', '/api/v1/user/avatar', 'SYS', 'POST', '2021-05-13 19:59:05.058', '2021-06-13 20:53:51.079', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (92, 'go-admin/app/admin/apis.SysApi.Update-fm', '接口编辑', '/api/v1/sys-api/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.122', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (95, 'go-admin/common/actions.UpdateAction.func1', '分类编辑', '/api/v1/syscategory/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.255', '2021-06-13 20:53:51.247', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (96, 'go-admin/common/actions.UpdateAction.func1', '内容编辑', '/api/v1/syscontent/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.299', '2021-06-13 20:53:51.289', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (97, 'go-admin/common/actions.UpdateAction.func1', 'job编辑', '/api/v1/sysjob', 'BUS', 'PUT', '2021-05-13 19:59:05.343', '2021-06-13 20:53:51.331', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (101, 'go-admin/app/admin/apis.SysDictData.Update-fm', '字典数据编辑', '/api/v1/dict/data/:dictCode', 'BUS', 'PUT', '2021-05-13 19:59:05.519', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (102, 'go-admin/app/admin/apis.SysDictType.Update-fm', '字典类型编辑', '/api/v1/dict/type/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.569', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (103, 'go-admin/app/admin/apis.SysDept.Update-fm', '部门编辑', '/api/v1/dept/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.613', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (104, 'go-admin/app/other/apis.SysFileDir.Update-fm', '文件夹编辑', '/api/v1/file-dir/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.662', '2021-06-13 20:53:51.847', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (105, 'go-admin/app/other/apis.SysFileInfo.Update-fm', '文件编辑', '/api/v1/file-info/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.709', '2021-06-13 20:53:51.892', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (106, 'go-admin/app/admin/apis.SysRole.Update-fm', '角色编辑', '/api/v1/role/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.752', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (107, 'go-admin/app/admin/apis.SysRole.Update2DataScope-fm', '角色数据权限修改', '/api/v1/roledatascope', 'BUS', 'PUT', '2021-05-13 19:59:05.803', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (108, 'go-admin/app/admin/apis.SysConfig.Update-fm', '参数编辑', '/api/v1/config/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.848', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (109, 'go-admin/app/admin/apis.SysMenu.Update-fm', '编辑菜单', '/api/v1/menu/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.891', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (110, 'go-admin/app/admin/apis.SysPost.Update-fm', '岗位编辑', '/api/v1/post/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.934', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (111, 'go-admin/app/admin/apis.SysUser.UpdatePwd-fm', '*用户修改密码', '/api/v1/user/pwd', 'SYS', 'PUT', '2021-05-13 19:59:05.987', '2021-06-13 20:53:51.724', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (112, 'go-admin/common/actions.DeleteAction.func1', '分类删除', '/api/v1/syscategory', 'BUS', 'DELETE', '2021-05-13 19:59:06.030', '2021-06-13 20:53:52.237', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (113, 'go-admin/common/actions.DeleteAction.func1', '内容删除', '/api/v1/syscontent', 'BUS', 'DELETE', '2021-05-13 19:59:06.076', '2021-06-13 20:53:52.278', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (114, 'go-admin/app/admin/apis.SysLoginLog.Delete-fm', '登录日志删除', '/api/v1/sys-login-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.118', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (115, 'go-admin/app/admin/apis.SysOperaLog.Delete-fm', '操作日志删除', '/api/v1/sys-opera-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.162', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (116, 'go-admin/common/actions.DeleteAction.func1', 'job删除', '/api/v1/sysjob', 'BUS', 'DELETE', '2021-05-13 19:59:06.206', '2021-06-13 20:53:52.323', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (117, 'go-admin/app/other/apis.SysChinaAreaData.Delete-fm', '行政区删除', '/api/v1/sys-area-data', 'BUS', 'DELETE', '2021-05-13 19:59:06.249', '2021-06-13 20:53:52.061', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (120, 'go-admin/app/admin/apis.SysDictData.Delete-fm', '字典数据删除', '/api/v1/dict/data', 'BUS', 'DELETE', '2021-05-13 19:59:06.387', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (121, 'go-admin/app/admin/apis.SysDictType.Delete-fm', '字典类型删除', '/api/v1/dict/type', 'BUS', 'DELETE', '2021-05-13 19:59:06.432', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (122, 'go-admin/app/admin/apis.SysDept.Delete-fm', '部门删除', '/api/v1/dept/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.475', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (123, 'go-admin/app/other/apis.SysFileDir.Delete-fm', '文件夹删除', '/api/v1/file-dir/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.520', '2021-06-13 20:53:52.539', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (124, 'go-admin/app/other/apis.SysFileInfo.Delete-fm', '文件删除', '/api/v1/file-info/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.566', '2021-06-13 20:53:52.580', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (125, 'go-admin/app/admin/apis.SysConfig.Delete-fm', '参数删除', '/api/v1/config', 'BUS', 'DELETE', '2021-05-13 19:59:06.612', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (126, 'go-admin/app/admin/apis.SysMenu.Delete-fm', '删除菜单', '/api/v1/menu', 'BUS', 'DELETE', '2021-05-13 19:59:06.654', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (127, 'go-admin/app/admin/apis.SysPost.Delete-fm', '岗位删除', '/api/v1/post/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.702', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (128, 'go-admin/app/admin/apis.SysRole.Delete-fm', '角色删除', '/api/v1/role', 'BUS', 'DELETE', '2021-05-13 19:59:06.746', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (131, 'github.com/go-admin-team/go-admin-core/tools/transfer.Handler.func1', '系统指标', '/api/v1/metrics', 'SYS', 'GET', '2021-05-17 22:13:55.933', '2021-06-13 20:53:49.614', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (132, 'go-admin/app/other/router.registerMonitorRouter.func1', '健康状态', '/api/v1/health', 'SYS', 'GET', '2021-05-17 22:13:56.285', '2021-06-13 20:53:49.951', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (133, 'go-admin/app/admin/apis.HelloWorld', '项目默认接口', '/', 'SYS', 'GET', '2021-05-24 10:30:44.553', '2021-06-13 20:53:47.406', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (134, 'go-admin/app/other/apis.ServerMonitor.ServerInfo-fm', '服务器基本状态', '/api/v1/server-monitor', 'SYS', 'GET', '2021-05-24 10:30:44.937', '2021-06-13 20:53:48.255', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (135, 'go-admin/app/admin/apis.SysApi.GetPage-fm', '接口列表', '/api/v1/sys-api', 'BUS', 'GET', '2021-05-24 11:37:53.303', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (136, 'go-admin/app/admin/apis.SysApi.Get-fm', '接口通过id获取', '/api/v1/sys-api/:id', 'BUS', 'GET', '2021-05-24 11:37:53.359', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (137, 'go-admin/app/admin/apis.SysLoginLog.GetPage-fm', '登录日志列表', '/api/v1/sys-login-log', 'BUS', 'GET', '2021-05-24 11:47:30.397', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (138, 'go-admin/app/other/apis.File.UploadFile-fm', '文件上传', '/api/v1/public/uploadFile', 'SYS', 'POST', '2021-05-25 19:16:18.493', '2021-06-13 20:53:50.866', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (139, 'go-admin/app/admin/apis.SysConfig.Update2Set-fm', '参数信息修改【参数配置】', '/api/v1/set-config', 'BUS', 'PUT', '2021-05-27 09:45:14.853', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (140, 'go-admin/app/admin/apis.SysConfig.Get2Set-fm', '参数获取全部【配置使用】', '/api/v1/set-config', 'BUS', 'GET', '2021-05-27 11:54:14.384', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (141, 'go-admin/app/admin/apis.SysUser.GetPage-fm', '管理员列表', '/api/v1/sys-user', 'BUS', 'GET', '2021-06-13 19:24:57.111', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (142, 'go-admin/app/admin/apis.SysUser.Get-fm', '管理员通过id获取', '/api/v1/sys-user/:id', 'BUS', 'GET', '2021-06-13 19:24:57.188', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (143, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesInfo-fm', '', '/api/v1/sys/tables/info', '', 'GET', '2021-06-13 19:24:57.437', '2021-06-13 20:53:48.047', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (144, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'GET', '2021-06-13 19:24:57.510', '2021-06-13 20:53:48.088', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (145, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTableList-fm', '', '/api/v1/sys/tables/page', '', 'GET', '2021-06-13 19:24:57.582', '2021-06-13 20:53:48.128', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (146, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'GET', '2021-06-13 19:24:59.641', '2021-06-13 20:53:50.081', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (147, 'github.com/swaggo/gin-swagger.CustomWrapHandler.func1', '', '/swagger/*any', '', 'GET', '2021-06-13 19:24:59.713', '2021-06-13 20:53:50.123', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (148, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'GET', '2021-06-13 19:24:59.914', '2021-06-13 20:53:50.295', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (149, 'go-admin/app/admin/apis/tools.(*SysTable).InsertSysTable-fm', '', '/api/v1/sys/tables/info', '', 'POST', '2021-06-13 19:25:00.163', '2021-06-13 20:53:50.539', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (150, 'go-admin/app/admin/apis.SysUser.Insert-fm', '管理员创建', '/api/v1/sys-user', 'BUS', 'POST', '2021-06-13 19:25:00.233', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (151, 'go-admin/app/admin/apis.SysUser.Update-fm', '管理员编辑', '/api/v1/sys-user', 'BUS', 'PUT', '2021-06-13 19:25:00.986', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (152, 'go-admin/app/admin/apis/tools.(*SysTable).UpdateSysTable-fm', '', '/api/v1/sys/tables/info', '', 'PUT', '2021-06-13 19:25:01.149', '2021-06-13 20:53:51.375', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (153, 'go-admin/app/admin/apis.SysRole.Update2Status-fm', '', '/api/v1/role-status', '', 'PUT', '2021-06-13 19:25:01.446', '2021-06-13 20:53:51.636', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (154, 'go-admin/app/admin/apis.SysUser.ResetPwd-fm', '', '/api/v1/user/pwd/reset', '', 'PUT', '2021-06-13 19:25:01.601', '2021-06-13 20:53:51.764', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (155, 'go-admin/app/admin/apis.SysUser.UpdateStatus-fm', '', '/api/v1/user/status', '', 'PUT', '2021-06-13 19:25:01.671', '2021-06-13 20:53:51.806', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (156, 'go-admin/app/admin/apis.SysUser.Delete-fm', '管理员删除', '/api/v1/sys-user', 'BUS', 'DELETE', '2021-06-13 19:25:02.043', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (157, 'go-admin/app/admin/apis/tools.(*SysTable).DeleteSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'DELETE', '2021-06-13 19:25:02.283', '2021-06-13 20:53:52.367', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (158, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'HEAD', '2021-06-13 19:25:02.734', '2021-06-13 20:53:52.791', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (159, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'HEAD', '2021-06-13 19:25:02.808', '2021-06-13 20:53:52.838', NULL, 0, 0); -COMMIT; +INSERT INTO sys_config VALUES (1, '皮肤样式', 'sys_index_skinName', 'skin-green', 'Y', '0', '主框架页-默认皮肤样式名称:蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 13:50:13.123', NULL); +INSERT INTO sys_config VALUES (2, '初始密码', 'sys_user_initPassword', '123456', 'Y', '0', '用户管理-账号初始密码:123456', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_config VALUES (3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_config VALUES (4, '系统名称', 'sys_app_name', 'go-admin管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2021-05-28 10:08:25.248', NULL); +INSERT INTO sys_config VALUES (5, '系统logo', 'sys_app_logo', 'https://doc-image.zhangwj.com/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); -BEGIN; -INSERT INTO `sys_config` VALUES (1, '皮肤样式', 'sys_index_skinName', 'skin-green', 'Y', '0', '主框架页-默认皮肤样式名称:蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 13:50:13.123', NULL); -INSERT INTO `sys_config` VALUES (2, '初始密码', 'sys_user_initPassword', '123456', 'Y', '0', '用户管理-账号初始密码:123456', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_config` VALUES (3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_config` VALUES (4, '系统名称', 'sys_app_name', 'go-admin管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2021-05-28 10:08:25.248', NULL); -INSERT INTO `sys_config` VALUES (5, '系统logo', 'sys_app_logo', 'https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); -COMMIT; +INSERT INTO sys_dept VALUES (1, 0, '/0/1/', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:06:44.960', NULL); +INSERT INTO sys_dept VALUES (7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', NULL); +INSERT INTO sys_dept VALUES (8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', NULL); +INSERT INTO sys_dept VALUES (9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', NULL); +INSERT INTO sys_dept VALUES (10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', '1', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', NULL); -BEGIN; -INSERT INTO `sys_dept` VALUES (1, 0, '/0/1/', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:06:44.960', NULL); -INSERT INTO `sys_dept` VALUES (7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', NULL); -INSERT INTO `sys_dept` VALUES (8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', NULL); -INSERT INTO `sys_dept` VALUES (9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', NULL); -INSERT INTO `sys_dept` VALUES (10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', '1', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', NULL); -COMMIT; +INSERT INTO sys_dict_data VALUES (1, 0, '正常', '2', 'sys_normal_disable', '', '', '', '2', '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', NULL); +INSERT INTO sys_dict_data VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', '2', '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', '2', '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (4, 0, '女', '1', 'sys_user_sex', '', '', '', '2', '', '性别女', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (5, 0, '未知', '2', 'sys_user_sex', '', '', '', '2', '', '性别未知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (6, 0, '显示', '0', 'sys_show_hide', '', '', '', '2', '', '显示菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (7, 0, '隐藏', '1', 'sys_show_hide', '', '', '', '2', '', '隐藏菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (8, 0, '是', 'Y', 'sys_yes_no', '', '', '', '2', '', '系统默认是', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (9, 0, '否', 'N', 'sys_yes_no', '', '', '', '2', '', '系统默认否', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (10, 0, '正常', '2', 'sys_job_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (11, 0, '停用', '1', 'sys_job_status', '', '', '', '2', '', '停用状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (12, 0, '默认', 'DEFAULT', 'sys_job_group', '', '', '', '2', '', '默认分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (13, 0, '系统', 'SYSTEM', 'sys_job_group', '', '', '', '2', '', '系统分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (14, 0, '通知', '1', 'sys_notice_type', '', '', '', '2', '', '通知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (15, 0, '公告', '2', 'sys_notice_type', '', '', '', '2', '', '公告', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (16, 0, '正常', '2', 'sys_common_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (17, 0, '关闭', '1', 'sys_common_status', '', '', '', '2', '', '关闭状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (18, 0, '新增', '1', 'sys_oper_type', '', '', '', '2', '', '新增操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (19, 0, '修改', '2', 'sys_oper_type', '', '', '', '2', '', '修改操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (20, 0, '删除', '3', 'sys_oper_type', '', '', '', '2', '', '删除操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (21, 0, '授权', '4', 'sys_oper_type', '', '', '', '2', '', '授权操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (22, 0, '导出', '5', 'sys_oper_type', '', '', '', '2', '', '导出操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (23, 0, '导入', '6', 'sys_oper_type', '', '', '', '2', '', '导入操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (24, 0, '强退', '7', 'sys_oper_type', '', '', '', '2', '', '强退操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (25, 0, '生成代码', '8', 'sys_oper_type', '', '', '', '2', '', '生成操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (26, 0, '清空数据', '9', 'sys_oper_type', '', '', '', '2', '', '清空操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (27, 0, '成功', '0', 'sys_notice_status', '', '', '', '2', '', '成功状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (28, 0, '失败', '1', 'sys_notice_status', '', '', '', '2', '', '失败状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (29, 0, '登录', '10', 'sys_oper_type', '', '', '', '2', '', '登录操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (30, 0, '退出', '11', 'sys_oper_type', '', '', '', '2', '', '', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', '2', '', '获取验证码', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (32, 0, '正常', '1', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); +INSERT INTO sys_dict_data VALUES (33, 1, '禁用', '2', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); -BEGIN; -INSERT INTO `sys_dict_data` VALUES (1, 0, '正常', '2', 'sys_normal_disable', '', '', '', '2', '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', NULL); -INSERT INTO `sys_dict_data` VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', '2', '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', '2', '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (4, 0, '女', '1', 'sys_user_sex', '', '', '', '2', '', '性别女', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (5, 0, '未知', '2', 'sys_user_sex', '', '', '', '2', '', '性别未知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (6, 0, '显示', '0', 'sys_show_hide', '', '', '', '2', '', '显示菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (7, 0, '隐藏', '1', 'sys_show_hide', '', '', '', '2', '', '隐藏菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (8, 0, '是', 'Y', 'sys_yes_no', '', '', '', '2', '', '系统默认是', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (9, 0, '否', 'N', 'sys_yes_no', '', '', '', '2', '', '系统默认否', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (10, 0, '正常', '2', 'sys_job_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (11, 0, '停用', '1', 'sys_job_status', '', '', '', '2', '', '停用状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (12, 0, '默认', 'DEFAULT', 'sys_job_group', '', '', '', '2', '', '默认分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (13, 0, '系统', 'SYSTEM', 'sys_job_group', '', '', '', '2', '', '系统分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (14, 0, '通知', '1', 'sys_notice_type', '', '', '', '2', '', '通知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (15, 0, '公告', '2', 'sys_notice_type', '', '', '', '2', '', '公告', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (16, 0, '正常', '2', 'sys_common_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (17, 0, '关闭', '1', 'sys_common_status', '', '', '', '2', '', '关闭状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (18, 0, '新增', '1', 'sys_oper_type', '', '', '', '2', '', '新增操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (19, 0, '修改', '2', 'sys_oper_type', '', '', '', '2', '', '修改操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (20, 0, '删除', '3', 'sys_oper_type', '', '', '', '2', '', '删除操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (21, 0, '授权', '4', 'sys_oper_type', '', '', '', '2', '', '授权操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (22, 0, '导出', '5', 'sys_oper_type', '', '', '', '2', '', '导出操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (23, 0, '导入', '6', 'sys_oper_type', '', '', '', '2', '', '导入操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (24, 0, '强退', '7', 'sys_oper_type', '', '', '', '2', '', '强退操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (25, 0, '生成代码', '8', 'sys_oper_type', '', '', '', '2', '', '生成操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (26, 0, '清空数据', '9', 'sys_oper_type', '', '', '', '2', '', '清空操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (27, 0, '成功', '0', 'sys_notice_status', '', '', '', '2', '', '成功状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (28, 0, '失败', '1', 'sys_notice_status', '', '', '', '2', '', '失败状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (29, 0, '登录', '10', 'sys_oper_type', '', '', '', '2', '', '登录操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (30, 0, '退出', '11', 'sys_oper_type', '', '', '', '2', '', '', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', '2', '', '获取验证码', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (32, 0, '正常', '1', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); -INSERT INTO `sys_dict_data` VALUES (33, 1, '禁用', '2', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); -COMMIT; +INSERT INTO sys_dict_type VALUES (1, '系统开关', 'sys_normal_disable', '2', '系统开关列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (2, '用户性别', 'sys_user_sex', '2', '用户性别列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (3, '菜单状态', 'sys_show_hide', '2', '菜单状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (4, '系统是否', 'sys_yes_no', '2', '系统是否列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (5, '任务状态', 'sys_job_status', '2', '任务状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (6, '任务分组', 'sys_job_group', '2', '任务分组列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (7, '通知类型', 'sys_notice_type', '2', '通知类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (8, '系统状态', 'sys_common_status', '2', '登录状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (9, '操作类型', 'sys_oper_type', '2', '操作类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (10, '通知状态', 'sys_notice_status', '2', '通知状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (11, '内容状态', 'sys_content_status', '2', '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', NULL); -BEGIN; -INSERT INTO `sys_dict_type` VALUES (1, '系统开关', 'sys_normal_disable', '2', '系统开关列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (2, '用户性别', 'sys_user_sex', '2', '用户性别列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (3, '菜单状态', 'sys_show_hide', '2', '菜单状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (4, '系统是否', 'sys_yes_no', '2', '系统是否列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (5, '任务状态', 'sys_job_status', '2', '任务状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (6, '任务分组', 'sys_job_group', '2', '任务分组列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', '2', '通知类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (8, '系统状态', 'sys_common_status', '2', '登录状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '2', '操作类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (10, '通知状态', 'sys_notice_status', '2', '通知状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (11, '内容状态', 'sys_content_status', '2', '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', NULL); -COMMIT; +INSERT INTO sys_job VALUES (1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', NULL, 1, 1); +INSERT INTO sys_job VALUES (2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', NULL, 1, 1); -BEGIN; -INSERT INTO `sys_job` VALUES (1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', NULL, 1, 1); -INSERT INTO `sys_job` VALUES (2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', NULL, 1, 1); -COMMIT; - -BEGIN; -INSERT INTO `sys_menu` VALUES (2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (43, '', '新增管理员1', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (44, '', '查询管理员', 'app-group-fill', '', '/0/2/3/44', 'F', 'GET', 'admin:sysUser:query', 3, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (45, '', '修改管理员', 'app-group-fill', '', '/0/2/3/45', 'F', 'PUT', 'admin:sysUser:edit', 3, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (46, '', '删除管理员', 'app-group-fill', '', '/0/2/3/46', 'F', 'DELETE', 'admin:sysUser:remove', 3, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (51, 'SysMenuManage', '菜单管理', 'tree-table', '/admin/sys-menu', '/0/2/51', 'C', '无', 'admin:sysMenu:list', 2, 1, '', '/admin/sys-menu/index', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (52, 'SysRoleManage', '角色管理', 'peoples', '/admin/sys-role', '/0/2/52', 'C', '无', 'admin:sysRole:list', 2, 1, '', '/admin/sys-role/index', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (56, 'SysDeptManage', '部门管理', 'tree', '/admin/sys-dept', '/0/2/56', 'C', '无', 'admin:sysDept:list', 2, 0, '', '/admin/sys-dept/index', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (57, 'SysPostManage', '岗位管理', 'pass', '/admin/sys-post', '/0/2/57', 'C', '无', 'admin:sysPost:list', 2, 0, '', '/admin/sys-post/index', 50, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (58, 'Dict', '字典管理', 'education', '/admin/dict', '/0/2/58', 'C', '无', 'admin:sysDictType:list', 2, 0, '', '/admin/dict/index', 60, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (59, 'SysDictDataManage', '字典数据', 'education', '/admin/dict/data/:dictId', '/0/2/59', 'C', '无', 'admin:sysDictData:list', 2, 0, '', '/admin/dict/data', 100, '1', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (60, 'Tools', '开发工具', 'dev-tools', '/dev-tools', '/0/60', 'M', '无', '', 0, 0, '', 'Layout', 40, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (61, 'Swagger', '系统接口', 'guide', '/dev-tools/swagger', '/0/60/61', 'C', '无', '', 60, 0, '', '/dev-tools/swagger/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (62, 'SysConfigManage', '参数管理', 'swagger', '/admin/sys-config', '/0/2/62', 'C', '无', 'admin:sysConfig:list', 2, 0, '', '/admin/sys-config/index', 70, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (211, 'Log', '日志管理', 'log', '/log', '/0/2/211', 'M', '', '', 2, 0, '', '/log/index', 80, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (212, 'SysLoginLogManage', '登录日志', 'logininfor', '/admin/sys-login-log', '/0/2/211/212', 'C', '', 'admin:sysLoginLog:list', 211, 0, '', '/admin/sys-login-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (216, 'OperLog', '操作日志', 'skill', '/admin/sys-oper-log', '/0/2/211/216', 'C', '', 'admin:sysOperLog:list', 211, 0, '', '/admin/sys-oper-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (220, '', '新增菜单', 'app-group-fill', '', '/0/2/51/220', 'F', '', 'admin:sysMenu:add', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (221, '', '修改菜单', 'app-group-fill', '', '/0/2/51/221', 'F', '', 'admin:sysMenu:edit', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (222, '', '查询菜单', 'app-group-fill', '', '/0/2/51/222', 'F', '', 'admin:sysMenu:query', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (223, '', '删除菜单', 'app-group-fill', '', '/0/2/51/223', 'F', '', 'admin:sysMenu:remove', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (224, '', '新增角色', 'app-group-fill', '', '/0/2/52/224', 'F', '', 'admin:sysRole:add', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (225, '', '查询角色', 'app-group-fill', '', '/0/2/52/225', 'F', '', 'admin:sysRole:query', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (226, '', '修改角色', 'app-group-fill', '', '/0/2/52/226', 'F', '', 'admin:sysRole:update', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (227, '', '删除角色', 'app-group-fill', '', '/0/2/52/227', 'F', '', 'admin:sysRole:remove', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (228, '', '查询部门', 'app-group-fill', '', '/0/2/56/228', 'F', '', 'admin:sysDept:query', 56, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (229, '', '新增部门', 'app-group-fill', '', '/0/2/56/229', 'F', '', 'admin:sysDept:add', 56, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (230, '', '修改部门', 'app-group-fill', '', '/0/2/56/230', 'F', '', 'admin:sysDept:edit', 56, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (231, '', '删除部门', 'app-group-fill', '', '/0/2/56/231', 'F', '', 'admin:sysDept:remove', 56, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (232, '', '查询岗位', 'app-group-fill', '', '/0/2/57/232', 'F', '', 'admin:sysPost:query', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (233, '', '新增岗位', 'app-group-fill', '', '/0/2/57/233', 'F', '', 'admin:sysPost:add', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (234, '', '修改岗位', 'app-group-fill', '', '/0/2/57/234', 'F', '', 'admin:sysPost:edit', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (235, '', '删除岗位', 'app-group-fill', '', '/0/2/57/235', 'F', '', 'admin:sysPost:remove', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (236, '', '查询字典', 'app-group-fill', '', '/0/2/58/236', 'F', '', 'admin:sysDictType:query', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (237, '', '新增类型', 'app-group-fill', '', '/0/2/58/237', 'F', '', 'admin:sysDictType:add', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (238, '', '修改类型', 'app-group-fill', '', '/0/2/58/238', 'F', '', 'admin:sysDictType:edit', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (239, '', '删除类型', 'app-group-fill', '', '/0/2/58/239', 'F', '', 'system:sysdicttype:remove', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (240, '', '查询数据', 'app-group-fill', '', '/0/2/59/240', 'F', '', 'admin:sysDictData:query', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (241, '', '新增数据', 'app-group-fill', '', '/0/2/59/241', 'F', '', 'admin:sysDictData:add', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (242, '', '修改数据', 'app-group-fill', '', '/0/2/59/242', 'F', '', 'admin:sysDictData:edit', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (243, '', '删除数据', 'app-group-fill', '', '/0/2/59/243', 'F', '', 'admin:sysDictData:remove', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (244, '', '查询参数', 'app-group-fill', '', '/0/2/62/244', 'F', '', 'admin:sysConfig:query', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (245, '', '新增参数', 'app-group-fill', '', '/0/2/62/245', 'F', '', 'admin:sysConfig:add', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (246, '', '修改参数', 'app-group-fill', '', '/0/2/62/246', 'F', '', 'admin:sysConfig:edit', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (247, '', '删除参数', 'app-group-fill', '', '/0/2/62/247', 'F', '', 'admin:sysConfig:remove', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (248, '', '查询登录日志', 'app-group-fill', '', '/0/2/211/212/248', 'F', '', 'admin:sysLoginLog:query', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (249, '', '删除登录日志', 'app-group-fill', '', '/0/2/211/212/249', 'F', '', 'admin:sysLoginLog:remove', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (250, '', '查询操作日志', 'app-group-fill', '', '/0/2/211/216/250', 'F', '', 'admin:sysOperLog:query', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (251, '', '删除操作日志', 'app-group-fill', '', '/0/2/211/216/251', 'F', '', 'admin:sysOperLog:remove', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (261, 'Gen', '代码生成', 'code', '/dev-tools/gen', '/0/60/261', 'C', '', '', 60, 0, '', '/dev-tools/gen/index', 2, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (262, 'EditTable', '代码生成修改', 'build', '/dev-tools/editTable', '/0/60/262', 'C', '', '', 60, 0, '', '/dev-tools/gen/editTable', 100, '1', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (264, 'Build', '表单构建', 'build', '/dev-tools/build', '/0/60/264', 'C', '', '', 60, 0, '', '/dev-tools/build/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (269, 'ServerMonitor', '服务监控', 'druid', '/sys-tools/monitor', '/0/60/269', 'C', '', 'sysTools:serverMonitor:list', 537, 0, '', '/sys-tools/monitor', 0, '0', '1', 1, 1, '2020-04-14 00:28:19.000', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (459, 'Schedule', '定时任务', 'time-range', '/schedule', '/0/459', 'M', '无', '', 0, 0, '', 'Layout', 20, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (460, 'ScheduleManage', 'Schedule', 'job', '/schedule/manage', '/0/459/460', 'C', '无', 'job:sysJob:list', 459, 0, '', '/schedule/index', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (461, 'sys_job', '分页获取定时任务', 'app-group-fill', '', '/0/459/460/461', 'F', '无', 'job:sysJob:query', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (462, 'sys_job', '创建定时任务', 'app-group-fill', '', '/0/459/460/462', 'F', '无', 'job:sysJob:add', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (463, 'sys_job', '修改定时任务', 'app-group-fill', '', '/0/459/460/463', 'F', '无', 'job:sysJob:edit', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (464, 'sys_job', '删除定时任务', 'app-group-fill', '', '/0/459/460/464', 'F', '无', 'job:sysJob:remove', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (471, 'JobLog', '日志', 'bug', '/schedule/log', '/0/459/471', 'C', '', '', 459, 0, '', '/schedule/log', 0, '1', '1', 1, 1, '2020-08-05 21:24:46.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (496, 'Sources', '资源管理', 'network', '/sources', '/0/496', 'M', '无', '', 0, 1, '', 'Layout', 50, '0', '1', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (497, 'File', '文件管理', 'documentation', '/sources/file-manage', '/0/496/497', 'C', '', '', 496, 1, '', '/other/fileManage/index', 0, '0', '1', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (498, '', '内容管理', 'archived', '/cms', '/0/498', 'M', '无', '', 0, 1, '', 'Layout', 60, '0', '1', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (499, 'SysCategoryManage', '分类', 'list', '/cms/sys-category', '/0/498/499', 'C', '无', 'cms:sysCategory:list', 498, 1, '', '/sys-category/index', 0, '0', '0', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (500, '', '分页获取分类', 'app-group-fill', '', '/0/498/499/500', 'F', '无', 'cms:sysCategory:query', 499, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (501, '', '创建分类', 'app-group-fill', '', '/0/498/499/501', 'F', '无', 'cms:sysCategory:add', 499, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (502, '', '修改分类', 'app-group-fill', '', '/0/498/499/502', 'F', '无', 'cms:sysCategory:edit', 499, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (503, '', '删除分类', 'app-group-fill', '', '/0/498/499/503', 'F', '无', 'cms:sysCategory:remove', 499, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (511, 'SysContentManage', '内容管理', 'pass', '/cms/sys-content', '/0/498/511', 'C', '无', 'cms:sysContent:list', 498, 1, '', '/sys-content/index', 0, '0', '0', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (512, '', '分页获取内容管理', 'app-group-fill', '', '/0/510/511/512', 'F', '无', 'cms:sysContent:query', 511, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (513, '', '创建内容管理', 'app-group-fill', '', '/0/510/511/513', 'F', '无', 'cms:sysContent:add', 511, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (514, '', '修改内容管理', 'app-group-fill', '', '/0/510/511/514', 'F', '无', 'cms:sysContent:edit', 511, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (515, '', '删除内容管理', 'app-group-fill', '', '/0/510/511/515', 'F', '无', 'cms:sysContent:remove', 511, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (522, 'SysContentCreate', '新增', 'form', '/cms/sys-content/create', '/0/498/522', 'C', '', 'cms:sysContent:add', 498, 0, '', '/syscontent/create.vue', 0, '1', '1', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (523, 'SysContentEdit', '编辑', 'edit', '/cms/sys-content/edit:id', '/0/498/523', 'C', '', 'cmd:sysContent:edit', 498, 0, '', '/sys-content/edit.vue', 0, '1', '1', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (528, 'SysApiManage', '接口管理', 'api-doc', '/admin/sys-api', '/0/527/528', 'C', '无', 'admin:sysApi:list', 2, 0, '', '/admin/sys-api/index', 0, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (529, '', '查询接口', 'app-group-fill', '', '/0/527/528/529', 'F', '无', 'admin:sysApi:query', 528, 0, '', '', 40, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (531, '', '修改接口', 'app-group-fill', '', '/0/527/528/531', 'F', '无', 'admin:sysApi:edit', 528, 0, '', '', 30, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (537, 'SysTools', '系统工具', 'system-tools', '/sys-tools', '', 'M', '', '', 0, 0, '', 'Layout', 30, '0', '1', 1, 1, '2021-05-21 11:13:32.166', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (538, 'SysChinaAreaData', '行政区管理', 'nested', '/sys-tools/sys-china-area-data', '', 'C', '', 'sysTools:sysChinaAreaData:list', 537, 0, '', '/sys-tools/sys-china-area-data/index', 0, '0', '1', 1, 1, '2021-05-21 11:18:50.712', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (540, 'SysConfigSet', '参数设置', 'system-tools', '/admin/sys-config/set', '', 'C', '', 'admin:sysConfigSet:list', 2, 0, '', '/admin/sys-config/set', 0, '0', '1', 1, 1, '2021-05-25 16:06:52.560', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (542, '', '修改', 'upload', '', '', 'F', '', 'admin:sysConfigSet:update', 540, 0, '', '', 0, '0', '1', 1, 1, '2021-06-13 11:45:48.670', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (544, '1', '1', '404', '1', '', 'C', '', '1', 0, 0, '', '1', 0, '0', '1', 1, 1, '2021-06-16 21:42:52.603', '2021-06-16 21:43:05.400', '2021-06-16 21:43:14.403'); -INSERT INTO `sys_menu` VALUES (545, '1', '1', 'chart', '1', '', 'C', '', '1', 0, 0, '', '1', 0, '0', '1', 1, 0, '2021-06-16 21:43:39.774', '2021-06-16 21:43:39.774', '2021-06-16 21:48:54.255'); -INSERT INTO `sys_menu` VALUES (546, '1', '1', '404', '1', '', 'C', '', '1', 0, 0, '', '1', 0, '0', '1', 1, 1, '2021-06-16 21:49:13.861', '2021-06-16 21:49:48.583', '2021-06-16 21:49:52.490'); -INSERT INTO `sys_menu_api_rule` VALUES (544, 5); -INSERT INTO `sys_menu_api_rule` VALUES (546, 5); -INSERT INTO `sys_menu_api_rule` VALUES (216, 6); -INSERT INTO `sys_menu_api_rule` VALUES (250, 6); -INSERT INTO `sys_menu_api_rule` VALUES (546, 6); -INSERT INTO `sys_menu_api_rule` VALUES (546, 7); -INSERT INTO `sys_menu_api_rule` VALUES (58, 21); -INSERT INTO `sys_menu_api_rule` VALUES (236, 21); -INSERT INTO `sys_menu_api_rule` VALUES (238, 23); -INSERT INTO `sys_menu_api_rule` VALUES (59, 24); -INSERT INTO `sys_menu_api_rule` VALUES (240, 24); -INSERT INTO `sys_menu_api_rule` VALUES (242, 25); -INSERT INTO `sys_menu_api_rule` VALUES (58, 26); -INSERT INTO `sys_menu_api_rule` VALUES (236, 26); -INSERT INTO `sys_menu_api_rule` VALUES (56, 27); -INSERT INTO `sys_menu_api_rule` VALUES (228, 27); -INSERT INTO `sys_menu_api_rule` VALUES (230, 28); -INSERT INTO `sys_menu_api_rule` VALUES (226, 29); -INSERT INTO `sys_menu_api_rule` VALUES (51, 39); -INSERT INTO `sys_menu_api_rule` VALUES (222, 39); -INSERT INTO `sys_menu_api_rule` VALUES (221, 41); -INSERT INTO `sys_menu_api_rule` VALUES (52, 44); -INSERT INTO `sys_menu_api_rule` VALUES (225, 44); -INSERT INTO `sys_menu_api_rule` VALUES (226, 45); -INSERT INTO `sys_menu_api_rule` VALUES (226, 46); -INSERT INTO `sys_menu_api_rule` VALUES (226, 47); -INSERT INTO `sys_menu_api_rule` VALUES (62, 53); -INSERT INTO `sys_menu_api_rule` VALUES (244, 53); -INSERT INTO `sys_menu_api_rule` VALUES (246, 54); -INSERT INTO `sys_menu_api_rule` VALUES (57, 59); -INSERT INTO `sys_menu_api_rule` VALUES (232, 59); -INSERT INTO `sys_menu_api_rule` VALUES (234, 60); -INSERT INTO `sys_menu_api_rule` VALUES (241, 80); -INSERT INTO `sys_menu_api_rule` VALUES (237, 81); -INSERT INTO `sys_menu_api_rule` VALUES (229, 82); -INSERT INTO `sys_menu_api_rule` VALUES (245, 87); -INSERT INTO `sys_menu_api_rule` VALUES (220, 88); -INSERT INTO `sys_menu_api_rule` VALUES (233, 89); -INSERT INTO `sys_menu_api_rule` VALUES (224, 90); -INSERT INTO `sys_menu_api_rule` VALUES (531, 92); -INSERT INTO `sys_menu_api_rule` VALUES (242, 101); -INSERT INTO `sys_menu_api_rule` VALUES (238, 102); -INSERT INTO `sys_menu_api_rule` VALUES (230, 103); -INSERT INTO `sys_menu_api_rule` VALUES (226, 106); -INSERT INTO `sys_menu_api_rule` VALUES (226, 107); -INSERT INTO `sys_menu_api_rule` VALUES (246, 108); -INSERT INTO `sys_menu_api_rule` VALUES (221, 109); -INSERT INTO `sys_menu_api_rule` VALUES (234, 110); -INSERT INTO `sys_menu_api_rule` VALUES (249, 114); -INSERT INTO `sys_menu_api_rule` VALUES (251, 115); -INSERT INTO `sys_menu_api_rule` VALUES (243, 120); -INSERT INTO `sys_menu_api_rule` VALUES (239, 121); -INSERT INTO `sys_menu_api_rule` VALUES (231, 122); -INSERT INTO `sys_menu_api_rule` VALUES (247, 125); -INSERT INTO `sys_menu_api_rule` VALUES (223, 126); -INSERT INTO `sys_menu_api_rule` VALUES (235, 127); -INSERT INTO `sys_menu_api_rule` VALUES (227, 128); -INSERT INTO `sys_menu_api_rule` VALUES (528, 135); -INSERT INTO `sys_menu_api_rule` VALUES (529, 135); -INSERT INTO `sys_menu_api_rule` VALUES (531, 136); -INSERT INTO `sys_menu_api_rule` VALUES (212, 137); -INSERT INTO `sys_menu_api_rule` VALUES (248, 137); -INSERT INTO `sys_menu_api_rule` VALUES (542, 139); -INSERT INTO `sys_menu_api_rule` VALUES (540, 140); -INSERT INTO `sys_menu_api_rule` VALUES (3, 141); -INSERT INTO `sys_menu_api_rule` VALUES (44, 141); -INSERT INTO `sys_menu_api_rule` VALUES (45, 142); -INSERT INTO `sys_menu_api_rule` VALUES (43, 150); -INSERT INTO `sys_menu_api_rule` VALUES (45, 151); -INSERT INTO `sys_menu_api_rule` VALUES (46, 156); -INSERT INTO `sys_post` VALUES (1, '首席执行官', 'CEO', 0, '2','首席执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_post` VALUES (2, '首席技术执行官', 'CTO', 2, '2','首席技术执行官', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_post` VALUES (3, '首席运营官', 'COO', 3, '2','测试工程师', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_role` VALUES (1, '系统管理员', '2', 'admin', 1, '', '', 1, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_user` VALUES (1, 'admin', '$2a$10$/Glr4g9Svr6O0kvjsRJCXu3f0W8/dsP3XZyVNi1019ratWpSPMyw.', 'zhangwj', '13818888888', 1, '', '', '1', '1@qq.com', 1, 1, '', '2', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.205', NULL); -COMMIT; - -SET FOREIGN_KEY_CHECKS = 1; - --- 数据完成 ; +INSERT INTO sys_menu VALUES (2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, true, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, false, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, false, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (44, '', '查询管理员', 'app-group-fill', '', '/0/2/3/44', 'F', 'GET', 'admin:sysUser:query', 3, false, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (45, '', '修改管理员', 'app-group-fill', '', '/0/2/3/45', 'F', 'PUT', 'admin:sysUser:edit', 3, false, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (46, '', '删除管理员', 'app-group-fill', '', '/0/2/3/46', 'F', 'DELETE', 'admin:sysUser:remove', 3, false, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (51, 'SysMenuManage', '菜单管理', 'tree-table', '/admin/sys-menu', '/0/2/51', 'C', '无', 'admin:sysMenu:list', 2, true, '', '/admin/sys-menu/index', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (52, 'SysRoleManage', '角色管理', 'peoples', '/admin/sys-role', '/0/2/52', 'C', '无', 'admin:sysRole:list', 2, true, '', '/admin/sys-role/index', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (56, 'SysDeptManage', '部门管理', 'tree', '/admin/sys-dept', '/0/2/56', 'C', '无', 'admin:sysDept:list', 2, false, '', '/admin/sys-dept/index', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (57, 'SysPostManage', '岗位管理', 'pass', '/admin/sys-post', '/0/2/57', 'C', '无', 'admin:sysPost:list', 2, false, '', '/admin/sys-post/index', 50, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (58, 'Dict', '字典管理', 'education', '/admin/dict', '/0/2/58', 'C', '无', 'admin:sysDictType:list', 2, false, '', '/admin/dict/index', 60, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (59, 'SysDictDataManage', '字典数据', 'education', '/admin/dict/data/:dictId', '/0/2/59', 'C', '无', 'admin:sysDictData:list', 2, false, '', '/admin/dict/data', 100, '1', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (60, 'Tools', '开发工具', 'dev-tools', '/dev-tools', '/0/60', 'M', '无', '', 0, false, '', 'Layout', 40, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (61, 'Swagger', '系统接口', 'guide', '/dev-tools/swagger', '/0/60/61', 'C', '无', '', 60, false, '', '/dev-tools/swagger/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (62, 'SysConfigManage', '参数管理', 'swagger', '/admin/sys-config', '/0/2/62', 'C', '无', 'admin:sysConfig:list', 2, false, '', '/admin/sys-config/index', 70, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (211, 'Log', '日志管理', 'log', '/log', '/0/2/211', 'M', '', '', 2, false, '', '/log/index', 80, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (212, 'SysLoginLogManage', '登录日志', 'logininfor', '/admin/sys-login-log', '/0/2/211/212', 'C', '', 'admin:sysLoginLog:list', 211, false, '', '/admin/sys-login-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (216, 'OperLog', '操作日志', 'skill', '/admin/sys-oper-log', '/0/2/211/216', 'C', '', 'admin:sysOperLog:list', 211, false, '', '/admin/sys-oper-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (220, '', '新增菜单', 'app-group-fill', '', '/0/2/51/220', 'F', '', 'admin:sysMenu:add', 51, false, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (221, '', '修改菜单', 'app-group-fill', '', '/0/2/51/221', 'F', '', 'admin:sysMenu:edit', 51, false, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (222, '', '查询菜单', 'app-group-fill', '', '/0/2/51/222', 'F', '', 'admin:sysMenu:query', 51, false, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (223, '', '删除菜单', 'app-group-fill', '', '/0/2/51/223', 'F', '', 'admin:sysMenu:remove', 51, false, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (224, '', '新增角色', 'app-group-fill', '', '/0/2/52/224', 'F', '', 'admin:sysRole:add', 52, false, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (225, '', '查询角色', 'app-group-fill', '', '/0/2/52/225', 'F', '', 'admin:sysRole:query', 52, false, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (226, '', '修改角色', 'app-group-fill', '', '/0/2/52/226', 'F', '', 'admin:sysRole:update', 52, false, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (227, '', '删除角色', 'app-group-fill', '', '/0/2/52/227', 'F', '', 'admin:sysRole:remove', 52, false, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (228, '', '查询部门', 'app-group-fill', '', '/0/2/56/228', 'F', '', 'admin:sysDept:query', 56, false, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (229, '', '新增部门', 'app-group-fill', '', '/0/2/56/229', 'F', '', 'admin:sysDept:add', 56, false, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (230, '', '修改部门', 'app-group-fill', '', '/0/2/56/230', 'F', '', 'admin:sysDept:edit', 56, false, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (231, '', '删除部门', 'app-group-fill', '', '/0/2/56/231', 'F', '', 'admin:sysDept:remove', 56, false, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (232, '', '查询岗位', 'app-group-fill', '', '/0/2/57/232', 'F', '', 'admin:sysPost:query', 57, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (233, '', '新增岗位', 'app-group-fill', '', '/0/2/57/233', 'F', '', 'admin:sysPost:add', 57, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (234, '', '修改岗位', 'app-group-fill', '', '/0/2/57/234', 'F', '', 'admin:sysPost:edit', 57, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (235, '', '删除岗位', 'app-group-fill', '', '/0/2/57/235', 'F', '', 'admin:sysPost:remove', 57, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (236, '', '查询字典', 'app-group-fill', '', '/0/2/58/236', 'F', '', 'admin:sysDictType:query', 58, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (237, '', '新增类型', 'app-group-fill', '', '/0/2/58/237', 'F', '', 'admin:sysDictType:add', 58, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (238, '', '修改类型', 'app-group-fill', '', '/0/2/58/238', 'F', '', 'admin:sysDictType:edit', 58, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (239, '', '删除类型', 'app-group-fill', '', '/0/2/58/239', 'F', '', 'system:sysdicttype:remove', 58, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (240, '', '查询数据', 'app-group-fill', '', '/0/2/59/240', 'F', '', 'admin:sysDictData:query', 59, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (241, '', '新增数据', 'app-group-fill', '', '/0/2/59/241', 'F', '', 'admin:sysDictData:add', 59, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (242, '', '修改数据', 'app-group-fill', '', '/0/2/59/242', 'F', '', 'admin:sysDictData:edit', 59, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (243, '', '删除数据', 'app-group-fill', '', '/0/2/59/243', 'F', '', 'admin:sysDictData:remove', 59, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (244, '', '查询参数', 'app-group-fill', '', '/0/2/62/244', 'F', '', 'admin:sysConfig:query', 62, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (245, '', '新增参数', 'app-group-fill', '', '/0/2/62/245', 'F', '', 'admin:sysConfig:add', 62, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (246, '', '修改参数', 'app-group-fill', '', '/0/2/62/246', 'F', '', 'admin:sysConfig:edit', 62, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (247, '', '删除参数', 'app-group-fill', '', '/0/2/62/247', 'F', '', 'admin:sysConfig:remove', 62, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (248, '', '查询登录日志', 'app-group-fill', '', '/0/2/211/212/248', 'F', '', 'admin:sysLoginLog:query', 212, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (249, '', '删除登录日志', 'app-group-fill', '', '/0/2/211/212/249', 'F', '', 'admin:sysLoginLog:remove', 212, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (250, '', '查询操作日志', 'app-group-fill', '', '/0/2/211/216/250', 'F', '', 'admin:sysOperLog:query', 216, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (251, '', '删除操作日志', 'app-group-fill', '', '/0/2/211/216/251', 'F', '', 'admin:sysOperLog:remove', 216, false, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (261, 'Gen', '代码生成', 'code', '/dev-tools/gen', '/0/60/261', 'C', '', '', 60, false, '', '/dev-tools/gen/index', 2, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (262, 'EditTable', '代码生成修改', 'build', '/dev-tools/editTable', '/0/60/262', 'C', '', '', 60, false, '', '/dev-tools/gen/editTable', 100, '1', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (264, 'Build', '表单构建', 'build', '/dev-tools/build', '/0/60/264', 'C', '', '', 60, false, '', '/dev-tools/build/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (269, 'ServerMonitor', '服务监控', 'druid', '/sys-tools/monitor', '/0/60/269', 'C', '', 'sysTools:serverMonitor:list', 537, false, '', '/sys-tools/monitor', 0, '0', '1', 1, 1, '2020-04-14 00:28:19.000', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (459, 'Schedule', '定时任务', 'time-range', '/schedule', '/0/459', 'M', '无', '', 0, false, '', 'Layout', 20, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (460, 'ScheduleManage', 'Schedule', 'job', '/schedule/manage', '/0/459/460', 'C', '无', 'job:sysJob:list', 459, false, '', '/schedule/index', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (461, 'sys_job', '分页获取定时任务', 'app-group-fill', '', '/0/459/460/461', 'F', '无', 'job:sysJob:query', 460, false, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (462, 'sys_job', '创建定时任务', 'app-group-fill', '', '/0/459/460/462', 'F', '无', 'job:sysJob:add', 460, false, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (463, 'sys_job', '修改定时任务', 'app-group-fill', '', '/0/459/460/463', 'F', '无', 'job:sysJob:edit', 460, false, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (464, 'sys_job', '删除定时任务', 'app-group-fill', '', '/0/459/460/464', 'F', '无', 'job:sysJob:remove', 460, false, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (471, 'JobLog', '日志', 'bug', '/schedule/log', '/0/459/471', 'C', '', '', 459, false, '', '/schedule/log', 0, '1', '1', 1, 1, '2020-08-05 21:24:46.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (528, 'SysApiManage', '接口管理', 'api-doc', '/admin/sys-api', '/0/527/528', 'C', '无', 'admin:sysApi:list', 2, false, '', '/admin/sys-api/index', 0, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (529, '', '查询接口', 'app-group-fill', '', '/0/527/528/529', 'F', '无', 'admin:sysApi:query', 528, false, '', '', 40, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (531, '', '修改接口', 'app-group-fill', '', '/0/527/528/531', 'F', '无', 'admin:sysApi:edit', 528, false, '', '', 30, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (537, 'SysTools', '系统工具', 'system-tools', '/sys-tools', '', 'M', '', '', 0, false, '', 'Layout', 30, '0', '1', 1, 1, '2021-05-21 11:13:32.166', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (540, 'SysConfigSet', '参数设置', 'system-tools', '/admin/sys-config/set', '', 'C', '', 'admin:sysConfigSet:list', 2, false, '', '/admin/sys-config/set', 0, '0', '1', 1, 1, '2021-05-25 16:06:52.560', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (542, '', '修改', 'upload', '', '', 'F', '', 'admin:sysConfigSet:update', 540, false, '', '', 0, '0', '1', 1, 1, '2021-06-13 11:45:48.670', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu_api_rule VALUES (216, 6); +INSERT INTO sys_menu_api_rule VALUES (250, 6); +INSERT INTO sys_menu_api_rule VALUES (58, 21); +INSERT INTO sys_menu_api_rule VALUES (236, 21); +INSERT INTO sys_menu_api_rule VALUES (238, 23); +INSERT INTO sys_menu_api_rule VALUES (59, 24); +INSERT INTO sys_menu_api_rule VALUES (240, 24); +INSERT INTO sys_menu_api_rule VALUES (242, 25); +INSERT INTO sys_menu_api_rule VALUES (58, 26); +INSERT INTO sys_menu_api_rule VALUES (236, 26); +INSERT INTO sys_menu_api_rule VALUES (56, 27); +INSERT INTO sys_menu_api_rule VALUES (228, 27); +INSERT INTO sys_menu_api_rule VALUES (230, 28); +INSERT INTO sys_menu_api_rule VALUES (226, 29); +INSERT INTO sys_menu_api_rule VALUES (51, 39); +INSERT INTO sys_menu_api_rule VALUES (51, 135); +INSERT INTO sys_menu_api_rule VALUES (222, 39); +INSERT INTO sys_menu_api_rule VALUES (221, 41); +INSERT INTO sys_menu_api_rule VALUES (52, 44); +INSERT INTO sys_menu_api_rule VALUES (225, 44); +INSERT INTO sys_menu_api_rule VALUES (226, 45); +INSERT INTO sys_menu_api_rule VALUES (226, 46); +INSERT INTO sys_menu_api_rule VALUES (226, 47); +INSERT INTO sys_menu_api_rule VALUES (62, 53); +INSERT INTO sys_menu_api_rule VALUES (244, 53); +INSERT INTO sys_menu_api_rule VALUES (246, 54); +INSERT INTO sys_menu_api_rule VALUES (57, 59); +INSERT INTO sys_menu_api_rule VALUES (232, 59); +INSERT INTO sys_menu_api_rule VALUES (234, 60); +INSERT INTO sys_menu_api_rule VALUES (241, 80); +INSERT INTO sys_menu_api_rule VALUES (237, 81); +INSERT INTO sys_menu_api_rule VALUES (229, 82); +INSERT INTO sys_menu_api_rule VALUES (245, 87); +INSERT INTO sys_menu_api_rule VALUES (220, 88); +INSERT INTO sys_menu_api_rule VALUES (233, 89); +INSERT INTO sys_menu_api_rule VALUES (224, 90); +INSERT INTO sys_menu_api_rule VALUES (531, 92); +INSERT INTO sys_menu_api_rule VALUES (242, 101); +INSERT INTO sys_menu_api_rule VALUES (238, 102); +INSERT INTO sys_menu_api_rule VALUES (230, 103); +INSERT INTO sys_menu_api_rule VALUES (226, 106); +INSERT INTO sys_menu_api_rule VALUES (226, 107); +INSERT INTO sys_menu_api_rule VALUES (246, 108); +INSERT INTO sys_menu_api_rule VALUES (221, 109); +INSERT INTO sys_menu_api_rule VALUES (234, 110); +INSERT INTO sys_menu_api_rule VALUES (249, 114); +INSERT INTO sys_menu_api_rule VALUES (251, 115); +INSERT INTO sys_menu_api_rule VALUES (243, 120); +INSERT INTO sys_menu_api_rule VALUES (239, 121); +INSERT INTO sys_menu_api_rule VALUES (231, 122); +INSERT INTO sys_menu_api_rule VALUES (247, 125); +INSERT INTO sys_menu_api_rule VALUES (223, 126); +INSERT INTO sys_menu_api_rule VALUES (235, 127); +INSERT INTO sys_menu_api_rule VALUES (227, 128); +INSERT INTO sys_menu_api_rule VALUES (528, 135); +INSERT INTO sys_menu_api_rule VALUES (529, 135); +INSERT INTO sys_menu_api_rule VALUES (531, 136); +INSERT INTO sys_menu_api_rule VALUES (212, 137); +INSERT INTO sys_menu_api_rule VALUES (248, 137); +INSERT INTO sys_menu_api_rule VALUES (542, 139); +INSERT INTO sys_menu_api_rule VALUES (540, 140); +INSERT INTO sys_menu_api_rule VALUES (3, 141); +INSERT INTO sys_menu_api_rule VALUES (44, 141); +INSERT INTO sys_menu_api_rule VALUES (45, 142); +INSERT INTO sys_menu_api_rule VALUES (43, 150); +INSERT INTO sys_menu_api_rule VALUES (45, 151); +INSERT INTO sys_menu_api_rule VALUES (46, 156); +INSERT INTO sys_post VALUES (1, '首席执行官', 'CEO', 0, '2','首席执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_post VALUES (2, '首席技术执行官', 'CTO', 2, '2','首席技术执行官', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_post VALUES (3, '首席运营官', 'COO', 3, '2','测试工程师', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_role VALUES (1, '系统管理员', '2', 'admin', 1, '', '', true, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_user VALUES (1, 'admin', '$2a$10$/Glr4g9Svr6O0kvjsRJCXu3f0W8/dsP3XZyVNi1019ratWpSPMyw.', 'zhangwj', '13818888888', 1, '', '', '1', '1@qq.com', 1, 1, '', '2', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.205', NULL); +-- 数据完成 ; \ No newline at end of file diff --git a/config/pg.sql b/config/pg.sql index 1c6836ea7..ba3c0c82a 100644 --- a/config/pg.sql +++ b/config/pg.sql @@ -1,11 +1,21 @@ -- 开始初始化数据 ; +create sequence if not exists sys_role_role_id_seq; +create sequence if not exists sys_user_user_id_seq; +create sequence if not exists sys_post_post_id_seq; +create sequence if not exists sys_menu_menu_id_seq; +create sequence if not exists sys_dict_type_dict_id_seq; +create sequence if not exists sys_dict_data_dict_code_seq; +create sequence if not exists sys_dept_dept_id_seq; +create sequence if not exists sys_config_config_id_seq; +create sequence if not exists sys_job_id_seq; + select setval('sys_role_role_id_seq',4); select setval('sys_user_user_id_seq',5); select setval('sys_post_post_id_seq',4); -select setval('sys_menu_menu_id_seq',268); +select setval('sys_menu_menu_id_seq',543); select setval('sys_dict_type_dict_id_seq',12); -select setval('sys_dict_data_dict_code_seq',32); +select setval('sys_dict_data_dict_code_seq',34); select setval('sys_dept_dept_id_seq',11); -select setval('sys_config_config_id_seq',4); +select setval('sys_config_config_id_seq',6); select setval('sys_job_id_seq',3); --- 数据完成 ; \ No newline at end of file +-- 数据完成 ; diff --git a/config/settings.demo.yml b/config/settings.demo.yml new file mode 100644 index 000000000..9b297e693 --- /dev/null +++ b/config/settings.demo.yml @@ -0,0 +1,34 @@ +settings: + application: + demomsg: "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600" + enabledp: true + host: 0.0.0.0 + mode: demo + name: testApp + port: 8000 + readtimeout: 10000 + writertimeout: 20000 + database: + driver: sqlite3 + source: ./go-admin-db.db + gen: + dbname: testhhh + frontpath: ../go-admin-ui/src + jwt: + secret: go-admin + timeout: 3600 + logger: + # 日志存放路径 + path: temp/logs + # 日志输出,file:文件,default:命令行,其他:命令行 + stdout: '' #控制台日志,启用后,不输出到文件 + # 日志等级, trace, debug, info, warn, error, fatal + level: trace + # 数据库日志开关 + enableddb: true + queue: + memory: + poolSize: 100 + extend: + amap: + key: de7a062c984bf828d5d1b3a631a517e4 \ No newline at end of file diff --git a/config/settings.sqlite.yml b/config/settings.sqlite.yml index 8fb81fd0b..90e98e2ca 100644 --- a/config/settings.sqlite.yml +++ b/config/settings.sqlite.yml @@ -8,8 +8,8 @@ settings: name: testApp # 端口号 port: 8000 # 服务端口号 - readtimeout: 1 - writertimeout: 2 + readtimeout: 3000 + writertimeout: 2000 # 数据权限功能开关 enabledp: false logger: @@ -30,7 +30,7 @@ settings: # 数据库类型 mysql,sqlite3, postgres driver: sqlite3 # 数据库连接sqlite3数据文件的路径 - source: sqlite3.db + source: go-admin-db.db gen: # 代码生成读取的数据库名称 dbname: dbname diff --git a/config/settings.yml b/config/settings.yml index ca7186159..8e7ed8708 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -27,7 +27,8 @@ settings: # token 过期时间 单位:秒 timeout: 3600 database: - # 数据库类型 mysql,sqlite3, postgres + # 数据库类型 mysql, sqlite3, postgres, sqlserver + # sqlserver: sqlserver://用户名:密码@地址?database=数据库名 driver: mysql # 数据库连接字符串 mysql 缺省信息 charset=utf8&parseTime=True&loc=Local&timeout=1000ms source: user:password@tcp(127.0.0.1:3306)/dbname?charset=utf8&parseTime=True&loc=Local&timeout=1000ms @@ -70,4 +71,4 @@ settings: # blockingTimeout: 5 # reclaimInterval: 1 locker: - redis: + redis: \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..41d94dee4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +version: '3.8' +services: + go-admin-api: + container_name: go-admin + image: go-admin:latest + privileged: true + restart: always + ports: + - 8000:8000 + volumes: + - ./config/:/go-admin-api/config/ + - ./static/:/go-admin-api/static/ + - ./temp/:/go-admin-api/temp/ + networks: + - myweb +networks: + myweb: + driver: bridge + diff --git a/docs/docs.go b/docs/admin/admin_docs.go similarity index 89% rename from docs/docs.go rename to docs/admin/admin_docs.go index 7f5bd2645..31c596a56 100644 --- a/docs/docs.go +++ b/docs/admin/admin_docs.go @@ -1,22 +1,14 @@ -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Package admin GENERATED BY SWAG; DO NOT EDIT // This file was generated by swaggo/swag +package admin -package docs +import "github.com/swaggo/swag" -import ( - "bytes" - "encoding/json" - "strings" - - "github.com/alecthomas/template" - "github.com/swaggo/swag" -) - -var doc = `{ +const docTemplateadmin = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { - "description": "{{.Description}}", + "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, "license": { @@ -231,7 +223,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptControl" + "$ref": "#/definitions/dto.SysDeptInsertReq" } } ], @@ -262,7 +254,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptById" + "$ref": "#/definitions/dto.SysDeptDeleteReq" } } ], @@ -287,19 +279,13 @@ var doc = `{ "tags": [ "部门" ], - "summary": "部门列表数据", + "summary": "获取部门数据", "parameters": [ { "type": "string", "description": "deptId", "name": "deptId", "in": "path" - }, - { - "type": "string", - "description": "position", - "name": "position", - "in": "query" } ], "responses": { @@ -339,7 +325,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptControl" + "$ref": "#/definitions/dto.SysDeptUpdateReq" } } ], @@ -376,9 +362,24 @@ var doc = `{ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/response.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.SysDictDataGetAllResp" + } + } + } + } + ] } } } @@ -458,15 +459,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataControl" + "$ref": "#/definitions/dto.SysDictDataInsertReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"message\": \"添加成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -489,15 +490,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataById" + "$ref": "#/definitions/dto.SysDictDataDeleteReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"message\": \"删除成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -554,15 +555,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataControl" + "$ref": "#/definitions/dto.SysDictDataUpdateReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"message\": \"修改成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -642,15 +643,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictTypeControl" + "$ref": "#/definitions/dto.SysDictTypeInsertReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -668,18 +669,20 @@ var doc = `{ "summary": "删除字典类型", "parameters": [ { - "type": "integer", - "description": "dictId", - "name": "dictId", - "in": "path", - "required": true + "description": "body", + "name": "dictCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SysDictTypeDeleteReq" + } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -778,15 +781,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictTypeControl" + "$ref": "#/definitions/dto.SysDictTypeUpdateReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -858,12 +861,6 @@ var doc = `{ ], "summary": "Menu列表数据", "parameters": [ - { - "type": "string", - "description": "menuName", - "name": "menuName", - "in": "query" - }, { "type": "string", "description": "menuName", @@ -901,7 +898,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuControl" + "$ref": "#/definitions/dto.SysMenuInsertReq" } } ], @@ -932,7 +929,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuById" + "$ref": "#/definitions/dto.SysMenuDeleteReq" } } ], @@ -1003,7 +1000,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuControl" + "$ref": "#/definitions/dto.SysMenuUpdateReq" } } ], @@ -1147,9 +1144,9 @@ var doc = `{ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1178,15 +1175,9 @@ var doc = `{ ], "responses": { "200": { - "description": "{\"code\": 200, \"message\": \"删除成功\"}", - "schema": { - "type": "string" - } - }, - "500": { - "description": "{\"code\": 500, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1220,9 +1211,9 @@ var doc = `{ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1374,7 +1365,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleControl" + "$ref": "#/definitions/dto.SysRoleInsertReq" } } ], @@ -1405,7 +1396,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleById" + "$ref": "#/definitions/dto.SysRoleDeleteReq" } } ], @@ -1505,7 +1496,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleControl" + "$ref": "#/definitions/dto.SysRoleUpdateReq" } } ], @@ -1715,14 +1706,12 @@ var doc = `{ "summary": "删除接口管理", "parameters": [ { - "description": "ids", - "name": "ids", + "description": "body", + "name": "data", "in": "body", + "required": true, "schema": { - "type": "array", - "items": { - "type": "integer" - } + "$ref": "#/definitions/dto.SysApiDeleteReq" } } ], @@ -1798,7 +1787,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysApiControl" + "$ref": "#/definitions/dto.SysApiUpdateReq" } } ], @@ -2119,7 +2108,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysLoginLogById" + "$ref": "#/definitions/dto.SysLoginLogDeleteReq" } } ], @@ -2252,7 +2241,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysOperaLogById" + "$ref": "#/definitions/dto.SysOperaLogDeleteReq" } } ], @@ -2346,7 +2335,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysUserControl" + "$ref": "#/definitions/dto.SysUserInsertReq" } } ], @@ -2411,7 +2400,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysUserControl" + "$ref": "#/definitions/dto.SysUserUpdateReq" } } ], @@ -2719,7 +2708,7 @@ var doc = `{ "tags": [ "用户" ], - "summary": "重置密码", + "summary": "修改密码", "parameters": [ { "description": "body", @@ -2814,10 +2803,6 @@ var doc = `{ }, "dto.PassWord": { "type": "object", - "required": [ - "newPassword", - "oldPassword" - ], "properties": { "newPassword": { "type": "string" @@ -2829,10 +2814,6 @@ var doc = `{ }, "dto.ResetSysUserPwdReq": { "type": "object", - "required": [ - "password", - "userId" - ], "properties": { "createBy": { "type": "integer" @@ -2870,7 +2851,18 @@ var doc = `{ } } }, - "dto.SysApiControl": { + "dto.SysApiDeleteReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysApiUpdateReq": { "type": "object", "properties": { "action": { @@ -2931,7 +2923,7 @@ var doc = `{ "type": "integer" }, "isFrontend": { - "type": "integer" + "type": "string" }, "remark": { "type": "string" @@ -2941,12 +2933,9 @@ var doc = `{ } } }, - "dto.SysDeptById": { + "dto.SysDeptDeleteReq": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "ids": { "type": "array", "items": { @@ -2955,7 +2944,7 @@ var doc = `{ } } }, - "dto.SysDeptControl": { + "dto.SysDeptInsertReq": { "type": "object", "properties": { "createBy": { @@ -3002,13 +2991,57 @@ var doc = `{ } } }, - "dto.SysDictDataById": { + "dto.SysDeptUpdateReq": { "type": "object", "properties": { "createBy": { "type": "integer" }, - "id": { + "deptId": { + "description": "编码", + "type": "integer" + }, + "deptName": { + "description": "部门名称", + "type": "string" + }, + "deptPath": { + "description": "路径", + "type": "string" + }, + "email": { + "description": "邮箱", + "type": "string" + }, + "leader": { + "description": "负责人", + "type": "string" + }, + "parentId": { + "description": "上级部门", + "type": "integer" + }, + "phone": { + "description": "手机", + "type": "string" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "status": { + "description": "状态", + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictDataDeleteReq": { + "type": "object", + "properties": { + "createBy": { "type": "integer" }, "ids": { @@ -3022,7 +3055,59 @@ var doc = `{ } } }, - "dto.SysDictDataControl": { + "dto.SysDictDataGetAllResp": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "dto.SysDictDataInsertReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, + "cssClass": { + "type": "string" + }, + "default": { + "type": "string" + }, + "dictLabel": { + "type": "string" + }, + "dictSort": { + "type": "integer" + }, + "dictType": { + "type": "string" + }, + "dictValue": { + "type": "string" + }, + "isDefault": { + "type": "string" + }, + "listClass": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictDataUpdateReq": { "type": "object", "properties": { "createBy": { @@ -3066,7 +3151,24 @@ var doc = `{ } } }, - "dto.SysDictTypeControl": { + "dto.SysDictTypeDeleteReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, + "ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictTypeInsertReq": { "type": "object", "properties": { "createBy": { @@ -3092,15 +3194,49 @@ var doc = `{ } } }, - "dto.SysLoginLogById": { + "dto.SysDictTypeUpdateReq": { "type": "object", "properties": { "createBy": { "type": "integer" }, + "dictName": { + "type": "string" + }, + "dictType": { + "type": "string" + }, "id": { "type": "integer" }, + "remark": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysLoginLogDeleteReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysMenuDeleteReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, "ids": { "type": "array", "items": { @@ -3112,27 +3248,94 @@ var doc = `{ } } }, - "dto.SysMenuById": { + "dto.SysMenuInsertReq": { "type": "object", "properties": { + "action": { + "description": "请求方式", + "type": "string" + }, + "apis": { + "type": "array", + "items": { + "type": "integer" + } + }, + "breadcrumb": { + "description": "是否面包屑", + "type": "string" + }, + "component": { + "description": "组件", + "type": "string" + }, "createBy": { "type": "integer" }, - "id": { + "icon": { + "description": "图标", + "type": "string" + }, + "isFrame": { + "description": "是否frame", + "type": "string" + }, + "menuId": { + "description": "编码", "type": "integer" }, - "ids": { + "menuName": { + "description": "菜单name", + "type": "string" + }, + "menuType": { + "description": "菜单类型", + "type": "string" + }, + "noCache": { + "description": "是否缓存", + "type": "boolean" + }, + "parentId": { + "description": "上级菜单", + "type": "integer" + }, + "path": { + "description": "路径", + "type": "string" + }, + "paths": { + "description": "id路径", + "type": "string" + }, + "permission": { + "description": "权限编码", + "type": "string" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "sysApi": { "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/models.SysApi" } }, + "title": { + "description": "显示名称", + "type": "string" + }, "updateBy": { "type": "integer" + }, + "visible": { + "description": "是否显示", + "type": "string" } } }, - "dto.SysMenuControl": { + "dto.SysMenuUpdateReq": { "type": "object", "properties": { "action": { @@ -3219,12 +3422,9 @@ var doc = `{ } } }, - "dto.SysOperaLogById": { + "dto.SysOperaLogDeleteReq": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "ids": { "type": "array", "items": { @@ -3308,21 +3508,87 @@ var doc = `{ } } }, - "dto.SysRoleById": { + "dto.SysRoleDeleteReq": { "type": "object", "properties": { - "id": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysRoleInsertReq": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "createBy": { "type": "integer" }, - "ids": { + "dataScope": { + "type": "string" + }, + "deptIds": { "type": "array", "items": { "type": "integer" } + }, + "flag": { + "description": "标记", + "type": "string" + }, + "menuIds": { + "type": "array", + "items": { + "type": "integer" + } + }, + "remark": { + "description": "备注", + "type": "string" + }, + "roleId": { + "description": "角色编码", + "type": "integer" + }, + "roleKey": { + "description": "角色代码", + "type": "string" + }, + "roleName": { + "description": "角色名称", + "type": "string" + }, + "roleSort": { + "description": "角色排序", + "type": "integer" + }, + "status": { + "description": "状态 1禁用 2正常", + "type": "string" + }, + "sysDept": { + "type": "array", + "items": { + "$ref": "#/definitions/models.SysDept" + } + }, + "sysMenu": { + "type": "array", + "items": { + "$ref": "#/definitions/models.SysMenu" + } + }, + "updateBy": { + "type": "integer" } } }, - "dto.SysRoleControl": { + "dto.SysRoleUpdateReq": { "type": "object", "properties": { "admin": { @@ -3391,16 +3657,8 @@ var doc = `{ } } }, - "dto.SysUserControl": { + "dto.SysUserInsertReq": { "type": "object", - "required": [ - "deptId", - "email", - "nickName", - "phone", - "status", - "username" - ], "properties": { "avatar": { "type": "string" @@ -3451,6 +3709,55 @@ var doc = `{ } } }, + "dto.SysUserUpdateReq": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "createBy": { + "type": "integer" + }, + "deptId": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "nickName": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "postId": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "roleId": { + "type": "integer" + }, + "sex": { + "type": "string" + }, + "status": { + "type": "string", + "default": "1" + }, + "updateBy": { + "type": "integer" + }, + "userId": { + "description": "用户ID", + "type": "integer" + }, + "username": { + "type": "string" + } + } + }, "dto.UpdateStatusReq": { "type": "object", "properties": { @@ -3472,10 +3779,6 @@ var doc = `{ }, "dto.UpdateSysUserStatusReq": { "type": "object", - "required": [ - "status", - "userId" - ], "properties": { "createBy": { "type": "integer" @@ -3575,7 +3878,7 @@ var doc = `{ "type": "integer" }, "isFrontend": { - "type": "integer" + "type": "string" }, "remark": { "type": "string" @@ -4053,49 +4356,18 @@ var doc = `{ } }` -type swaggerInfo struct { - Version string - Host string - BasePath string - Schemes []string - Title string - Description string -} - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = swaggerInfo{ - Version: "2.0.0", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "go-admin API", - Description: "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", -} - -type s struct{} - -func (s *s) ReadDoc() string { - sInfo := SwaggerInfo - sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) - - t, err := template.New("swagger_info").Funcs(template.FuncMap{ - "marshal": func(v interface{}) string { - a, _ := json.Marshal(v) - return string(a) - }, - }).Parse(doc) - if err != nil { - return doc - } - - var tpl bytes.Buffer - if err := t.Execute(&tpl, sInfo); err != nil { - return doc - } - - return tpl.String() +// SwaggerInfoadmin holds exported Swagger Info so clients can modify it +var SwaggerInfoadmin = &swag.Spec{ + Version: "2.0.0", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "go-admin API", + Description: "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", + InfoInstanceName: "admin", + SwaggerTemplate: docTemplateadmin, } func init() { - swag.Register(swag.Name, &s{}) + swag.Register(SwaggerInfoadmin.InstanceName(), SwaggerInfoadmin) } diff --git a/docs/swagger.json b/docs/admin/admin_swagger.json similarity index 89% rename from docs/swagger.json rename to docs/admin/admin_swagger.json index fbee1c099..d3c32a185 100644 --- a/docs/swagger.json +++ b/docs/admin/admin_swagger.json @@ -214,7 +214,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptControl" + "$ref": "#/definitions/dto.SysDeptInsertReq" } } ], @@ -245,7 +245,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptById" + "$ref": "#/definitions/dto.SysDeptDeleteReq" } } ], @@ -270,19 +270,13 @@ "tags": [ "部门" ], - "summary": "部门列表数据", + "summary": "获取部门数据", "parameters": [ { "type": "string", "description": "deptId", "name": "deptId", "in": "path" - }, - { - "type": "string", - "description": "position", - "name": "position", - "in": "query" } ], "responses": { @@ -322,7 +316,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptControl" + "$ref": "#/definitions/dto.SysDeptUpdateReq" } } ], @@ -359,9 +353,24 @@ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/response.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.SysDictDataGetAllResp" + } + } + } + } + ] } } } @@ -441,15 +450,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataControl" + "$ref": "#/definitions/dto.SysDictDataInsertReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"message\": \"添加成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -472,15 +481,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataById" + "$ref": "#/definitions/dto.SysDictDataDeleteReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"message\": \"删除成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -537,15 +546,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataControl" + "$ref": "#/definitions/dto.SysDictDataUpdateReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"message\": \"修改成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -625,15 +634,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictTypeControl" + "$ref": "#/definitions/dto.SysDictTypeInsertReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -651,18 +660,20 @@ "summary": "删除字典类型", "parameters": [ { - "type": "integer", - "description": "dictId", - "name": "dictId", - "in": "path", - "required": true + "description": "body", + "name": "dictCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SysDictTypeDeleteReq" + } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -761,15 +772,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictTypeControl" + "$ref": "#/definitions/dto.SysDictTypeUpdateReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -841,12 +852,6 @@ ], "summary": "Menu列表数据", "parameters": [ - { - "type": "string", - "description": "menuName", - "name": "menuName", - "in": "query" - }, { "type": "string", "description": "menuName", @@ -884,7 +889,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuControl" + "$ref": "#/definitions/dto.SysMenuInsertReq" } } ], @@ -915,7 +920,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuById" + "$ref": "#/definitions/dto.SysMenuDeleteReq" } } ], @@ -986,7 +991,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuControl" + "$ref": "#/definitions/dto.SysMenuUpdateReq" } } ], @@ -1130,9 +1135,9 @@ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1161,15 +1166,9 @@ ], "responses": { "200": { - "description": "{\"code\": 200, \"message\": \"删除成功\"}", - "schema": { - "type": "string" - } - }, - "500": { - "description": "{\"code\": 500, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1203,9 +1202,9 @@ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1357,7 +1356,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleControl" + "$ref": "#/definitions/dto.SysRoleInsertReq" } } ], @@ -1388,7 +1387,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleById" + "$ref": "#/definitions/dto.SysRoleDeleteReq" } } ], @@ -1488,7 +1487,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleControl" + "$ref": "#/definitions/dto.SysRoleUpdateReq" } } ], @@ -1698,14 +1697,12 @@ "summary": "删除接口管理", "parameters": [ { - "description": "ids", - "name": "ids", + "description": "body", + "name": "data", "in": "body", + "required": true, "schema": { - "type": "array", - "items": { - "type": "integer" - } + "$ref": "#/definitions/dto.SysApiDeleteReq" } } ], @@ -1781,7 +1778,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysApiControl" + "$ref": "#/definitions/dto.SysApiUpdateReq" } } ], @@ -2102,7 +2099,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysLoginLogById" + "$ref": "#/definitions/dto.SysLoginLogDeleteReq" } } ], @@ -2235,7 +2232,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysOperaLogById" + "$ref": "#/definitions/dto.SysOperaLogDeleteReq" } } ], @@ -2329,7 +2326,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysUserControl" + "$ref": "#/definitions/dto.SysUserInsertReq" } } ], @@ -2394,7 +2391,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysUserControl" + "$ref": "#/definitions/dto.SysUserUpdateReq" } } ], @@ -2702,7 +2699,7 @@ "tags": [ "用户" ], - "summary": "重置密码", + "summary": "修改密码", "parameters": [ { "description": "body", @@ -2797,10 +2794,6 @@ }, "dto.PassWord": { "type": "object", - "required": [ - "newPassword", - "oldPassword" - ], "properties": { "newPassword": { "type": "string" @@ -2812,10 +2805,6 @@ }, "dto.ResetSysUserPwdReq": { "type": "object", - "required": [ - "password", - "userId" - ], "properties": { "createBy": { "type": "integer" @@ -2853,7 +2842,18 @@ } } }, - "dto.SysApiControl": { + "dto.SysApiDeleteReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysApiUpdateReq": { "type": "object", "properties": { "action": { @@ -2914,7 +2914,7 @@ "type": "integer" }, "isFrontend": { - "type": "integer" + "type": "string" }, "remark": { "type": "string" @@ -2924,12 +2924,9 @@ } } }, - "dto.SysDeptById": { + "dto.SysDeptDeleteReq": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "ids": { "type": "array", "items": { @@ -2938,7 +2935,7 @@ } } }, - "dto.SysDeptControl": { + "dto.SysDeptInsertReq": { "type": "object", "properties": { "createBy": { @@ -2985,13 +2982,57 @@ } } }, - "dto.SysDictDataById": { + "dto.SysDeptUpdateReq": { "type": "object", "properties": { "createBy": { "type": "integer" }, - "id": { + "deptId": { + "description": "编码", + "type": "integer" + }, + "deptName": { + "description": "部门名称", + "type": "string" + }, + "deptPath": { + "description": "路径", + "type": "string" + }, + "email": { + "description": "邮箱", + "type": "string" + }, + "leader": { + "description": "负责人", + "type": "string" + }, + "parentId": { + "description": "上级部门", + "type": "integer" + }, + "phone": { + "description": "手机", + "type": "string" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "status": { + "description": "状态", + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictDataDeleteReq": { + "type": "object", + "properties": { + "createBy": { "type": "integer" }, "ids": { @@ -3005,7 +3046,59 @@ } } }, - "dto.SysDictDataControl": { + "dto.SysDictDataGetAllResp": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "dto.SysDictDataInsertReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, + "cssClass": { + "type": "string" + }, + "default": { + "type": "string" + }, + "dictLabel": { + "type": "string" + }, + "dictSort": { + "type": "integer" + }, + "dictType": { + "type": "string" + }, + "dictValue": { + "type": "string" + }, + "isDefault": { + "type": "string" + }, + "listClass": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictDataUpdateReq": { "type": "object", "properties": { "createBy": { @@ -3049,7 +3142,24 @@ } } }, - "dto.SysDictTypeControl": { + "dto.SysDictTypeDeleteReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, + "ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictTypeInsertReq": { "type": "object", "properties": { "createBy": { @@ -3075,15 +3185,49 @@ } } }, - "dto.SysLoginLogById": { + "dto.SysDictTypeUpdateReq": { "type": "object", "properties": { "createBy": { "type": "integer" }, + "dictName": { + "type": "string" + }, + "dictType": { + "type": "string" + }, "id": { "type": "integer" }, + "remark": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysLoginLogDeleteReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysMenuDeleteReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, "ids": { "type": "array", "items": { @@ -3095,27 +3239,94 @@ } } }, - "dto.SysMenuById": { + "dto.SysMenuInsertReq": { "type": "object", "properties": { + "action": { + "description": "请求方式", + "type": "string" + }, + "apis": { + "type": "array", + "items": { + "type": "integer" + } + }, + "breadcrumb": { + "description": "是否面包屑", + "type": "string" + }, + "component": { + "description": "组件", + "type": "string" + }, "createBy": { "type": "integer" }, - "id": { + "icon": { + "description": "图标", + "type": "string" + }, + "isFrame": { + "description": "是否frame", + "type": "string" + }, + "menuId": { + "description": "编码", "type": "integer" }, - "ids": { + "menuName": { + "description": "菜单name", + "type": "string" + }, + "menuType": { + "description": "菜单类型", + "type": "string" + }, + "noCache": { + "description": "是否缓存", + "type": "boolean" + }, + "parentId": { + "description": "上级菜单", + "type": "integer" + }, + "path": { + "description": "路径", + "type": "string" + }, + "paths": { + "description": "id路径", + "type": "string" + }, + "permission": { + "description": "权限编码", + "type": "string" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "sysApi": { "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/models.SysApi" } }, + "title": { + "description": "显示名称", + "type": "string" + }, "updateBy": { "type": "integer" + }, + "visible": { + "description": "是否显示", + "type": "string" } } }, - "dto.SysMenuControl": { + "dto.SysMenuUpdateReq": { "type": "object", "properties": { "action": { @@ -3202,12 +3413,9 @@ } } }, - "dto.SysOperaLogById": { + "dto.SysOperaLogDeleteReq": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "ids": { "type": "array", "items": { @@ -3291,21 +3499,87 @@ } } }, - "dto.SysRoleById": { + "dto.SysRoleDeleteReq": { "type": "object", "properties": { - "id": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysRoleInsertReq": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "createBy": { "type": "integer" }, - "ids": { + "dataScope": { + "type": "string" + }, + "deptIds": { + "type": "array", + "items": { + "type": "integer" + } + }, + "flag": { + "description": "标记", + "type": "string" + }, + "menuIds": { "type": "array", "items": { "type": "integer" } + }, + "remark": { + "description": "备注", + "type": "string" + }, + "roleId": { + "description": "角色编码", + "type": "integer" + }, + "roleKey": { + "description": "角色代码", + "type": "string" + }, + "roleName": { + "description": "角色名称", + "type": "string" + }, + "roleSort": { + "description": "角色排序", + "type": "integer" + }, + "status": { + "description": "状态 1禁用 2正常", + "type": "string" + }, + "sysDept": { + "type": "array", + "items": { + "$ref": "#/definitions/models.SysDept" + } + }, + "sysMenu": { + "type": "array", + "items": { + "$ref": "#/definitions/models.SysMenu" + } + }, + "updateBy": { + "type": "integer" } } }, - "dto.SysRoleControl": { + "dto.SysRoleUpdateReq": { "type": "object", "properties": { "admin": { @@ -3374,16 +3648,8 @@ } } }, - "dto.SysUserControl": { + "dto.SysUserInsertReq": { "type": "object", - "required": [ - "deptId", - "email", - "nickName", - "phone", - "status", - "username" - ], "properties": { "avatar": { "type": "string" @@ -3434,6 +3700,55 @@ } } }, + "dto.SysUserUpdateReq": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "createBy": { + "type": "integer" + }, + "deptId": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "nickName": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "postId": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "roleId": { + "type": "integer" + }, + "sex": { + "type": "string" + }, + "status": { + "type": "string", + "default": "1" + }, + "updateBy": { + "type": "integer" + }, + "userId": { + "description": "用户ID", + "type": "integer" + }, + "username": { + "type": "string" + } + } + }, "dto.UpdateStatusReq": { "type": "object", "properties": { @@ -3455,10 +3770,6 @@ }, "dto.UpdateSysUserStatusReq": { "type": "object", - "required": [ - "status", - "userId" - ], "properties": { "createBy": { "type": "integer" @@ -3558,7 +3869,7 @@ "type": "integer" }, "isFrontend": { - "type": "integer" + "type": "string" }, "remark": { "type": "string" diff --git a/docs/swagger.yaml b/docs/admin/admin_swagger.yaml similarity index 87% rename from docs/swagger.yaml rename to docs/admin/admin_swagger.yaml index 69a667ccf..412817e60 100644 --- a/docs/swagger.yaml +++ b/docs/admin/admin_swagger.yaml @@ -12,9 +12,6 @@ definitions: type: string oldPassword: type: string - required: - - newPassword - - oldPassword type: object dto.ResetSysUserPwdReq: properties: @@ -27,9 +24,6 @@ definitions: userId: description: 用户ID type: integer - required: - - password - - userId type: object dto.RoleDataScopeReq: properties: @@ -45,7 +39,14 @@ definitions: - dataScope - roleId type: object - dto.SysApiControl: + dto.SysApiDeleteReq: + properties: + ids: + items: + type: integer + type: array + type: object + dto.SysApiUpdateReq: properties: action: type: string @@ -86,22 +87,20 @@ definitions: description: 编码 type: integer isFrontend: - type: integer + type: string remark: type: string updateBy: type: integer type: object - dto.SysDeptById: + dto.SysDeptDeleteReq: properties: - id: - type: integer ids: items: type: integer type: array type: object - dto.SysDeptControl: + dto.SysDeptInsertReq: properties: createBy: type: integer @@ -135,11 +134,43 @@ definitions: updateBy: type: integer type: object - dto.SysDictDataById: + dto.SysDeptUpdateReq: properties: createBy: type: integer - id: + deptId: + description: 编码 + type: integer + deptName: + description: 部门名称 + type: string + deptPath: + description: 路径 + type: string + email: + description: 邮箱 + type: string + leader: + description: 负责人 + type: string + parentId: + description: 上级部门 + type: integer + phone: + description: 手机 + type: string + sort: + description: 排序 + type: integer + status: + description: 状态 + type: integer + updateBy: + type: integer + type: object + dto.SysDictDataDeleteReq: + properties: + createBy: type: integer ids: items: @@ -148,7 +179,41 @@ definitions: updateBy: type: integer type: object - dto.SysDictDataControl: + dto.SysDictDataGetAllResp: + properties: + label: + type: string + value: + type: string + type: object + dto.SysDictDataInsertReq: + properties: + createBy: + type: integer + cssClass: + type: string + default: + type: string + dictLabel: + type: string + dictSort: + type: integer + dictType: + type: string + dictValue: + type: string + isDefault: + type: string + listClass: + type: string + remark: + type: string + status: + type: integer + updateBy: + type: integer + type: object + dto.SysDictDataUpdateReq: properties: createBy: type: integer @@ -177,7 +242,18 @@ definitions: updateBy: type: integer type: object - dto.SysDictTypeControl: + dto.SysDictTypeDeleteReq: + properties: + createBy: + type: integer + ids: + items: + type: integer + type: array + updateBy: + type: integer + type: object + dto.SysDictTypeInsertReq: properties: createBy: type: integer @@ -194,25 +270,34 @@ definitions: updateBy: type: integer type: object - dto.SysLoginLogById: + dto.SysDictTypeUpdateReq: properties: createBy: type: integer + dictName: + type: string + dictType: + type: string id: type: integer + remark: + type: string + status: + type: integer + updateBy: + type: integer + type: object + dto.SysLoginLogDeleteReq: + properties: ids: items: type: integer type: array - updateBy: - type: integer type: object - dto.SysMenuById: + dto.SysMenuDeleteReq: properties: createBy: type: integer - id: - type: integer ids: items: type: integer @@ -220,7 +305,7 @@ definitions: updateBy: type: integer type: object - dto.SysMenuControl: + dto.SysMenuInsertReq: properties: action: description: 请求方式 @@ -283,10 +368,71 @@ definitions: description: 是否显示 type: string type: object - dto.SysOperaLogById: + dto.SysMenuUpdateReq: properties: - id: + action: + description: 请求方式 + type: string + apis: + items: + type: integer + type: array + breadcrumb: + description: 是否面包屑 + type: string + component: + description: 组件 + type: string + createBy: + type: integer + icon: + description: 图标 + type: string + isFrame: + description: 是否frame + type: string + menuId: + description: 编码 + type: integer + menuName: + description: 菜单name + type: string + menuType: + description: 菜单类型 + type: string + noCache: + description: 是否缓存 + type: boolean + parentId: + description: 上级菜单 + type: integer + path: + description: 路径 + type: string + paths: + description: id路径 + type: string + permission: + description: 权限编码 + type: string + sort: + description: 排序 + type: integer + sysApi: + items: + $ref: '#/definitions/models.SysApi' + type: array + title: + description: 显示名称 + type: string + updateBy: type: integer + visible: + description: 是否显示 + type: string + type: object + dto.SysOperaLogDeleteReq: + properties: ids: items: type: integer @@ -341,16 +487,62 @@ definitions: updateBy: type: integer type: object - dto.SysRoleById: + dto.SysRoleDeleteReq: properties: - id: - type: integer ids: items: type: integer type: array type: object - dto.SysRoleControl: + dto.SysRoleInsertReq: + properties: + admin: + type: boolean + createBy: + type: integer + dataScope: + type: string + deptIds: + items: + type: integer + type: array + flag: + description: 标记 + type: string + menuIds: + items: + type: integer + type: array + remark: + description: 备注 + type: string + roleId: + description: 角色编码 + type: integer + roleKey: + description: 角色代码 + type: string + roleName: + description: 角色名称 + type: string + roleSort: + description: 角色排序 + type: integer + status: + description: 状态 1禁用 2正常 + type: string + sysDept: + items: + $ref: '#/definitions/models.SysDept' + type: array + sysMenu: + items: + $ref: '#/definitions/models.SysMenu' + type: array + updateBy: + type: integer + type: object + dto.SysRoleUpdateReq: properties: admin: type: boolean @@ -398,7 +590,7 @@ definitions: updateBy: type: integer type: object - dto.SysUserControl: + dto.SysUserInsertReq: properties: avatar: type: string @@ -432,13 +624,39 @@ definitions: type: integer username: type: string - required: - - deptId - - email - - nickName - - phone - - status - - username + type: object + dto.SysUserUpdateReq: + properties: + avatar: + type: string + createBy: + type: integer + deptId: + type: integer + email: + type: string + nickName: + type: string + phone: + type: string + postId: + type: integer + remark: + type: string + roleId: + type: integer + sex: + type: string + status: + default: "1" + type: string + updateBy: + type: integer + userId: + description: 用户ID + type: integer + username: + type: string type: object dto.UpdateStatusReq: properties: @@ -464,9 +682,6 @@ definitions: userId: description: 用户ID type: integer - required: - - status - - userId type: object handler.Login: properties: @@ -524,7 +739,7 @@ definitions: id: type: integer isFrontend: - type: integer + type: string remark: type: string updateBy: @@ -945,7 +1160,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDeptById' + $ref: '#/definitions/dto.SysDeptDeleteReq' responses: "200": description: '{"code": -1, "message": "删除失败"}' @@ -991,7 +1206,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDeptControl' + $ref: '#/definitions/dto.SysDeptInsertReq' responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1010,10 +1225,6 @@ paths: in: path name: deptId type: string - - description: position - in: query - name: position - type: string responses: "200": description: '{"code": 200, "data": [...]}' @@ -1021,7 +1232,7 @@ paths: $ref: '#/definitions/response.Response' security: - Bearer: [] - summary: 部门列表数据 + summary: 获取部门数据 tags: - 部门 put: @@ -1039,7 +1250,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDeptControl' + $ref: '#/definitions/dto.SysDeptUpdateReq' responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1061,9 +1272,16 @@ paths: type: integer responses: "200": - description: '{"code": -1, "message": "删除失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + allOf: + - $ref: '#/definitions/response.Response' + - properties: + data: + items: + $ref: '#/definitions/dto.SysDictDataGetAllResp' + type: array + type: object security: - Bearer: [] summary: 数据字典根据key获取 @@ -1078,12 +1296,12 @@ paths: name: dictCode required: true schema: - $ref: '#/definitions/dto.SysDictDataById' + $ref: '#/definitions/dto.SysDictDataDeleteReq' responses: "200": - description: '{"code": -1, "message": "删除失败"}' + description: '{"code": 200, "message": "删除成功"}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 删除字典数据 @@ -1132,12 +1350,12 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDictDataControl' + $ref: '#/definitions/dto.SysDictDataInsertReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "message": "添加成功"}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 添加字典数据 @@ -1172,12 +1390,12 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDictDataControl' + $ref: '#/definitions/dto.SysDictDataUpdateReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "message": "修改成功"}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 修改字典数据 @@ -1187,16 +1405,17 @@ paths: delete: description: 删除数据 parameters: - - description: dictId - in: path - name: dictId + - description: body + in: body + name: dictCode required: true - type: integer + schema: + $ref: '#/definitions/dto.SysDictTypeDeleteReq' responses: "200": - description: '{"code": -1, "message": "删除失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 删除字典类型 @@ -1245,12 +1464,12 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDictTypeControl' + $ref: '#/definitions/dto.SysDictTypeInsertReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 添加字典类型 @@ -1311,12 +1530,12 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDictTypeControl' + $ref: '#/definitions/dto.SysDictTypeUpdateReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 修改字典类型 @@ -1372,7 +1591,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysMenuById' + $ref: '#/definitions/dto.SysMenuDeleteReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1386,10 +1605,6 @@ paths: get: description: 获取JSON parameters: - - description: menuName - in: query - name: menuName - type: string - description: menuName in: query name: menuName @@ -1414,7 +1629,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysMenuControl' + $ref: '#/definitions/dto.SysMenuInsertReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1458,7 +1673,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysMenuControl' + $ref: '#/definitions/dto.SysMenuUpdateReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1515,13 +1730,9 @@ paths: $ref: '#/definitions/dto.SysPostDeleteReq' responses: "200": - description: '{"code": 200, "message": "删除成功"}' - schema: - type: string - "500": - description: '{"code": 500, "message": "删除失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 删除岗位 @@ -1569,9 +1780,9 @@ paths: $ref: '#/definitions/dto.SysPostInsertReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 添加岗位 @@ -1591,9 +1802,9 @@ paths: $ref: '#/definitions/dto.SysPostUpdateReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 修改岗位 @@ -1653,7 +1864,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysRoleById' + $ref: '#/definitions/dto.SysRoleDeleteReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1707,7 +1918,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysRoleControl' + $ref: '#/definitions/dto.SysRoleInsertReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1768,7 +1979,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysRoleControl' + $ref: '#/definitions/dto.SysRoleUpdateReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1840,13 +2051,12 @@ paths: delete: description: 删除接口管理 parameters: - - description: ids + - description: body in: body - name: ids + name: data + required: true schema: - items: - type: integer - type: array + $ref: '#/definitions/dto.SysApiDeleteReq' responses: "200": description: '{"code": 200, "message": "删除成功"}' @@ -1939,7 +2149,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysApiControl' + $ref: '#/definitions/dto.SysApiUpdateReq' responses: "200": description: '{"code": 200, "message": "修改成功"}' @@ -2094,7 +2304,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysLoginLogById' + $ref: '#/definitions/dto.SysLoginLogDeleteReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -2169,7 +2379,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysOperaLogById' + $ref: '#/definitions/dto.SysOperaLogDeleteReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -2271,7 +2481,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysUserControl' + $ref: '#/definitions/dto.SysUserInsertReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -2329,7 +2539,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysUserControl' + $ref: '#/definitions/dto.SysUserUpdateReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -2515,7 +2725,7 @@ paths: $ref: '#/definitions/response.Response' security: - Bearer: [] - summary: 重置密码 + summary: 修改密码 tags: - 用户 /api/v1/user/status: diff --git a/examples/run.go b/examples/run.go deleted file mode 100644 index 2bb61e260..000000000 --- a/examples/run.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build examples - -package main - -import ( - "github.com/go-admin-team/go-admin-core/sdk" - "log" - - "github.com/gin-gonic/gin" - "gorm.io/gorm" - - myCasbin "github.com/go-admin-team/go-admin-core/sdk/pkg/casbin" - "gorm.io/driver/mysql" -) - -func main() { - db, err := gorm.Open(mysql.Open("root:123456@tcp/inmg?charset=utf8&parseTime=True&loc=Local"), &gorm.Config{}) - if err != nil { - panic(err) - } - syncEnforce := myCasbin.Setup(db, "sys_") - sdk.Runtime.SetDb("*", db) - sdk.Runtime.SetCasbin("*", syncEnforce) - - e := gin.Default() - sdk.Runtime.SetEngine(e) - log.Fatal(e.Run(":8000")) -} diff --git a/go-admin-db.db b/go-admin-db.db new file mode 100644 index 000000000..fe73e0374 Binary files /dev/null and b/go-admin-db.db differ diff --git a/go.mod b/go.mod index 37d676c23..e1a2ff46f 100644 --- a/go.mod +++ b/go.mod @@ -1,38 +1,145 @@ module go-admin -go 1.15 +go 1.24 require ( - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 - github.com/alibaba/sentinel-golang v0.6.1 - github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5 - github.com/bitly/go-simplejson v0.5.0 - github.com/bytedance/go-tagexpr/v2 v2.7.12 - github.com/casbin/casbin/v2 v2.25.1 - github.com/gin-gonic/gin v1.7.2 - github.com/go-admin-team/go-admin-core v1.3.7 - github.com/go-admin-team/go-admin-core/sdk v1.3.7 - github.com/google/uuid v1.2.0 - github.com/mssola/user_agent v0.5.2 - github.com/opentracing/opentracing-go v1.1.0 - github.com/prometheus/client_golang v1.11.0 + github.com/alibaba/sentinel-golang v1.0.4 + github.com/alibaba/sentinel-golang/pkg/adapters/gin v0.0.0-20241224061304-f4c2c5964666 + github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible + github.com/bitly/go-simplejson v0.5.1 + github.com/bytedance/go-tagexpr/v2 v2.9.11 + github.com/casbin/casbin/v2 v2.104.0 + github.com/gin-gonic/gin v1.10.0 + github.com/go-admin-team/go-admin-core v1.5.3-rc.3.0.20250408121721-2763de5dcdf4 + github.com/go-admin-team/go-admin-core/sdk v1.5.3-rc.3.0.20250408121721-2763de5dcdf4 + github.com/google/uuid v1.6.0 + github.com/huaweicloud/huaweicloud-sdk-go-obs v3.24.9+incompatible + github.com/mssola/user_agent v0.6.0 + github.com/opentracing/opentracing-go v1.2.0 + github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.22.0 + github.com/qiniu/go-sdk/v7 v7.25.3 github.com/robfig/cron/v3 v3.0.1 - github.com/shirou/gopsutil v3.21.5+incompatible - github.com/spf13/cast v1.3.1 - github.com/spf13/cobra v1.0.0 - github.com/swaggo/gin-swagger v1.2.0 - github.com/swaggo/swag v1.6.7 - github.com/tklauser/go-sysconf v0.3.6 // indirect - github.com/unrolled/secure v1.0.8 - golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - gorm.io/driver/mysql v1.0.4-0.20201206014609-ae5fd10184f6 - gorm.io/driver/postgres v1.0.6-0.20201208020313-1ed927cfab53 - gorm.io/driver/sqlite v1.1.5-0.20201206014648-c84401fbe3ba - gorm.io/gorm v1.21.11 + github.com/shirou/gopsutil/v3 v3.24.5 + github.com/spf13/cobra v1.9.1 + github.com/swaggo/files v1.0.1 + github.com/swaggo/gin-swagger v1.6.0 + github.com/swaggo/swag v1.16.4 + github.com/unrolled/secure v1.17.0 + golang.org/x/crypto v0.37.0 + gorm.io/driver/mysql v1.5.7 + gorm.io/driver/postgres v1.5.11 + gorm.io/driver/sqlite v1.5.7 + gorm.io/driver/sqlserver v1.5.4 + gorm.io/gorm v1.25.12 +) + +require ( + filippo.io/edwards25519 v1.1.0 // indirect + github.com/BurntSushi/toml v1.5.0 // indirect + github.com/KyleBanks/depth v1.2.1 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 // indirect + github.com/andeya/ameda v1.5.3 // indirect + github.com/andeya/goutil v1.0.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bmatcuk/doublestar/v4 v4.8.1 // indirect + github.com/bytedance/sonic v1.13.2 // indirect + github.com/bytedance/sonic/loader v0.2.4 // indirect + github.com/casbin/gorm-adapter/v3 v3.32.0 // indirect + github.com/casbin/govaluate v1.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/chanxuehong/rand v0.0.0-20211009035549-2f07823e8e99 // indirect + github.com/chanxuehong/wechat v0.0.0-20230222024006-36f0325263cd // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.8 // indirect + github.com/gammazero/toposort v0.1.1 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/gin-contrib/sse v1.1.0 // indirect + github.com/glebarez/go-sqlite v1.22.0 // indirect + github.com/glebarez/sqlite v1.11.0 // indirect + github.com/go-admin-team/go-admin-core/plugins/logger/zap v1.5.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.6 // indirect + github.com/go-openapi/spec v0.20.4 // indirect + github.com/go-openapi/swag v0.19.15 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.26.0 // indirect + github.com/go-sql-driver/mysql v1.9.2 // indirect + github.com/goccy/go-json v0.10.5 // indirect + github.com/gofrs/flock v0.8.1 // indirect + github.com/golang-jwt/jwt/v5 v5.2.2 // indirect + github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect + github.com/golang-sql/sqlexp v0.1.0 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/imdario/mergo v0.3.13 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/pgx/v5 v5.7.4 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/mailru/easyjson v0.7.6 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-sqlite3 v1.14.22 // indirect + github.com/microsoft/go-mssqldb v1.8.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mojocn/base64Captcha v1.3.8 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect + github.com/nyaruka/phonenumbers v1.0.55 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/shamsher31/goimgext v1.0.0 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/arch v0.16.0 // indirect + golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect + golang.org/x/image v0.26.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/text v0.24.0 // indirect + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect + golang.org/x/tools v0.32.0 // indirect + google.golang.org/protobuf v1.36.6 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + gorm.io/plugin/dbresolver v1.5.3 // indirect + modernc.org/fileutil v1.3.0 // indirect + modernc.org/libc v1.62.1 // indirect + modernc.org/mathutil v1.7.1 // indirect + modernc.org/memory v1.9.1 // indirect + modernc.org/sqlite v1.37.0 // indirect ) //replace ( -// github.com/go-admin-team/go-admin-core => ../go-admin-core -// github.com/go-admin-team/go-admin-core/sdk => ../go-admin-core/sdk +// github.com/go-admin-team/go-admin-core v1.5.2-0.20231103105356-84418ed9252c => ../go-admin-core +// github.com/go-admin-team/go-admin-core/sdk v1.5.2-0.20231103105356-84418ed9252c => ../go-admin-core/sdk //) diff --git a/main.go b/main.go index d41f30d2d..e25407e27 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,7 @@ import ( "go-admin/cmd" ) -//go:generate swag init --parseDependency --parseDepth=6 +//go:generate swag init --parseDependency --parseDepth=6 --instanceName admin -o ./docs/admin // @title go-admin API // @version 2.0.0 diff --git a/restart.sh b/restart.sh new file mode 100644 index 000000000..ef8c4c13f --- /dev/null +++ b/restart.sh @@ -0,0 +1,10 @@ +#!/bin/bash +echo "go build" +go mod tidy +go build -o go-admin main.go +chmod +x ./go-admin +echo "kill go-admin service" +killall go-admin # kill go-admin service +nohup ./go-admin server -c=config/settings.dev.yml >> access.log 2>&1 & #后台启动服务将日志写入access.log文件 +echo "run go-admin success" +ps -aux | grep go-admin diff --git a/sqlite3.db b/sqlite3.db deleted file mode 100644 index 65124d045..000000000 Binary files a/sqlite3.db and /dev/null differ diff --git a/ssh/swag.sh b/ssh/swag.sh new file mode 100755 index 000000000..48139df25 --- /dev/null +++ b/ssh/swag.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +swag i -g init_router.go -dir app/admin/router --instanceName admin --parseDependency -o docs/admin diff --git a/stop.sh b/stop.sh new file mode 100644 index 000000000..6dd9dc438 --- /dev/null +++ b/stop.sh @@ -0,0 +1,4 @@ +#!/bin/bash +killall go-admin # kill go-admin service +echo "stop go-admin success" +ps -aux | grep go-admin \ No newline at end of file diff --git a/template/router.template b/template/router.template index 010bb03ee..b11e9b921 100644 --- a/template/router.template +++ b/template/router.template @@ -6,7 +6,7 @@ import ( _ "github.com/gin-gonic/gin" log "github.com/go-admin-team/go-admin-core/logger" "github.com/go-admin-team/go-admin-core/sdk" - "github.com/go-admin-team/go-admin-core/sdk/pkg" + // "github.com/go-admin-team/go-admin-core/sdk/pkg" "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" common "go-admin/common/middleware" @@ -34,9 +34,6 @@ func InitRouter() { os.Exit(-1) } - r.Use(common.Sentinel()). - Use(common.RequestId(pkg.TrafficKey)) - common.InitMiddleware(r) // the jwt middleware authMiddleware, err := common.AuthInit() if err != nil { @@ -75,4 +72,4 @@ func checkRoleRouter(r *gin.Engine, authMiddleware *jwtauth.GinJWTMiddleware) { for _, f := range routerCheckRole { f(v, authMiddleware) } -} \ No newline at end of file +} diff --git a/template/v4/dto.go.template b/template/v4/dto.go.template index 1aa5bfe46..428b89ae4 100644 --- a/template/v4/dto.go.template +++ b/template/v4/dto.go.template @@ -1,23 +1,28 @@ package dto import ( + {{- $bb := false -}} + {{- range .Columns -}} + {{- $z := .IsQuery -}} + {{- if ($z) -}} + {{- if eq .GoType "time.Time" -}}{{- $bb = true -}}{{- end -}} + {{- end -}} + {{- end -}} + {{- range .Columns -}} + {{- if eq .GoField "CreatedAt" -}} + {{- else if eq .GoField "UpdatedAt" -}} + {{- else if eq .GoField "DeletedAt" -}} + {{- else -}} + {{- if eq .GoType "time.Time" -}}{{- $bb = true -}}{{- end -}} + {{- end -}} + {{- end -}} + {{- if eq $bb true }} + "time" + {{- end }} + "go-admin/app/{{.PackageName}}/models" "go-admin/common/dto" common "go-admin/common/models" - - {{- $bb := false -}} - {{- range .Columns -}} - {{$z := .IsQuery}} - {{- if ($z) }} - {{if eq .GoType "time.Time"}}{{- $bb = true -}}{{- end -}} - {{- end -}} - {{- end -}} - {{- range .Columns -}} - {{if eq .GoType "time.Time"}}{{- $bb = true -}}{{- end -}} - {{- end -}} - {{- if eq $bb true -}} - "time" - {{- end }} ) type {{.ClassName}}GetPageReq struct { @@ -33,9 +38,9 @@ type {{.ClassName}}GetPageReq struct { } type {{.ClassName}}Order struct { - {{- $tablename := .TBName -}} + {{ $tablename := .TBName }} {{- range .Columns -}} - {{.GoField}} {{.GoType}} `form:"{{.JsonField}}Order" search:"type:order;column:{{.ColumnName}};table:{{$tablename}}"` + {{.GoField}} string `form:"{{.JsonField}}Order" search:"type:order;column:{{.ColumnName}};table:{{$tablename}}"` {{ end }} } @@ -70,7 +75,8 @@ func (s *{{.ClassName}}InsertReq) Generate(model *models.{{.ClassName}}) { {{- else if eq .GoField "CreatedAt" -}} {{- else if eq .GoField "UpdatedAt" -}} {{- else if eq .GoField "DeletedAt" -}} - {{- else if eq .GoField "CreateBy" -}} + {{- else if eq .GoField "CreateBy"}} + model.{{.GoField}} = s.{{.GoField}} // 添加这而,需要记录是被谁创建的 {{- else if eq .GoField "UpdateBy" -}} {{- else }} model.{{.GoField}} = s.{{.GoField}} @@ -110,7 +116,8 @@ func (s *{{.ClassName}}UpdateReq) Generate(model *models.{{.ClassName}}) { {{- else if eq .GoField "UpdatedAt" -}} {{- else if eq .GoField "DeletedAt" -}} {{- else if eq .GoField "CreateBy" -}} - {{- else if eq .GoField "UpdateBy" -}} + {{- else if eq .GoField "UpdateBy"}} + model.{{.GoField}} = s.{{.GoField}} // 添加这而,需要记录是被谁更新的 {{- else }} model.{{.GoField}} = s.{{.GoField}} {{- end -}} @@ -141,4 +148,4 @@ type {{.ClassName}}DeleteReq struct { func (s *{{.ClassName}}DeleteReq) GetId() interface{} { return s.Ids -} \ No newline at end of file +} diff --git a/template/v4/model.go.template b/template/v4/model.go.template index 1862b0338..2f56123d0 100644 --- a/template/v4/model.go.template +++ b/template/v4/model.go.template @@ -1,9 +1,27 @@ package models import ( - // "gorm.io/gorm" + {{- $bb := false -}} + {{- range .Columns -}} + {{- $z := .IsQuery -}} + {{- if ($z) -}} + {{- if eq .GoType "time.Time" -}}{{- $bb = true -}}{{- end -}} + {{- end -}} + {{- end -}} + {{- range .Columns -}} + {{- if eq .GoField "CreatedAt" -}} + {{- else if eq .GoField "UpdatedAt" -}} + {{- else if eq .GoField "DeletedAt" -}} + {{- else -}} + {{- if eq .GoType "time.Time" -}}{{- $bb = true -}}{{- end -}} + {{- end -}} + {{- end -}} + {{- if eq $bb true }} + "time" + {{- end }} "go-admin/common/models" + ) type {{.ClassName}} struct { diff --git a/template/v4/no_actions/apis.go.template b/template/v4/no_actions/apis.go.template index 08c092682..787877611 100644 --- a/template/v4/no_actions/apis.go.template +++ b/template/v4/no_actions/apis.go.template @@ -54,7 +54,7 @@ func (e {{.ClassName}}) GetPage(c *gin.Context) { err = s.GetPage(&req, p, &list, &count) if err != nil { - e.Error(500, err, fmt.Sprintf("获取{{.TableComment}} 失败,\r\n失败信息 %s", err.Error())) + e.Error(500, err, fmt.Sprintf("获取{{.TableComment}}失败,\r\n失败信息 %s", err.Error())) return } @@ -65,7 +65,7 @@ func (e {{.ClassName}}) GetPage(c *gin.Context) { // @Summary 获取{{.TableComment}} // @Description 获取{{.TableComment}} // @Tags {{.TableComment}} -// @Param id path string false "id" +// @Param id path int false "id" // @Success 200 {object} response.Response{data=models.{{.ClassName}}} "{"code": 200, "data": [...]}" // @Router /api/v1/{{.ModuleName}}/{id} [get] // @Security Bearer @@ -122,7 +122,7 @@ func (e {{.ClassName}}) Insert(c *gin.Context) { err = s.Insert(&req) if err != nil { - e.Error(500, err, fmt.Sprintf("创建{{.TableComment}} 失败,\r\n失败信息 %s", err.Error())) + e.Error(500, err, fmt.Sprintf("创建{{.TableComment}}失败,\r\n失败信息 %s", err.Error())) return } @@ -135,6 +135,7 @@ func (e {{.ClassName}}) Insert(c *gin.Context) { // @Tags {{.TableComment}} // @Accept application/json // @Product application/json +// @Param id path int true "id" // @Param data body dto.{{.ClassName}}UpdateReq true "body" // @Success 200 {object} response.Response "{"code": 200, "message": "修改成功"}" // @Router /api/v1/{{.ModuleName}}/{id} [put] @@ -157,7 +158,7 @@ func (e {{.ClassName}}) Update(c *gin.Context) { err = s.Update(&req, p) if err != nil { - e.Error(500, err, fmt.Sprintf("修改{{.TableComment}} 失败,\r\n失败信息 %s", err.Error())) + e.Error(500, err, fmt.Sprintf("修改{{.TableComment}}失败,\r\n失败信息 %s", err.Error())) return } e.OK( req.GetId(), "修改成功") @@ -167,7 +168,7 @@ func (e {{.ClassName}}) Update(c *gin.Context) { // @Summary 删除{{.TableComment}} // @Description 删除{{.TableComment}} // @Tags {{.TableComment}} -// @Param ids body []int false "ids" +// @Param data body dto.{{.ClassName}}DeleteReq true "body" // @Success 200 {object} response.Response "{"code": 200, "message": "删除成功"}" // @Router /api/v1/{{.ModuleName}} [delete] // @Security Bearer @@ -194,4 +195,4 @@ func (e {{.ClassName}}) Delete(c *gin.Context) { return } e.OK( req.GetId(), "删除成功") -} \ No newline at end of file +} diff --git a/template/v4/no_actions/router_check_role.go.template b/template/v4/no_actions/router_check_role.go.template index 0ba642723..f8a3c3a7c 100644 --- a/template/v4/no_actions/router_check_role.go.template +++ b/template/v4/no_actions/router_check_role.go.template @@ -6,6 +6,7 @@ import ( "go-admin/app/{{.PackageName}}/apis" "go-admin/common/middleware" + "go-admin/common/actions" ) func init() { @@ -15,12 +16,12 @@ func init() { // register{{.ClassName}}Router func register{{.ClassName}}Router(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { api := apis.{{.ClassName}}{} - r := v1.Group("/{{.MLTBName}}").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) + r := v1.Group("/{{.ModuleName}}").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) { - r.GET("", api.GetPage) - r.GET("/:id", api.Get) + r.GET("", actions.PermissionAction(), api.GetPage) + r.GET("/:id", actions.PermissionAction(), api.Get) r.POST("", api.Insert) - r.PUT("/:id", api.Update) + r.PUT("/:id", actions.PermissionAction(), api.Update) r.DELETE("", api.Delete) } } \ No newline at end of file diff --git a/template/v4/no_actions/router_no_check_role.go.template b/template/v4/no_actions/router_no_check_role.go.template index 429e274cd..fc26fe609 100644 --- a/template/v4/no_actions/router_no_check_role.go.template +++ b/template/v4/no_actions/router_no_check_role.go.template @@ -14,7 +14,7 @@ func init() { // register{{.ClassName}}Router func register{{.ClassName}}Router(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { api := apis.{{.ClassName}}{} - r := v1.Group("/{{.MLTBName}}").Use(authMiddleware.MiddlewareFunc()) + r := v1.Group("/{{.ModuleName}}").Use(authMiddleware.MiddlewareFunc()) { r.GET("", api.GetPage) r.GET("/:id", api.Get) diff --git a/template/v4/no_actions/service.go.template b/template/v4/no_actions/service.go.template index 8ab3ef6f5..84e8886f7 100644 --- a/template/v4/no_actions/service.go.template +++ b/template/v4/no_actions/service.go.template @@ -80,7 +80,7 @@ func (e *{{.ClassName}}) Update(c *dto.{{.ClassName}}UpdateReq, p *actions.DataP c.Generate(&data) db := e.Orm.Save(&data) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("{{.ClassName}}Service Save error:%s \r\n", err) return err } @@ -106,4 +106,4 @@ func (e *{{.ClassName}}) Remove(d *dto.{{.ClassName}}DeleteReq, p *actions.DataP return errors.New("无权删除该数据") } return nil -} \ No newline at end of file +} diff --git a/template/v4/vue.go.template b/template/v4/vue.go.template index 201c3b5d3..6efa4d419 100644 --- a/template/v4/vue.go.template +++ b/template/v4/vue.go.template @@ -118,22 +118,30 @@ {{- end }} @@ -161,7 +169,7 @@ {{- else }} {{ if eq "input" .HtmlType -}} - {{- else if eq "select" .HtmlType -}} {{- if ne .FkTableName "" -}}