diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 24a978b1d..b6f64ed93 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.8.0] + node-version: [18.16.0] steps: - name: Check out branch uses: actions/checkout@v2 @@ -48,7 +48,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [1.18] + go-version: [1.22] steps: - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v1 @@ -83,8 +83,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.8.0] - go-version: [1.18] + node-version: [18.16.0] + go-version: [1.22] steps: - name: Check out branch uses: actions/checkout@v2 @@ -194,8 +194,8 @@ jobs: name: devops-prod strategy: matrix: - node-version: ['16.x'] - go-version: ['1.18'] + node-version: ['18.x'] + go-version: ['1.22'] steps: - uses: actions/checkout@v2 - name: tag major and minor versions diff --git a/.gitignore b/.gitignore index 39b8a859a..2784f52b1 100644 --- a/.gitignore +++ b/.gitignore @@ -22,9 +22,13 @@ yarn-error.log* *.sln *.sw? +rm_file/ /server/log/ /server/gva +/server/server /server/latest_log +/server/__debug_bin* +server/uploads/ *.iml web/.pnpm-debug.log diff --git a/LICENSE b/LICENSE index d9dd9501f..e0dca2e47 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2019 JiZhao Jiang + Copyright 2019 北京翻转极光科技有限责任公司 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index e1d4f760d..4b193fc6d 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ SHELL = /bin/bash #SCRIPT_DIR = $(shell pwd)/etc/script #请选择golang版本 -BUILD_IMAGE_SERVER = golang:1.18 +BUILD_IMAGE_SERVER = golang:1.22 #请选择node版本 -BUILD_IMAGE_WEB = node:16 +BUILD_IMAGE_WEB = node:20 #项目名称 PROJECT_NAME = github.com/flipped-aurora/gin-vue-admin/server #配置文件目录 diff --git a/README-en.md b/README-en.md index 2a7f82efb..1f2a59ca1 100644 --- a/README-en.md +++ b/README-en.md @@ -1,6 +1,6 @@
+
+
+
+
+
## 1. 基本介绍
@@ -83,7 +76,7 @@ Gin-vue-admin 的成长离不开大家的支持,如果你愿意为 gin-vue-adm
```
- node版本 > v16.8.3
-- golang版本 >= v1.16
+- golang版本 >= v1.22
- IDE推荐:Goland
```
@@ -125,29 +118,8 @@ npm run serve
#### 2.3.1 安装 swagger
-##### (1)可以访问外国网站
-
-````
-go get -u github.com/swaggo/swag/cmd/swag
-````
-
-##### (2)无法访问外国网站
-
-由于国内没法安装 go.org/x 包下面的东西,推荐使用 [goproxy.cn](https://goproxy.cn) 或者 [goproxy.io](https://goproxy.io/zh/)
-
-```bash
-# 如果您使用的 Go 版本是 1.13 - 1.15 需要手动设置GO111MODULE=on, 开启方式如下命令, 如果你的 Go 版本 是 1.16 ~ 最新版 可以忽略以下步骤一
-# 步骤一、启用 Go Modules 功能
-go env -w GO111MODULE=on
-# 步骤二、配置 GOPROXY 环境变量
-go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
-
-# 如果嫌弃麻烦,可以使用go generate 编译前自动执行代码, 不过这个不能使用 `Goland` 或者 `Vscode` 的 命令行终端
-cd server
-go generate -run "go env -w .*?"
-
-# 使用如下命令下载swag
-go get -u github.com/swaggo/swag/cmd/swag
+``` shell
+go install github.com/swaggo/swag/cmd/swag@latest
```
#### 2.3.2 生成API文档
@@ -352,17 +324,20 @@ swag init
### 7.1 技术群
-### QQ交流群:622360840
-| QQ 群 |
-| :---: |
-|
|
+### QQ交流群:470239250
### 微信交流群
| 微信 |
| :---: |
|
-添加微信,备注"加入gin-vue-admin交流群"
+防止广告进群,添加微信,输入以下代码执行结果(请勿转码为string)
+
+```
+str := "5Yqg5YWlR1ZB5Lqk5rWB576k"
+decodeBytes, err := base64.StdEncoding.DecodeString(str)
+fmt.Println(decodeBytes, err)
+```
### [关于我们](https://www.gin-vue-admin.com/about/join.html)
diff --git a/deploy/docker-compose/docker-compose-dev.yaml b/deploy/docker-compose/docker-compose-dev.yaml
index 468564ca0..fd0a3b661 100644
--- a/deploy/docker-compose/docker-compose-dev.yaml
+++ b/deploy/docker-compose/docker-compose-dev.yaml
@@ -15,7 +15,7 @@ volumes:
services:
web:
- image: node:16
+ image: node:20
container_name: gva-web
hostname: gva-web #可以通过容器名访问
restart: always
@@ -25,7 +25,7 @@ services:
- server
working_dir: /web # 如果docker 设置了workdir 则此处不需要设置
#若网络不太好,请自行换源,如下
- #command: bash -c "yarn config set registry https://registry.npm.taobao.org --global && yarn install && yarn serve"
+ #command: bash -c "yarn config set registry https://registry.npmmirror.com --global && yarn install && yarn serve"
command: bash -c "yarn install && yarn serve"
volumes:
- ../../web:/web
@@ -34,15 +34,17 @@ services:
ipv4_address: 177.7.0.11
server:
- image: golang:1.18
+ image: golang:1.22
container_name: gva-server
hostname: gva-server
restart: always
ports:
- '8888:8888'
depends_on:
- - mysql
- - redis
+ mysql:
+ condition: service_healthy
+ redis:
+ condition: service_healthy
volumes:
- ../../server:/server
working_dir: /server # 如果docker 设置了workdir 则此处不需要设置
@@ -67,6 +69,11 @@ services:
MYSQL_DATABASE: 'qmPlus' # 初始化启动时要创建的数据库的名称
MYSQL_USER: 'gva'
MYSQL_PASSWORD: 'Aa@6447985'
+ healthcheck:
+ test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "gva", "-pAa@6447985"]
+ interval: 10s
+ timeout: 5s
+ retries: 3
volumes:
- mysql:/var/lib/mysql
networks:
@@ -80,6 +87,11 @@ services:
restart: always
ports:
- '16379:6379'
+ healthcheck:
+ test: ["CMD-SHELL", "redis-cli ping | grep PONG || exit 1"]
+ interval: 10s
+ timeout: 5s
+ retries: 3
volumes:
- redis:/data
networks:
diff --git a/deploy/docker-compose/docker-compose.yaml b/deploy/docker-compose/docker-compose.yaml
index 6c8ae02dd..1e304c2e1 100644
--- a/deploy/docker-compose/docker-compose.yaml
+++ b/deploy/docker-compose/docker-compose.yaml
@@ -38,8 +38,10 @@ services:
ports:
- '8888:8888'
depends_on:
- - mysql
- - redis
+ mysql:
+ condition: service_healthy
+ redis:
+ condition: service_healthy
links:
- mysql
- redis
@@ -59,6 +61,11 @@ services:
MYSQL_DATABASE: 'qmPlus' # 初始化启动时要创建的数据库的名称
MYSQL_USER: 'gva'
MYSQL_PASSWORD: 'Aa@6447985'
+ healthcheck:
+ test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "gva", "-pAa@6447985"]
+ interval: 10s
+ timeout: 5s
+ retries: 3
volumes:
- mysql:/var/lib/mysql
networks:
@@ -71,6 +78,11 @@ services:
restart: always
ports:
- '16379:6379'
+ healthcheck:
+ test: ["CMD-SHELL", "redis-cli ping | grep PONG || exit 1"]
+ interval: 10s
+ timeout: 5s
+ retries: 3
volumes:
- redis:/data
networks:
diff --git a/deploy/docker/Dockerfile b/deploy/docker/Dockerfile
index 0a567f2d6..da238053d 100644
--- a/deploy/docker/Dockerfile
+++ b/deploy/docker/Dockerfile
@@ -9,7 +9,7 @@ RUN set -ex \
&& echo "LANG=en_US.utf8" > /etc/locale.conf \
&& echo "net.core.somaxconn = 1024" >> /etc/sysctl.conf \
&& echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf \
- && yum -y install yum -y install *epel* \
+ && yum -y install epel-release \
&& yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm \
&& yum -y install mysql-community-server git redis nginx go npm --nogpgcheck && chmod +x ./entrypoint.sh \
&& npm install -g yarn && go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct \
diff --git a/server/Dockerfile b/server/Dockerfile
index 545f70833..69cb44dc6 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -13,6 +13,10 @@ RUN go env -w GO111MODULE=on \
FROM alpine:latest
LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"
+# 设置时区
+ENV TZ=Asia/Shanghai
+RUN apk update && apk add --no-cache tzdata openntpd \
+ && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /go/src/github.com/flipped-aurora/gin-vue-admin/server
@@ -20,5 +24,8 @@ COPY --from=0 /go/src/github.com/flipped-aurora/gin-vue-admin/server/server ./
COPY --from=0 /go/src/github.com/flipped-aurora/gin-vue-admin/server/resource ./resource/
COPY --from=0 /go/src/github.com/flipped-aurora/gin-vue-admin/server/config.docker.yaml ./
+# 挂载目录:如果使用了sqlite数据库,容器命令示例:docker run -d -v /宿主机路径/gva.db:/go/src/github.com/flipped-aurora/gin-vue-admin/server/gva.db -p 8888:8888 --name gva-server-v1 gva-server:1.0
+# VOLUME ["/go/src/github.com/flipped-aurora/gin-vue-admin/server"]
+
EXPOSE 8888
ENTRYPOINT ./server -c config.docker.yaml
diff --git a/server/api/v1/enter.go b/server/api/v1/enter.go
index 54adbe796..5c1dff443 100644
--- a/server/api/v1/enter.go
+++ b/server/api/v1/enter.go
@@ -5,9 +5,9 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/system"
)
+var ApiGroupApp = new(ApiGroup)
+
type ApiGroup struct {
SystemApiGroup system.ApiGroup
ExampleApiGroup example.ApiGroup
}
-
-var ApiGroupApp = new(ApiGroup)
diff --git a/server/api/v1/system/sys_auto_code_history.go b/server/api/v1/system/auto_code_history.go
similarity index 79%
rename from server/api/v1/system/sys_auto_code_history.go
rename to server/api/v1/system/auto_code_history.go
index d30a4b56a..d814be77f 100644
--- a/server/api/v1/system/sys_auto_code_history.go
+++ b/server/api/v1/system/auto_code_history.go
@@ -2,9 +2,9 @@ package system
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
- "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+ common "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
- systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
+ request "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
@@ -21,13 +21,13 @@ type AutoCodeHistoryApi struct{}
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取meta信息"
// @Router /autoCode/getMeta [post]
func (a *AutoCodeHistoryApi) First(c *gin.Context) {
- var info request.GetById
+ var info common.GetById
err := c.ShouldBindJSON(&info)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
- data, err := autoCodeHistoryService.First(&info)
+ data, err := autoCodeHistoryService.First(c.Request.Context(), info)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
@@ -45,13 +45,13 @@ func (a *AutoCodeHistoryApi) First(c *gin.Context) {
// @Success 200 {object} response.Response{msg=string} "删除回滚记录"
// @Router /autoCode/delSysHistory [post]
func (a *AutoCodeHistoryApi) Delete(c *gin.Context) {
- var info request.GetById
+ var info common.GetById
err := c.ShouldBindJSON(&info)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
- err = autoCodeHistoryService.Delete(&info)
+ err = autoCodeHistoryService.Delete(c.Request.Context(), info)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
@@ -66,17 +66,17 @@ func (a *AutoCodeHistoryApi) Delete(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
-// @Param data body systemReq.RollBack true "请求参数"
+// @Param data body request.SysAutoHistoryRollBack true "请求参数"
// @Success 200 {object} response.Response{msg=string} "回滚自动生成代码"
// @Router /autoCode/rollback [post]
func (a *AutoCodeHistoryApi) RollBack(c *gin.Context) {
- var info systemReq.RollBack
+ var info request.SysAutoHistoryRollBack
err := c.ShouldBindJSON(&info)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
- err = autoCodeHistoryService.RollBack(&info)
+ err = autoCodeHistoryService.RollBack(c.Request.Context(), info)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
@@ -90,17 +90,17 @@ func (a *AutoCodeHistoryApi) RollBack(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
-// @Param data body systemReq.SysAutoHistory true "请求参数"
+// @Param data body common.PageInfo true "请求参数"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "查询回滚记录,返回包括列表,总数,页码,每页数量"
// @Router /autoCode/getSysHistory [post]
func (a *AutoCodeHistoryApi) GetList(c *gin.Context) {
- var search systemReq.SysAutoHistory
- err := c.ShouldBindJSON(&search)
+ var info common.PageInfo
+ err := c.ShouldBindJSON(&info)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
- list, total, err := autoCodeHistoryService.GetList(search.PageInfo)
+ list, total, err := autoCodeHistoryService.GetList(c.Request.Context(), info)
if err != nil {
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.getDataFailErr"), c)
@@ -109,7 +109,7 @@ func (a *AutoCodeHistoryApi) GetList(c *gin.Context) {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
- Page: search.Page,
- PageSize: search.PageSize,
+ Page: info.Page,
+ PageSize: info.PageSize,
}, global.Translate("general.getDataSuccess"), c)
}
diff --git a/server/api/v1/system/auto_code_package.go b/server/api/v1/system/auto_code_package.go
new file mode 100644
index 000000000..655f29ab2
--- /dev/null
+++ b/server/api/v1/system/auto_code_package.go
@@ -0,0 +1,100 @@
+package system
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ common "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
+ "github.com/gin-gonic/gin"
+ "go.uber.org/zap"
+ "strings"
+)
+
+type AutoCodePackageApi struct{}
+
+// Create
+// @Tags AutoCodePackage
+// @Summary 创建package
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.SysAutoCodePackageCreate true "创建package"
+// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
+// @Router /autoCode/createPackage [post]
+func (a *AutoCodePackageApi) Create(c *gin.Context) {
+ var info request.SysAutoCodePackageCreate
+ _ = c.ShouldBindJSON(&info)
+ if err := utils.Verify(info, utils.AutoPackageVerify); err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ if strings.Contains(info.PackageName, "\\") || strings.Contains(info.PackageName, "/") || strings.Contains(info.PackageName, "..") {
+ response.FailWithMessage("包名不合法", c)
+ return
+ } // PackageName可能导致路径穿越的问题 / 和 \ 都要防止
+ err := autoCodePackageService.Create(c.Request.Context(), &info)
+ if err != nil {
+ global.GVA_LOG.Error("创建失败!", zap.Error(err))
+ response.FailWithMessage("创建失败", c)
+ return
+ }
+ response.OkWithMessage("创建成功", c)
+}
+
+// Delete
+// @Tags AutoCode
+// @Summary 删除package
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body common.GetById true "创建package"
+// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "删除package成功"
+// @Router /autoCode/delPackage [post]
+func (a *AutoCodePackageApi) Delete(c *gin.Context) {
+ var info common.GetById
+ _ = c.ShouldBindJSON(&info)
+ err := autoCodePackageService.Delete(c.Request.Context(), info)
+ if err != nil {
+ global.GVA_LOG.Error("删除失败!", zap.Error(err))
+ response.FailWithMessage("删除失败", c)
+ return
+ }
+ response.OkWithMessage("删除成功", c)
+}
+
+// All
+// @Tags AutoCodePackage
+// @Summary 获取package
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
+// @Router /autoCode/getPackage [post]
+func (a *AutoCodePackageApi) All(c *gin.Context) {
+ data, err := autoCodePackageService.All(c.Request.Context())
+ if err != nil {
+ global.GVA_LOG.Error("获取失败!", zap.Error(err))
+ response.FailWithMessage("获取失败", c)
+ return
+ }
+ response.OkWithDetailed(gin.H{"pkgs": data}, "获取成功", c)
+}
+
+// Templates
+// @Tags AutoCodePackage
+// @Summary 获取package
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
+// @Router /autoCode/getTemplates [get]
+func (a *AutoCodePackageApi) Templates(c *gin.Context) {
+ data, err := autoCodePackageService.Templates(c.Request.Context())
+ if err != nil {
+ global.GVA_LOG.Error("获取失败!", zap.Error(err))
+ response.FailWithMessage("获取失败", c)
+ return
+ }
+ response.OkWithDetailed(data, "获取成功", c)
+}
diff --git a/server/api/v1/system/auto_code_plugin.go b/server/api/v1/system/auto_code_plugin.go
new file mode 100644
index 000000000..33413c3e0
--- /dev/null
+++ b/server/api/v1/system/auto_code_plugin.go
@@ -0,0 +1,70 @@
+package system
+
+import (
+ "fmt"
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
+ "github.com/gin-gonic/gin"
+ "go.uber.org/zap"
+)
+
+type AutoCodePluginApi struct{}
+
+// Install
+// @Tags AutoCodePlugin
+// @Summary 安装插件
+// @Security ApiKeyAuth
+// @accept multipart/form-data
+// @Produce application/json
+// @Param plug formData file true "this is a test file"
+// @Success 200 {object} response.Response{data=[]interface{},msg=string} "安装插件成功"
+// @Router /autoCode/installPlugin [post]
+func (a *AutoCodePluginApi) Install(c *gin.Context) {
+ header, err := c.FormFile("plug")
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ web, server, err := autoCodePluginService.Install(header)
+ webStr := "web插件安装成功"
+ serverStr := "server插件安装成功"
+ if web == -1 {
+ webStr = "web端插件未成功安装,请按照文档自行解压安装,如果为纯后端插件请忽略此条提示"
+ }
+ if server == -1 {
+ serverStr = "server端插件未成功安装,请按照文档自行解压安装,如果为纯前端插件请忽略此条提示"
+ }
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ response.OkWithData([]interface{}{
+ gin.H{
+ "code": web,
+ "msg": webStr,
+ },
+ gin.H{
+ "code": server,
+ "msg": serverStr,
+ }}, c)
+}
+
+// Packaged
+// @Tags AutoCodePlugin
+// @Summary 打包插件
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param plugName query string true "插件名称"
+// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "打包插件成功"
+// @Router /autoCode/pubPlug [get]
+func (a *AutoCodePluginApi) Packaged(c *gin.Context) {
+ plugName := c.Query("plugName")
+ zipPath, err := autoCodePluginService.PubPlug(plugName)
+ if err != nil {
+ global.GVA_LOG.Error("打包失败!", zap.Error(err))
+ response.FailWithMessage("打包失败"+err.Error(), c)
+ return
+ }
+ response.OkWithMessage(fmt.Sprintf("打包成功,文件路径为:%s", zipPath), c)
+}
diff --git a/server/api/v1/system/auto_code_template.go b/server/api/v1/system/auto_code_template.go
new file mode 100644
index 000000000..3fb49f766
--- /dev/null
+++ b/server/api/v1/system/auto_code_template.go
@@ -0,0 +1,108 @@
+package system
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
+ "github.com/gin-gonic/gin"
+ "go.uber.org/zap"
+)
+
+type AutoCodeTemplateApi struct{}
+
+// Preview
+// @Tags AutoCodeTemplate
+// @Summary 预览创建后的代码
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.AutoCode true "预览创建代码"
+// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "预览创建后的代码"
+// @Router /autoCode/preview [post]
+func (a *AutoCodeTemplateApi) Preview(c *gin.Context) {
+ var info request.AutoCode
+ err := c.ShouldBindJSON(&info)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = utils.Verify(info, utils.AutoCodeVerify)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = info.Pretreatment()
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ info.PackageT = utils.FirstUpper(info.Package)
+ autoCode, err := autoCodeTemplateService.Preview(c.Request.Context(), info)
+ if err != nil {
+ global.GVA_LOG.Error("预览失败!", zap.Error(err))
+ response.FailWithMessage("预览失败", c)
+ } else {
+ response.OkWithDetailed(gin.H{"autoCode": autoCode}, "预览成功", c)
+ }
+}
+
+// Create
+// @Tags AutoCodeTemplate
+// @Summary 自动代码模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.AutoCode true "创建自动代码"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
+// @Router /autoCode/createTemp [post]
+func (a *AutoCodeTemplateApi) Create(c *gin.Context) {
+ var info request.AutoCode
+ err := c.ShouldBindJSON(&info)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = utils.Verify(info, utils.AutoCodeVerify)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = info.Pretreatment()
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = autoCodeTemplateService.Create(c.Request.Context(), info)
+ if err != nil {
+ global.GVA_LOG.Error("创建失败!", zap.Error(err))
+ response.FailWithMessage("创建失败", c)
+ } else {
+ response.OkWithMessage("创建成功", c)
+ }
+}
+
+// Create
+// @Tags AddFunc
+// @Summary 增加方法
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.AutoCode true "增加方法"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
+// @Router /autoCode/addFunc [post]
+func (a *AutoCodeTemplateApi) AddFunc(c *gin.Context) {
+ var info request.AutoFunc
+ err := c.ShouldBindJSON(&info)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = autoCodeTemplateService.AddFunc(info)
+ if err != nil {
+ global.GVA_LOG.Error("注入失败!", zap.Error(err))
+ response.FailWithMessage("注入失败", c)
+ } else {
+ response.OkWithMessage("注入成功", c)
+ }
+}
diff --git a/server/api/v1/system/enter.go b/server/api/v1/system/enter.go
index 6227519db..e496703d5 100644
--- a/server/api/v1/system/enter.go
+++ b/server/api/v1/system/enter.go
@@ -14,10 +14,13 @@ type ApiGroup struct {
DictionaryApi
AuthorityMenuApi
OperationRecordApi
- AutoCodeHistoryApi
DictionaryDetailApi
AuthorityBtnApi
- ChatGptApi
+ SysExportTemplateApi
+ AutoCodePluginApi
+ AutoCodePackageApi
+ AutoCodeHistoryApi
+ AutoCodeTemplateApi
}
var (
@@ -27,14 +30,16 @@ var (
userService = service.ServiceGroupApp.SystemServiceGroup.UserService
initDBService = service.ServiceGroupApp.SystemServiceGroup.InitDBService
casbinService = service.ServiceGroupApp.SystemServiceGroup.CasbinService
- autoCodeService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeService
baseMenuService = service.ServiceGroupApp.SystemServiceGroup.BaseMenuService
authorityService = service.ServiceGroupApp.SystemServiceGroup.AuthorityService
dictionaryService = service.ServiceGroupApp.SystemServiceGroup.DictionaryService
+ authorityBtnService = service.ServiceGroupApp.SystemServiceGroup.AuthorityBtnService
systemConfigService = service.ServiceGroupApp.SystemServiceGroup.SystemConfigService
operationRecordService = service.ServiceGroupApp.SystemServiceGroup.OperationRecordService
- autoCodeHistoryService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeHistoryService
dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService
- authorityBtnService = service.ServiceGroupApp.SystemServiceGroup.AuthorityBtnService
- chatGptService = service.ServiceGroupApp.SystemServiceGroup.ChatGptService
+ autoCodeService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeService
+ autoCodePluginService = service.ServiceGroupApp.SystemServiceGroup.AutoCodePlugin
+ autoCodePackageService = service.ServiceGroupApp.SystemServiceGroup.AutoCodePackage
+ autoCodeHistoryService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeHistory
+ autoCodeTemplateService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeTemplate
)
diff --git a/server/api/v1/system/sys_api.go b/server/api/v1/system/sys_api.go
index 5c3479f9c..18c79fa65 100644
--- a/server/api/v1/system/sys_api.go
+++ b/server/api/v1/system/sys_api.go
@@ -45,6 +45,97 @@ func (s *SystemApiApi) CreateApi(c *gin.Context) {
response.OkWithMessage(global.Translate("general.createSuccss"), c)
}
+// SyncApi
+// @Tags SysApi
+// @Summary 同步API
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{msg=string} "同步API"
+// @Router /api/syncApi [get]
+func (s *SystemApiApi) SyncApi(c *gin.Context) {
+ newApis, deleteApis, ignoreApis, err := apiService.SyncApi()
+ if err != nil {
+ global.GVA_LOG.Error("同步失败!", zap.Error(err))
+ response.FailWithMessage("同步失败", c)
+ return
+ }
+ response.OkWithData(gin.H{
+ "newApis": newApis,
+ "deleteApis": deleteApis,
+ "ignoreApis": ignoreApis,
+ }, c)
+}
+
+// GetApiGroups
+// @Tags SysApi
+// @Summary 获取API分组
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{msg=string} "获取API分组"
+// @Router /api/getApiGroups [post]
+func (s *SystemApiApi) GetApiGroups(c *gin.Context) {
+ groups, apiGroupMap, err := apiService.GetApiGroups()
+ if err != nil {
+ global.GVA_LOG.Error("获取失败!", zap.Error(err))
+ response.FailWithMessage("获取失败", c)
+ return
+ }
+ response.OkWithData(gin.H{
+ "groups": groups,
+ "apiGroupMap": apiGroupMap,
+ }, c)
+}
+
+// IgnoreApi
+// @Tags IgnoreApi
+// @Summary 忽略API
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{msg=string} "同步API"
+// @Router /api/ignoreApi [post]
+func (s *SystemApiApi) IgnoreApi(c *gin.Context) {
+ var ignoreApi system.SysIgnoreApi
+ err := c.ShouldBindJSON(&ignoreApi)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = apiService.IgnoreApi(ignoreApi)
+ if err != nil {
+ global.GVA_LOG.Error("忽略失败!", zap.Error(err))
+ response.FailWithMessage("忽略失败", c)
+ return
+ }
+ response.Ok(c)
+}
+
+// EnterSyncApi
+// @Tags SysApi
+// @Summary 确认同步API
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{msg=string} "确认同步API"
+// @Router /api/enterSyncApi [post]
+func (s *SystemApiApi) EnterSyncApi(c *gin.Context) {
+ var syncApi systemRes.SysSyncApis
+ err := c.ShouldBindJSON(&syncApi)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = apiService.EnterSyncApi(syncApi)
+ if err != nil {
+ global.GVA_LOG.Error("忽略失败!", zap.Error(err))
+ response.FailWithMessage("忽略失败", c)
+ return
+ }
+ response.Ok(c)
+}
+
// DeleteApi
// @Tags SysApi
// @Summary 删除api
@@ -220,7 +311,7 @@ func (s *SystemApiApi) DeleteApisByIds(c *gin.Context) {
// @Success 200 {object} response.Response{msg=string} "刷新成功"
// @Router /api/freshCasbin [get]
func (s *SystemApiApi) FreshCasbin(c *gin.Context) {
- err := apiService.FreshCasbin()
+ err := casbinService.FreshCasbin()
if err != nil {
global.GVA_LOG.Error("刷新失败!", zap.Error(err))
response.FailWithMessage("刷新失败", c)
diff --git a/server/api/v1/system/sys_authority.go b/server/api/v1/system/sys_authority.go
index 80ccff0fe..8cd32a69d 100644
--- a/server/api/v1/system/sys_authority.go
+++ b/server/api/v1/system/sys_authority.go
@@ -5,7 +5,6 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
- systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
@@ -25,26 +24,31 @@ type AuthorityApi struct{}
// @Success 200 {object} response.Response{data=systemRes.SysAuthorityResponse,msg=string} "创建角色,返回包括系统角色详情"
// @Router /authority/createAuthority [post]
func (a *AuthorityApi) CreateAuthority(c *gin.Context) {
- var authority system.SysAuthority
- err := c.ShouldBindJSON(&authority)
- if err != nil {
+ var authority, authBack system.SysAuthority
+ var err error
+
+ if err = c.ShouldBindJSON(&authority); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
- err = utils.Verify(authority, utils.AuthorityVerify)
- if err != nil {
+ if err = utils.Verify(authority, utils.AuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
- if authBack, err := authorityService.CreateAuthority(authority); err != nil {
+
+ if authBack, err = authorityService.CreateAuthority(authority); err != nil {
global.GVA_LOG.Error(global.Translate("general.creationFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.creationFailErr")+" "+err.Error(), c)
- } else {
- _ = menuService.AddMenuAuthority(systemReq.DefaultMenu(), authority.AuthorityId)
- _ = casbinService.UpdateCasbin(authority.AuthorityId, systemReq.DefaultCasbin())
- response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authBack}, global.Translate("general.createSuccss"), c)
+ return
}
+ err = casbinService.FreshCasbin()
+ if err != nil {
+ global.GVA_LOG.Error(global.Translate("system.authority.permissionRefreshFailed"), zap.Error(err))
+ response.FailWithMessage(global.Translate("system.authority.permissionRefreshFailed")+" "+err.Error(), c)
+ return
+ }
+ response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authBack}, global.Translate("general.createSuccss"), c)
}
// CopyAuthority
@@ -93,22 +97,22 @@ func (a *AuthorityApi) CopyAuthority(c *gin.Context) {
// @Router /authority/deleteAuthority [post]
func (a *AuthorityApi) DeleteAuthority(c *gin.Context) {
var authority system.SysAuthority
- err := c.ShouldBindJSON(&authority)
- if err != nil {
+ var err error
+ if err = c.ShouldBindJSON(&authority); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
- err = utils.Verify(authority, utils.AuthorityIdVerify)
- if err != nil {
+ if err = utils.Verify(authority, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
- err = authorityService.DeleteAuthority(&authority)
- if err != nil { // 删除角色之前需要判断是否有用户正在使用此角色
+ // 删除角色之前需要判断是否有用户正在使用此角色
+ if err = authorityService.DeleteAuthority(&authority); err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr")+" "+err.Error(), c)
return
}
+ _ = casbinService.FreshCasbin()
response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
}
diff --git a/server/api/v1/system/sys_auto_code.go b/server/api/v1/system/sys_auto_code.go
index fddf12294..c7a612eb6 100644
--- a/server/api/v1/system/sys_auto_code.go
+++ b/server/api/v1/system/sys_auto_code.go
@@ -1,98 +1,20 @@
package system
import (
- "errors"
- "fmt"
- "net/url"
- "os"
+ "io"
"strings"
+ "github.com/goccy/go-json"
+
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
- "github.com/flipped-aurora/gin-vue-admin/server/model/system"
- "github.com/flipped-aurora/gin-vue-admin/server/utils"
-
+ "github.com/flipped-aurora/gin-vue-admin/server/utils/request"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type AutoCodeApi struct{}
-// PreviewTemp
-// @Tags AutoCode
-// @Summary 预览创建后的代码
-// @Security ApiKeyAuth
-// @accept application/json
-// @Produce application/json
-// @Param data body system.AutoCodeStruct true "预览创建代码"
-// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "预览创建后的代码"
-// @Router /autoCode/preview [post]
-func (autoApi *AutoCodeApi) PreviewTemp(c *gin.Context) {
- var a system.AutoCodeStruct
- _ = c.ShouldBindJSON(&a)
- if err := utils.Verify(a, utils.AutoCodeVerify); err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- a.Pretreatment() // 处理go关键字
- a.PackageT = utils.FirstUpper(a.Package)
- autoCode, err := autoCodeService.PreviewTemp(a)
- if err != nil {
- global.GVA_LOG.Error(global.Translate("sys_auto_code.previewFail"), zap.Error(err))
- response.FailWithMessage(global.Translate("sys_auto_code.previewFailErr"), c)
- } else {
- response.OkWithDetailed(gin.H{"autoCode": autoCode}, global.Translate("sys_auto_code.previewSuccess"), c)
- }
-}
-
-// CreateTemp
-// @Tags AutoCode
-// @Summary 自动代码模板
-// @Security ApiKeyAuth
-// @accept application/json
-// @Produce application/json
-// @Param data body system.AutoCodeStruct true "创建自动代码"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"general.createSuccss"}"
-// @Router /autoCode/createTemp [post]
-func (autoApi *AutoCodeApi) CreateTemp(c *gin.Context) {
- var a system.AutoCodeStruct
- _ = c.ShouldBindJSON(&a)
- if err := utils.Verify(a, utils.AutoCodeVerify); err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- a.Pretreatment()
- var apiIds []uint
- if a.AutoCreateApiToSql {
- if ids, err := autoCodeService.AutoCreateApi(&a); err != nil {
- global.GVA_LOG.Error(global.Translate("sys_auto_code.autoCreateFail"), zap.Error(err))
- c.Writer.Header().Add("success", "false")
- c.Writer.Header().Add("msg", url.QueryEscape(global.Translate("sys_auto_code.autoCreateFail")))
- return
- } else {
- apiIds = ids
- }
- }
- a.PackageT = utils.FirstUpper(a.Package)
- err := autoCodeService.CreateTemp(a, apiIds...)
- if err != nil {
- if errors.Is(err, system.ErrAutoMove) {
- c.Writer.Header().Add("success", "true")
- c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
- } else {
- c.Writer.Header().Add("success", "false")
- c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
- _ = os.Remove("./ginvueadmin.zip")
- }
- } else {
- c.Writer.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "ginvueadmin.zip")) // fmt.Sprintf("attachment; filename=%s", filename)对下载的文件重命名
- c.Writer.Header().Add("Content-Type", "application/json")
- c.Writer.Header().Add("success", "true")
- c.File("./ginvueadmin.zip")
- _ = os.Remove("./ginvueadmin.zip")
- }
-}
-
// GetDB
// @Tags AutoCode
// @Summary 获取当前所有数据库
@@ -162,154 +84,44 @@ func (autoApi *AutoCodeApi) GetColumn(c *gin.Context) {
}
}
-// CreatePackage
-// @Tags AutoCode
-// @Summary 创建package
-// @Security ApiKeyAuth
-// @accept application/json
-// @Produce application/json
-// @Param data body system.SysAutoCode true "创建package"
-// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
-// @Router /autoCode/createPackage [post]
-func (autoApi *AutoCodeApi) CreatePackage(c *gin.Context) {
- var a system.SysAutoCode
- _ = c.ShouldBindJSON(&a)
- if err := utils.Verify(a, utils.AutoPackageVerify); err != nil {
- response.FailWithMessage(err.Error(), c)
+func (autoApi *AutoCodeApi) LLMAuto(c *gin.Context) {
+ prompt := c.Query("prompt")
+ mode := c.Query("mode")
+ params := make(map[string]string)
+ params["prompt"] = prompt
+ params["mode"] = mode
+ path := strings.ReplaceAll(global.GVA_CONFIG.AutoCode.AiPath, "{FUNC}", "api/chat/ai")
+ res, err := request.HttpRequest(
+ path,
+ "POST",
+ nil,
+ params,
+ nil,
+ )
+ if err != nil {
+ global.GVA_LOG.Error(global.Translate("sys_auto_code.largeModelCreationFail"), zap.Error(err))
+ response.FailWithMessage(global.Translate("sys_auto_code.largeModelCreationFailErr")+" "+err.Error(), c)
return
}
- err := autoCodeService.CreateAutoCode(&a)
+ var resStruct response.Response
+ b, err := io.ReadAll(res.Body)
+ defer res.Body.Close()
if err != nil {
-
- global.GVA_LOG.Error("创建成功!", zap.Error(err))
- response.FailWithMessage("创建失败", c)
- } else {
- response.OkWithMessage("创建成功", c)
- }
-}
-
-// GetPackage
-// @Tags AutoCode
-// @Summary 获取package
-// @Security ApiKeyAuth
-// @accept application/json
-// @Produce application/json
-// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
-// @Router /autoCode/getPackage [post]
-func (autoApi *AutoCodeApi) GetPackage(c *gin.Context) {
- pkgs, err := autoCodeService.GetPackage()
- if err != nil {
- global.GVA_LOG.Error("获取失败!", zap.Error(err))
- response.FailWithMessage("获取失败", c)
- } else {
- response.OkWithDetailed(gin.H{"pkgs": pkgs}, "获取成功", c)
- }
-}
-
-// DelPackage
-// @Tags AutoCode
-// @Summary 删除package
-// @Security ApiKeyAuth
-// @accept application/json
-// @Produce application/json
-// @Param data body system.SysAutoCode true "创建package"
-// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "删除package成功"
-// @Router /autoCode/delPackage [post]
-func (autoApi *AutoCodeApi) DelPackage(c *gin.Context) {
- var a system.SysAutoCode
- _ = c.ShouldBindJSON(&a)
- err := autoCodeService.DelPackage(a)
- if err != nil {
- global.GVA_LOG.Error("删除失败!", zap.Error(err))
- response.FailWithMessage("删除失败", c)
- } else {
- response.OkWithMessage("删除成功", c)
- }
-}
-
-// AutoPlug
-// @Tags AutoCode
-// @Summary 创建插件模板
-// @Security ApiKeyAuth
-// @accept application/json
-// @Produce application/json
-// @Param data body system.SysAutoCode true "创建插件模板"
-// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建插件模板成功"
-// @Router /autoCode/createPlug [post]
-func (autoApi *AutoCodeApi) AutoPlug(c *gin.Context) {
- var a system.AutoPlugReq
- err := c.ShouldBindJSON(&a)
- if err != nil {
- response.FailWithMessage(err.Error(), c)
+ global.GVA_LOG.Error(global.Translate("sys_auto_code.largeModelCreationFail"), zap.Error(err))
+ response.FailWithMessage(global.Translate("sys_auto_code.largeModelCreationFailErr")+" "+err.Error(), c)
return
}
- a.Snake = strings.ToLower(a.PlugName)
- a.NeedModel = a.HasRequest || a.HasResponse
- err = autoCodeService.CreatePlug(a)
+ err = json.Unmarshal(b, &resStruct)
if err != nil {
- global.GVA_LOG.Error("预览失败!", zap.Error(err))
- response.FailWithMessage("预览失败", c)
+ global.GVA_LOG.Error(global.Translate("sys_auto_code.largeModelCreationFail"), zap.Error(err))
+ response.FailWithMessage(global.Translate("sys_auto_code.largeModelCreationFailErr")+" "+err.Error(), c)
return
}
- response.Ok(c)
-}
-// InstallPlugin
-// @Tags AutoCode
-// @Summary 安装插件
-// @Security ApiKeyAuth
-// @accept multipart/form-data
-// @Produce application/json
-// @Param plug formData file true "this is a test file"
-// @Success 200 {object} response.Response{data=[]interface{},msg=string} "安装插件成功"
-// @Router /autoCode/installPlugin [post]
-func (autoApi *AutoCodeApi) InstallPlugin(c *gin.Context) {
- header, err := c.FormFile("plug")
- if err != nil {
- response.FailWithMessage(err.Error(), c)
+ if resStruct.Code == 7 {
+ global.GVA_LOG.Error(global.Translate("sys_auto_code.largeModelCreationFail")+resStruct.Msg, zap.Error(err))
+ response.FailWithMessage(global.Translate("sys_auto_code.largeModelCreationFailErr")+" "+resStruct.Msg, c)
return
}
- web, server, err := autoCodeService.InstallPlugin(header)
- webStr := "web插件安装成功"
- serverStr := "server插件安装成功"
- if web == -1 {
- webStr = "web端插件未成功安装,请按照文档自行解压安装,如果为纯后端插件请忽略此条提示"
- }
- if server == -1 {
- serverStr = "server端插件未成功安装,请按照文档自行解压安装,如果为纯前端插件请忽略此条提示"
- }
- if err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- response.OkWithData([]interface{}{
- gin.H{
- "code": web,
- "msg": webStr,
- },
- gin.H{
- "code": server,
- "msg": serverStr,
- }}, c)
-}
-
-// PubPlug
-// @Tags AutoCode
-// @Summary 打包插件
-// @Security ApiKeyAuth
-// @accept application/json
-// @Produce application/json
-// @Param data body system.SysAutoCode true "打包插件"
-// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "打包插件成功"
-// @Router /autoCode/pubPlug [get]
-func (autoApi *AutoCodeApi) PubPlug(c *gin.Context) {
- plugName := c.Query("plugName")
- snake := strings.ToLower(plugName)
- zipPath, err := autoCodeService.PubPlug(snake)
- if err != nil {
- global.GVA_LOG.Error("打包失败!", zap.Error(err))
- response.FailWithMessage("打包失败"+err.Error(), c)
- return
- }
- response.OkWithMessage(fmt.Sprintf("打包成功,文件路径为:%s", zipPath), c)
+ response.OkWithData(resStruct.Data, c)
}
diff --git a/server/api/v1/system/sys_captcha.go b/server/api/v1/system/sys_captcha.go
index ec3029d6c..24f487602 100644
--- a/server/api/v1/system/sys_captcha.go
+++ b/server/api/v1/system/sys_captcha.go
@@ -44,7 +44,7 @@ func (b *BaseApi) Captcha(c *gin.Context) {
driver := base64Captcha.NewDriverDigit(global.GVA_CONFIG.Captcha.ImgHeight, global.GVA_CONFIG.Captcha.ImgWidth, global.GVA_CONFIG.Captcha.KeyLong, 0.7, 80)
// cp := base64Captcha.NewCaptcha(driver, store.UseWithCtx(c)) // v8下使用redis
cp := base64Captcha.NewCaptcha(driver, store)
- id, b64s, err := cp.Generate()
+ id, b64s, _, err := cp.Generate()
if err != nil {
global.GVA_LOG.Error(global.Translate("sys_captcha.vCodeFail"), zap.Error(err))
response.FailWithMessage(global.Translate("sys_captcha.vCodeFailErr"), c)
diff --git a/server/api/v1/system/sys_chatgpt.go b/server/api/v1/system/sys_chatgpt.go
deleted file mode 100644
index af1f0cdd7..000000000
--- a/server/api/v1/system/sys_chatgpt.go
+++ /dev/null
@@ -1,71 +0,0 @@
-package system
-
-import (
- "github.com/flipped-aurora/gin-vue-admin/server/global"
- "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
- sysModel "github.com/flipped-aurora/gin-vue-admin/server/model/system"
- "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
- "github.com/gin-gonic/gin"
- "go.uber.org/zap"
-)
-
-type ChatGptApi struct{}
-
-func (chat *ChatGptApi) CreateSK(c *gin.Context) {
- var option sysModel.SysChatGptOption
- c.ShouldBindJSON(&option)
- err := chatGptService.CreateSK(option)
- if err != nil {
- global.GVA_LOG.Error("创建失败!", zap.Error(err))
- response.FailWithMessage("创建失败"+err.Error(), c)
- return
- }
- response.OkWithMessage("创建成功", c)
-}
-
-func (chat *ChatGptApi) GetSK(c *gin.Context) {
- var option sysModel.SysChatGptOption
- c.ShouldBindJSON(&option)
- _, err := chatGptService.GetSK()
- if err != nil {
- response.OkWithDetailed(gin.H{
- "ok": false,
- }, "无sk或获取失败", c)
- return
- }
- response.OkWithDetailed(gin.H{
- "ok": true,
- }, "获取成功", c)
-}
-
-func (chat *ChatGptApi) DeleteSK(c *gin.Context) {
- err := chatGptService.DeleteSK()
- if err != nil {
- global.GVA_LOG.Error("删除失败!", zap.Error(err))
- response.FailWithMessage("删除失败"+err.Error(), c)
- return
- }
- response.OkWithMessage("删除成功", c)
-}
-
-func (chat *ChatGptApi) GetTable(c *gin.Context) {
- var req request.ChatGptRequest
- err := c.ShouldBindJSON(&req)
- if err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- sql, results, err := chatGptService.GetTable(req)
- if err != nil {
- global.GVA_LOG.Error("查询失败!", zap.Error(err))
- response.FailWithDetailed(gin.H{
- "sql": sql,
- "results": results,
- }, "生成失败"+err.Error(), c)
- return
- }
- response.OkWithDetailed(gin.H{
- "sql": sql,
- "results": results,
- }, "ChatGpt生成完成", c)
-}
diff --git a/server/api/v1/system/sys_dictionary.go b/server/api/v1/system/sys_dictionary.go
index 67b554f69..1b700557f 100644
--- a/server/api/v1/system/sys_dictionary.go
+++ b/server/api/v1/system/sys_dictionary.go
@@ -4,8 +4,6 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
- "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
- "github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
@@ -118,31 +116,14 @@ func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
-// @Param data query request.SysDictionarySearch true "页码, 每页大小, 搜索条件"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取SysDictionary列表,返回包括列表,总数,页码,每页数量"
// @Router /sysDictionary/getSysDictionaryList [get]
func (s *DictionaryApi) GetSysDictionaryList(c *gin.Context) {
- var pageInfo request.SysDictionarySearch
- err := c.ShouldBindQuery(&pageInfo)
- if err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- err = utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify)
- if err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- list, total, err := dictionaryService.GetSysDictionaryInfoList(pageInfo)
+ list, err := dictionaryService.GetSysDictionaryInfoList()
if err != nil {
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.getDataFailErr"), c)
return
}
- response.OkWithDetailed(response.PageResult{
- List: list,
- Total: total,
- Page: pageInfo.Page,
- PageSize: pageInfo.PageSize,
- }, global.Translate("general.getDataSuccess"), c)
+ response.OkWithDetailed(list, global.Translate("general.getDataSuccess"), c)
}
diff --git a/server/api/v1/system/sys_export_template.go b/server/api/v1/system/sys_export_template.go
new file mode 100644
index 000000000..38b22965b
--- /dev/null
+++ b/server/api/v1/system/sys_export_template.go
@@ -0,0 +1,258 @@
+package system
+
+import (
+ "fmt"
+ "net/http"
+
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+ systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
+ "github.com/flipped-aurora/gin-vue-admin/server/service"
+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
+ "github.com/gin-gonic/gin"
+ "go.uber.org/zap"
+)
+
+type SysExportTemplateApi struct {
+}
+
+var sysExportTemplateService = service.ServiceGroupApp.SystemServiceGroup.SysExportTemplateService
+
+// CreateSysExportTemplate 创建导出模板
+// @Tags SysExportTemplate
+// @Summary 创建导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body system.SysExportTemplate true "创建导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
+// @Router /sysExportTemplate/createSysExportTemplate [post]
+func (sysExportTemplateApi *SysExportTemplateApi) CreateSysExportTemplate(c *gin.Context) {
+ var sysExportTemplate system.SysExportTemplate
+ err := c.ShouldBindJSON(&sysExportTemplate)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ verify := utils.Rules{
+ "Name": {utils.NotEmpty()},
+ }
+ if err := utils.Verify(sysExportTemplate, verify); err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ if err := sysExportTemplateService.CreateSysExportTemplate(&sysExportTemplate); err != nil {
+ global.GVA_LOG.Error("创建失败!", zap.Error(err))
+ response.FailWithMessage("创建失败", c)
+ } else {
+ response.OkWithMessage("创建成功", c)
+ }
+}
+
+// DeleteSysExportTemplate 删除导出模板
+// @Tags SysExportTemplate
+// @Summary 删除导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body system.SysExportTemplate true "删除导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Router /sysExportTemplate/deleteSysExportTemplate [delete]
+func (sysExportTemplateApi *SysExportTemplateApi) DeleteSysExportTemplate(c *gin.Context) {
+ var sysExportTemplate system.SysExportTemplate
+ err := c.ShouldBindJSON(&sysExportTemplate)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ if err := sysExportTemplateService.DeleteSysExportTemplate(sysExportTemplate); err != nil {
+ global.GVA_LOG.Error("删除失败!", zap.Error(err))
+ response.FailWithMessage("删除失败", c)
+ } else {
+ response.OkWithMessage("删除成功", c)
+ }
+}
+
+// DeleteSysExportTemplateByIds 批量删除导出模板
+// @Tags SysExportTemplate
+// @Summary 批量删除导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body request.IdsReq true "批量删除导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
+// @Router /sysExportTemplate/deleteSysExportTemplateByIds [delete]
+func (sysExportTemplateApi *SysExportTemplateApi) DeleteSysExportTemplateByIds(c *gin.Context) {
+ var IDS request.IdsReq
+ err := c.ShouldBindJSON(&IDS)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ if err := sysExportTemplateService.DeleteSysExportTemplateByIds(IDS); err != nil {
+ global.GVA_LOG.Error("批量删除失败!", zap.Error(err))
+ response.FailWithMessage("批量删除失败", c)
+ } else {
+ response.OkWithMessage("批量删除成功", c)
+ }
+}
+
+// UpdateSysExportTemplate 更新导出模板
+// @Tags SysExportTemplate
+// @Summary 更新导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body system.SysExportTemplate true "更新导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Router /sysExportTemplate/updateSysExportTemplate [put]
+func (sysExportTemplateApi *SysExportTemplateApi) UpdateSysExportTemplate(c *gin.Context) {
+ var sysExportTemplate system.SysExportTemplate
+ err := c.ShouldBindJSON(&sysExportTemplate)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ verify := utils.Rules{
+ "Name": {utils.NotEmpty()},
+ }
+ if err := utils.Verify(sysExportTemplate, verify); err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ if err := sysExportTemplateService.UpdateSysExportTemplate(sysExportTemplate); err != nil {
+ global.GVA_LOG.Error("更新失败!", zap.Error(err))
+ response.FailWithMessage("更新失败", c)
+ } else {
+ response.OkWithMessage("更新成功", c)
+ }
+}
+
+// FindSysExportTemplate 用id查询导出模板
+// @Tags SysExportTemplate
+// @Summary 用id查询导出模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query system.SysExportTemplate true "用id查询导出模板"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /sysExportTemplate/findSysExportTemplate [get]
+func (sysExportTemplateApi *SysExportTemplateApi) FindSysExportTemplate(c *gin.Context) {
+ var sysExportTemplate system.SysExportTemplate
+ err := c.ShouldBindQuery(&sysExportTemplate)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ if resysExportTemplate, err := sysExportTemplateService.GetSysExportTemplate(sysExportTemplate.ID); err != nil {
+ global.GVA_LOG.Error("查询失败!", zap.Error(err))
+ response.FailWithMessage("查询失败", c)
+ } else {
+ response.OkWithData(gin.H{"resysExportTemplate": resysExportTemplate}, c)
+ }
+}
+
+// GetSysExportTemplateList 分页获取导出模板列表
+// @Tags SysExportTemplate
+// @Summary 分页获取导出模板列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query systemReq.SysExportTemplateSearch true "分页获取导出模板列表"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Router /sysExportTemplate/getSysExportTemplateList [get]
+func (sysExportTemplateApi *SysExportTemplateApi) GetSysExportTemplateList(c *gin.Context) {
+ var pageInfo systemReq.SysExportTemplateSearch
+ err := c.ShouldBindQuery(&pageInfo)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ if list, total, err := sysExportTemplateService.GetSysExportTemplateInfoList(pageInfo); err != nil {
+ global.GVA_LOG.Error("获取失败!", zap.Error(err))
+ response.FailWithMessage("获取失败", c)
+ } else {
+ response.OkWithDetailed(response.PageResult{
+ List: list,
+ Total: total,
+ Page: pageInfo.Page,
+ PageSize: pageInfo.PageSize,
+ }, "获取成功", c)
+ }
+}
+
+// ExportExcel 导出表格
+// @Tags SysExportTemplate
+// @Summary 导出表格
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Router /sysExportTemplate/exportExcel [get]
+func (sysExportTemplateApi *SysExportTemplateApi) ExportExcel(c *gin.Context) {
+ templateID := c.Query("templateID")
+ queryParams := c.Request.URL.Query()
+ if templateID == "" {
+ response.FailWithMessage("模板ID不能为空", c)
+ return
+ }
+ if file, name, err := sysExportTemplateService.ExportExcel(templateID, queryParams); err != nil {
+ global.GVA_LOG.Error("获取失败!", zap.Error(err))
+ response.FailWithMessage("获取失败", c)
+ } else {
+ c.Header("Content-Disposition", fmt.Sprintf("attachment; filename=%s", name+utils.RandomString(6)+".xlsx")) // 对下载的文件重命名
+ c.Header("success", "true")
+ c.Data(http.StatusOK, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", file.Bytes())
+ }
+}
+
+// ExportTemplate 导出表格模板
+// @Tags SysExportTemplate
+// @Summary 导出表格模板
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Router /sysExportTemplate/exportExcel [get]
+func (sysExportTemplateApi *SysExportTemplateApi) ExportTemplate(c *gin.Context) {
+ templateID := c.Query("templateID")
+ if templateID == "" {
+ response.FailWithMessage("模板ID不能为空", c)
+ return
+ }
+ if file, name, err := sysExportTemplateService.ExportTemplate(templateID); err != nil {
+ global.GVA_LOG.Error("获取失败!", zap.Error(err))
+ response.FailWithMessage("获取失败", c)
+ } else {
+ c.Header("Content-Disposition", fmt.Sprintf("attachment; filename=%s", name+"模板.xlsx")) // 对下载的文件重命名
+ c.Header("success", "true")
+ c.Data(http.StatusOK, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", file.Bytes())
+ }
+}
+
+// ImportExcel 导入表格
+// @Tags SysImportTemplate
+// @Summary 导入表格
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Router /sysExportTemplate/importExcel [post]
+func (sysExportTemplateApi *SysExportTemplateApi) ImportExcel(c *gin.Context) {
+ templateID := c.Query("templateID")
+ if templateID == "" {
+ response.FailWithMessage("模板ID不能为空", c)
+ return
+ }
+ file, err := c.FormFile("file")
+ if err != nil {
+ global.GVA_LOG.Error("文件获取失败!", zap.Error(err))
+ response.FailWithMessage("文件获取失败", c)
+ return
+ }
+ if err := sysExportTemplateService.ImportExcel(templateID, file); err != nil {
+ global.GVA_LOG.Error(err.Error(), zap.Error(err))
+ response.FailWithMessage(err.Error(), c)
+ } else {
+ response.OkWithMessage("导入成功", c)
+ }
+}
diff --git a/server/api/v1/system/sys_jwt_blacklist.go b/server/api/v1/system/sys_jwt_blacklist.go
index 0320cc579..ef3975077 100644
--- a/server/api/v1/system/sys_jwt_blacklist.go
+++ b/server/api/v1/system/sys_jwt_blacklist.go
@@ -4,6 +4,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
@@ -19,7 +20,7 @@ type JwtApi struct{}
// @Success 200 {object} response.Response{msg=string} "jwt加入黑名单"
// @Router /jwt/jsonInBlacklist [post]
func (j *JwtApi) JsonInBlacklist(c *gin.Context) {
- token := c.Request.Header.Get("x-token")
+ token := utils.GetToken(c)
jwt := system.JwtBlacklist{Jwt: token}
err := jwtService.JsonInBlacklist(jwt)
if err != nil {
@@ -27,5 +28,6 @@ func (j *JwtApi) JsonInBlacklist(c *gin.Context) {
response.FailWithMessage(global.Translate("sys_jwt_blacklist.jwtInvalidationFailedErr"), c)
return
}
+ utils.ClearToken(c)
response.OkWithMessage(global.Translate("sys_jwt_blacklist.jwtInvalidatedSuccess"), c)
}
diff --git a/server/api/v1/system/sys_system.go b/server/api/v1/system/sys_system.go
index 07a25597d..a1936f51d 100644
--- a/server/api/v1/system/sys_system.go
+++ b/server/api/v1/system/sys_system.go
@@ -6,7 +6,6 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
-
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
diff --git a/server/api/v1/system/sys_user.go b/server/api/v1/system/sys_user.go
index 9b7cf9217..b7f375704 100644
--- a/server/api/v1/system/sys_user.go
+++ b/server/api/v1/system/sys_user.go
@@ -76,21 +76,14 @@ func (b *BaseApi) Login(c *gin.Context) {
// TokenNext 登录以后签发jwt
func (b *BaseApi) TokenNext(c *gin.Context, user system.SysUser) {
- j := &utils.JWT{SigningKey: []byte(global.GVA_CONFIG.JWT.SigningKey)} // 唯一签名
- claims := j.CreateClaims(systemReq.BaseClaims{
- UUID: user.UUID,
- ID: user.ID,
- NickName: user.NickName,
- Username: user.Username,
- AuthorityId: user.AuthorityId,
- })
- token, err := j.CreateToken(claims)
+ token, claims, err := utils.LoginToken(&user)
if err != nil {
global.GVA_LOG.Error(global.Translate("sys_user.getTokenFail"), zap.Error(err))
response.FailWithMessage(global.Translate("sys_user.getTokenErr"), c)
return
}
if !global.GVA_CONFIG.System.UseMultipoint {
+ utils.SetToken(c, token, int(claims.RegisteredClaims.ExpiresAt.Unix()-time.Now().Unix()))
response.OkWithDetailed(systemRes.LoginResponse{
User: user,
Token: token,
@@ -105,6 +98,7 @@ func (b *BaseApi) TokenNext(c *gin.Context, user system.SysUser) {
response.FailWithMessage(global.Translate("sys_user.loginStatusFailErr"), c)
return
}
+ utils.SetToken(c, token, int(claims.RegisteredClaims.ExpiresAt.Unix()-time.Now().Unix()))
response.OkWithDetailed(systemRes.LoginResponse{
User: user,
Token: token,
@@ -120,10 +114,11 @@ func (b *BaseApi) TokenNext(c *gin.Context, user system.SysUser) {
response.FailWithMessage(global.Translate("sys_user.jwtInvalidationFailed"), c)
return
}
- if err := jwtService.SetRedisJWT(token, user.Username); err != nil {
+ if err := jwtService.SetRedisJWT(token, user.GetUsername()); err != nil {
response.FailWithMessage(global.Translate("sys_user.loginStatusFailErr"), c)
return
}
+ utils.SetToken(c, token, int(claims.RegisteredClaims.ExpiresAt.Unix()-time.Now().Unix()))
response.OkWithDetailed(systemRes.LoginResponse{
User: user,
Token: token,
@@ -269,6 +264,7 @@ func (b *BaseApi) SetUserAuthority(c *gin.Context) {
} else {
c.Header("new-token", token)
c.Header("new-expires-at", strconv.FormatInt(claims.ExpiresAt.Unix(), 10))
+ utils.SetToken(c, token, int((claims.ExpiresAt.Unix()-time.Now().Unix())/60))
response.OkWithMessage(global.Translate("general.modifySuccess"), c)
}
}
diff --git a/server/config.docker.yaml b/server/config.docker.yaml
index 5d6e1eb62..a7783716f 100644
--- a/server/config.docker.yaml
+++ b/server/config.docker.yaml
@@ -23,6 +23,22 @@ redis:
addr: 177.7.0.14:6379
password: ""
+# mongo configuration
+mongo:
+ coll: ''
+ options: ''
+ database: ''
+ username: ''
+ password: ''
+ min-pool-size: 0
+ max-pool-size: 100
+ socket-timeout-ms: 0
+ connect-timeout-ms: 0
+ is-zap: false
+ hosts:
+ - host: ''
+ port: ''
+
# email configuration
email:
to: xxx@qq.com
@@ -40,6 +56,7 @@ system:
db-type: mysql
oss-type: local # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
use-redis: false # 使用redis
+ use-mongo: false # 使用mongo
use-multipoint: false
# IP限制次数 一个小时15000次
iplimit-count: 15000
diff --git a/server/config.yaml b/server/config.yaml
index 4698a0dea..32aff73de 100644
--- a/server/config.yaml
+++ b/server/config.yaml
@@ -16,12 +16,38 @@ zap:
encode-level: LowercaseColorLevelEncoder
stacktrace-key: stacktrace
log-in-console: true
+ retention-day: -1
# redis configuration
redis:
- db: 0
+ #是否使用redis集群模式
+ useCluster: false
+ #使用集群模式addr和db默认无效
addr: 127.0.0.1:6379
password: ""
+ db: 0
+ clusterAddrs:
+ - "172.21.0.3:7000"
+ - "172.21.0.4:7001"
+ - "172.21.0.2:7002"
+
+
+# mongo configuration
+mongo:
+ coll: ''
+ options: ''
+ database: ''
+ username: ''
+ password: ''
+ auth-source: ''
+ min-pool-size: 0
+ max-pool-size: 100
+ socket-timeout-ms: 0
+ connect-timeout-ms: 0
+ is-zap: false
+ hosts:
+ - host: ''
+ port: ''
# email configuration
email:
@@ -35,11 +61,12 @@ email:
# system configuration
system:
- env: public # Change to "develop" to skip authentication for development mode
+ env: local # 修改为public可以关闭路由日志输出
addr: 8888
db-type: mysql
oss-type: local # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
use-redis: false # 使用redis
+ use-mongo: false # 使用mongo
use-multipoint: false
# IP限制次数 一个小时15000次
iplimit-count: 15000
@@ -138,22 +165,11 @@ local:
# autocode configuration
autocode:
- transfer-restart: true
- # root 自动适配项目根目录
- # 请不要手动配置,他会在项目加载的时候识别出根路径
- root: ""
- server: /server
- server-plug: /plugin/%s
- server-api: /api/v1/%s
- server-initialize: /initialize
- server-model: /model/%s
- server-request: /model/%s/request/
- server-router: /router/%s
- server-service: /service/%s
- web: /web/src
- web-api: /api
- web-form: /view
- web-table: /view
+ web: web/src
+ root: "" # root 自动适配项目根目录, 请不要手动配置,他会在项目加载的时候识别出根路径
+ server: server
+ module: 'github.com/flipped-aurora/gin-vue-admin/server'
+ ai-path: "" # AI服务路径
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
qiniu:
@@ -195,6 +211,15 @@ aws-s3:
base-url: https://gin.vue.admin
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
+# cloudflare r2 configuration
+cloudflare-r2:
+ bucket: xxxx0bucket
+ base-url: https://gin.vue.admin.com
+ path: uploads
+ account-id: xxx_account_id
+ access-key-id: xxx_key_id
+ secret-access-key: xxx_secret_key
+
# huawei obs configuration
hua-wei-obs:
path: you-path
@@ -207,17 +232,9 @@ hua-wei-obs:
excel:
dir: ./resource/excel/
-# timer task db clear table
-Timer:
- start: true
- spec: "@daily" # 定时任务详细配置参考 https://pkg.go.dev/github.com/robfig/cron/v3
- detail:
- - tableName: sys_operation_records
- compareField: created_at
- interval: 2160h
- - tableName: jwt_blacklists
- compareField: created_at
- interval: 168h
+# disk usage configuration
+disk-list:
+ - mount-point: "/"
# 跨域配置
# 需要配合 server/initialize/router.go -> `Router.Use(middleware.CorsByRules())` 使用
diff --git a/server/config/auto_code.go b/server/config/auto_code.go
index d39d7af8e..ade79a023 100644
--- a/server/config/auto_code.go
+++ b/server/config/auto_code.go
@@ -1,18 +1,22 @@
package config
+import (
+ "path/filepath"
+ "strings"
+)
+
type Autocode struct {
- SModel string `mapstructure:"server-model" json:"server-model" yaml:"server-model"`
- SRouter string `mapstructure:"server-router" json:"server-router" yaml:"server-router"`
- Server string `mapstructure:"server" json:"server" yaml:"server"`
- SApi string `mapstructure:"server-api" json:"server-api" yaml:"server-api"`
- SPlug string `mapstructure:"server-plug" json:"server-plug" yaml:"server-plug"`
- SInitialize string `mapstructure:"server-initialize" json:"server-initialize" yaml:"server-initialize"`
- Root string `mapstructure:"root" json:"root" yaml:"root"`
- WTable string `mapstructure:"web-table" json:"web-table" yaml:"web-table"`
- Web string `mapstructure:"web" json:"web" yaml:"web"`
- SService string `mapstructure:"server-service" json:"server-service" yaml:"server-service"`
- SRequest string `mapstructure:"server-request" json:"server-request" yaml:"server-request"`
- WApi string `mapstructure:"web-api" json:"web-api" yaml:"web-api"`
- WForm string `mapstructure:"web-form" json:"web-form" yaml:"web-form"`
- TransferRestart bool `mapstructure:"transfer-restart" json:"transfer-restart" yaml:"transfer-restart"`
+ Web string `mapstructure:"web" json:"web" yaml:"web"`
+ Root string `mapstructure:"root" json:"root" yaml:"root"`
+ Server string `mapstructure:"server" json:"server" yaml:"server"`
+ Module string `mapstructure:"module" json:"module" yaml:"module"`
+ AiPath string `mapstructure:"ai-path" json:"ai-path" yaml:"ai-path"`
+}
+
+func (a *Autocode) WebRoot() string {
+ webs := strings.Split(a.Web, "/")
+ if len(webs) == 0 {
+ webs = strings.Split(a.Web, "\\")
+ }
+ return filepath.Join(webs...)
}
diff --git a/server/config/config.go b/server/config/config.go
index ed3a613c6..63a507514 100644
--- a/server/config/config.go
+++ b/server/config/config.go
@@ -4,6 +4,7 @@ type Server struct {
JWT JWT `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
Zap Zap `mapstructure:"zap" json:"zap" yaml:"zap"`
Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"`
+ Mongo Mongo `mapstructure:"mongo" json:"mongo" yaml:"mongo"`
Email Email `mapstructure:"email" json:"email" yaml:"email"`
System System `mapstructure:"system" json:"system" yaml:"system"`
Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
@@ -17,15 +18,17 @@ type Server struct {
Sqlite Sqlite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
DBList []SpecializedDB `mapstructure:"db-list" json:"db-list" yaml:"db-list"`
// oss
- Local Local `mapstructure:"local" json:"local" yaml:"local"`
- Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
- AliyunOSS AliyunOSS `mapstructure:"aliyun-oss" json:"aliyun-oss" yaml:"aliyun-oss"`
- HuaWeiObs HuaWeiObs `mapstructure:"hua-wei-obs" json:"hua-wei-obs" yaml:"hua-wei-obs"`
- TencentCOS TencentCOS `mapstructure:"tencent-cos" json:"tencent-cos" yaml:"tencent-cos"`
- AwsS3 AwsS3 `mapstructure:"aws-s3" json:"aws-s3" yaml:"aws-s3"`
+ Local Local `mapstructure:"local" json:"local" yaml:"local"`
+ Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
+ AliyunOSS AliyunOSS `mapstructure:"aliyun-oss" json:"aliyun-oss" yaml:"aliyun-oss"`
+ HuaWeiObs HuaWeiObs `mapstructure:"hua-wei-obs" json:"hua-wei-obs" yaml:"hua-wei-obs"`
+ TencentCOS TencentCOS `mapstructure:"tencent-cos" json:"tencent-cos" yaml:"tencent-cos"`
+ AwsS3 AwsS3 `mapstructure:"aws-s3" json:"aws-s3" yaml:"aws-s3"`
+ CloudflareR2 CloudflareR2 `mapstructure:"cloudflare-r2" json:"cloudflare-r2" yaml:"cloudflare-r2"`
Excel Excel `mapstructure:"excel" json:"excel" yaml:"excel"`
- Timer Timer `mapstructure:"timer" json:"timer" yaml:"timer"`
+
+ DiskList []DiskList `mapstructure:"disk-list" json:"disk-list" yaml:"disk-list"`
// 跨域配置
Cors CORS `mapstructure:"cors" json:"cors" yaml:"cors"`
diff --git a/server/config/db_list.go b/server/config/db_list.go
index 17eaac965..39767f53b 100644
--- a/server/config/db_list.go
+++ b/server/config/db_list.go
@@ -1,5 +1,10 @@
package config
+import (
+ "gorm.io/gorm/logger"
+ "strings"
+)
+
type DsnProvider interface {
Dsn() string
}
@@ -9,21 +14,36 @@ type DsnProvider interface {
// GeneralDB 也被 Pgsql 和 Mysql 原样使用
type GeneralDB struct {
- Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
- Port string `mapstructure:"port" json:"port" yaml:"port"`
- Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置
- Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"` // 数据库名
- Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库密码
- Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码
- Path string `mapstructure:"path" json:"path" yaml:"path"`
- Engine string `mapstructure:"engine" json:"engine" yaml:"engine" default:"InnoDB"` //数据库引擎,默认InnoDB
+ Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // 数据库前缀
+ Port string `mapstructure:"port" json:"port" yaml:"port"` // 数据库端口
+ Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置
+ Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"` // 数据库名
+ Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库账号
+ Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码
+ Path string `mapstructure:"path" json:"path" yaml:"path"` // 数据库地址
+ Engine string `mapstructure:"engine" json:"engine" yaml:"engine" default:"InnoDB"` // 数据库引擎,默认InnoDB
LogMode string `mapstructure:"log-mode" json:"log-mode" yaml:"log-mode"` // 是否开启Gorm全局日志
MaxIdleConns int `mapstructure:"max-idle-conns" json:"max-idle-conns" yaml:"max-idle-conns"` // 空闲中的最大连接数
MaxOpenConns int `mapstructure:"max-open-conns" json:"max-open-conns" yaml:"max-open-conns"` // 打开到数据库的最大连接数
- Singular bool `mapstructure:"singular" json:"singular" yaml:"singular"` //是否开启全局禁用复数,true表示开启
+ Singular bool `mapstructure:"singular" json:"singular" yaml:"singular"` // 是否开启全局禁用复数,true表示开启
LogZap bool `mapstructure:"log-zap" json:"log-zap" yaml:"log-zap"` // 是否通过zap写入日志文件
}
+func (c GeneralDB) LogLevel() logger.LogLevel {
+ switch strings.ToLower(c.LogMode) {
+ case "silent", "Silent":
+ return logger.Silent
+ case "error", "Error":
+ return logger.Error
+ case "warn", "Warn":
+ return logger.Warn
+ case "info", "Info":
+ return logger.Info
+ default:
+ return logger.Info
+ }
+}
+
type SpecializedDB struct {
Type string `mapstructure:"type" json:"type" yaml:"type"`
AliasName string `mapstructure:"alias-name" json:"alias-name" yaml:"alias-name"`
diff --git a/server/config/disk.go b/server/config/disk.go
new file mode 100644
index 000000000..59a633259
--- /dev/null
+++ b/server/config/disk.go
@@ -0,0 +1,9 @@
+package config
+
+type Disk struct {
+ MountPoint string `mapstructure:"mount-point" json:"mount-point" yaml:"mount-point"`
+}
+
+type DiskList struct {
+ Disk `yaml:",inline" mapstructure:",squash"`
+}
diff --git a/server/config/gorm_mssql.go b/server/config/gorm_mssql.go
index db299e1e3..d18711948 100644
--- a/server/config/gorm_mssql.go
+++ b/server/config/gorm_mssql.go
@@ -3,11 +3,8 @@ package config
type Mssql struct {
GeneralDB `yaml:",inline" mapstructure:",squash"`
}
-//dsn := "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm"
+
+// Dsn "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm"
func (m *Mssql) Dsn() string {
return "sqlserver://" + m.Username + ":" + m.Password + "@" + m.Path + ":" + m.Port + "?database=" + m.Dbname + "&encrypt=disable"
}
-
-func (m *Mssql) GetLogMode() string {
- return m.LogMode
-}
diff --git a/server/config/gorm_mysql.go b/server/config/gorm_mysql.go
index 86911f37e..77e024539 100644
--- a/server/config/gorm_mysql.go
+++ b/server/config/gorm_mysql.go
@@ -7,7 +7,3 @@ type Mysql struct {
func (m *Mysql) Dsn() string {
return m.Username + ":" + m.Password + "@tcp(" + m.Path + ":" + m.Port + ")/" + m.Dbname + "?" + m.Config
}
-
-func (m *Mysql) GetLogMode() string {
- return m.LogMode
-}
diff --git a/server/config/gorm_oracle.go b/server/config/gorm_oracle.go
index 44f9051c8..1bbeb46ab 100644
--- a/server/config/gorm_oracle.go
+++ b/server/config/gorm_oracle.go
@@ -8,7 +8,3 @@ func (m *Oracle) Dsn() string {
return "oracle://" + m.Username + ":" + m.Password + "@" + m.Path + ":" + m.Port + "/" + m.Dbname + "?" + m.Config
}
-
-func (m *Oracle) GetLogMode() string {
- return m.LogMode
-}
diff --git a/server/config/gorm_pgsql.go b/server/config/gorm_pgsql.go
index 17c5f5e95..29fe03f43 100644
--- a/server/config/gorm_pgsql.go
+++ b/server/config/gorm_pgsql.go
@@ -15,7 +15,3 @@ func (p *Pgsql) Dsn() string {
func (p *Pgsql) LinkDsn(dbname string) string {
return "host=" + p.Path + " user=" + p.Username + " password=" + p.Password + " dbname=" + dbname + " port=" + p.Port + " " + p.Config
}
-
-func (m *Pgsql) GetLogMode() string {
- return m.LogMode
-}
diff --git a/server/config/gorm_sqlite.go b/server/config/gorm_sqlite.go
index 5eebcae40..46f2e19a5 100644
--- a/server/config/gorm_sqlite.go
+++ b/server/config/gorm_sqlite.go
@@ -11,7 +11,3 @@ type Sqlite struct {
func (s *Sqlite) Dsn() string {
return filepath.Join(s.Path, s.Dbname+".db")
}
-
-func (s *Sqlite) GetLogMode() string {
- return s.LogMode
-}
diff --git a/server/config/mongo.go b/server/config/mongo.go
new file mode 100644
index 000000000..2034a3fb4
--- /dev/null
+++ b/server/config/mongo.go
@@ -0,0 +1,41 @@
+package config
+
+import (
+ "fmt"
+ "strings"
+)
+
+type Mongo struct {
+ Coll string `json:"coll" yaml:"coll" mapstructure:"coll"` // collection name
+ Options string `json:"options" yaml:"options" mapstructure:"options"` // mongodb options
+ Database string `json:"database" yaml:"database" mapstructure:"database"` // database name
+ Username string `json:"username" yaml:"username" mapstructure:"username"` // 用户名
+ Password string `json:"password" yaml:"password" mapstructure:"password"` // 密码
+ AuthSource string `json:"auth-source" yaml:"auth-source" mapstructure:"auth-source"` // 验证数据库
+ MinPoolSize uint64 `json:"min-pool-size" yaml:"min-pool-size" mapstructure:"min-pool-size"` // 最小连接池
+ MaxPoolSize uint64 `json:"max-pool-size" yaml:"max-pool-size" mapstructure:"max-pool-size"` // 最大连接池
+ SocketTimeoutMs int64 `json:"socket-timeout-ms" yaml:"socket-timeout-ms" mapstructure:"socket-timeout-ms"` // socket超时时间
+ ConnectTimeoutMs int64 `json:"connect-timeout-ms" yaml:"connect-timeout-ms" mapstructure:"connect-timeout-ms"` // 连接超时时间
+ IsZap bool `json:"is-zap" yaml:"is-zap" mapstructure:"is-zap"` // 是否开启zap日志
+ Hosts []*MongoHost `json:"hosts" yaml:"hosts" mapstructure:"hosts"` // 主机列表
+}
+
+type MongoHost struct {
+ Host string `json:"host" yaml:"host" mapstructure:"host"` // ip地址
+ Port string `json:"port" yaml:"port" mapstructure:"port"` // 端口
+}
+
+// Uri .
+func (x *Mongo) Uri() string {
+ length := len(x.Hosts)
+ hosts := make([]string, 0, length)
+ for i := 0; i < length; i++ {
+ if x.Hosts[i].Host != "" && x.Hosts[i].Port != "" {
+ hosts = append(hosts, x.Hosts[i].Host+":"+x.Hosts[i].Port)
+ }
+ }
+ if x.Options != "" {
+ return fmt.Sprintf("mongodb://%s/%s?%s", strings.Join(hosts, ","), x.Database, x.Options)
+ }
+ return fmt.Sprintf("mongodb://%s/%s", strings.Join(hosts, ","), x.Database)
+}
diff --git a/server/config/oss_cloudflare.go b/server/config/oss_cloudflare.go
new file mode 100644
index 000000000..ab7a393dd
--- /dev/null
+++ b/server/config/oss_cloudflare.go
@@ -0,0 +1,10 @@
+package config
+
+type CloudflareR2 struct {
+ Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
+ BaseURL string `mapstructure:"base-url" json:"base-url" yaml:"base-url"`
+ Path string `mapstructure:"path" json:"path" yaml:"path"`
+ AccountID string `mapstructure:"account-id" json:"account-id" yaml:"account-id"`
+ AccessKeyID string `mapstructure:"access-key-id" json:"access-key-id" yaml:"access-key-id"`
+ SecretAccessKey string `mapstructure:"secret-access-key" json:"secret-access-key" yaml:"secret-access-key"`
+}
diff --git a/server/config/redis.go b/server/config/redis.go
index 60dbb1ee3..33c0ccbbb 100644
--- a/server/config/redis.go
+++ b/server/config/redis.go
@@ -1,7 +1,9 @@
package config
type Redis struct {
- Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // 服务器地址:端口
- Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码
- DB int `mapstructure:"db" json:"db" yaml:"db"` // redis的哪个数据库
+ Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // 服务器地址:端口
+ Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码
+ DB int `mapstructure:"db" json:"db" yaml:"db"` // 单实例模式下redis的哪个数据库
+ UseCluster bool `mapstructure:"useCluster" json:"useCluster" yaml:"useCluster"` // 是否使用集群模式
+ ClusterAddrs []string `mapstructure:"clusterAddrs" json:"clusterAddrs" yaml:"clusterAddrs"` // 集群模式下的节点地址列表
}
diff --git a/server/config/system.go b/server/config/system.go
index bb1cfceb4..398bf789b 100644
--- a/server/config/system.go
+++ b/server/config/system.go
@@ -1,7 +1,6 @@
package config
type System struct {
- Env string `mapstructure:"env" json:"env" yaml:"env"` // 环境值
DbType string `mapstructure:"db-type" json:"db-type" yaml:"db-type"` // 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql
OssType string `mapstructure:"oss-type" json:"oss-type" yaml:"oss-type"` // Oss类型
RouterPrefix string `mapstructure:"router-prefix" json:"router-prefix" yaml:"router-prefix"`
@@ -10,4 +9,5 @@ type System struct {
LimitTimeIP int `mapstructure:"iplimit-time" json:"iplimit-time" yaml:"iplimit-time"`
UseMultipoint bool `mapstructure:"use-multipoint" json:"use-multipoint" yaml:"use-multipoint"` // 多点登录拦截
UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis"` // 使用redis
+ UseMongo bool `mapstructure:"use-mongo" json:"use-mongo" yaml:"use-mongo"` // 使用mongo
}
diff --git a/server/config/timer.go b/server/config/timer.go
deleted file mode 100644
index 5057e50e6..000000000
--- a/server/config/timer.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package config
-
-type Timer struct {
- Spec string `mapstructure:"spec" json:"spec" yaml:"spec"` // CRON表达式
- Detail []Detail `mapstructure:"detail" json:"detail" yaml:"detail"`
- Start bool `mapstructure:"start" json:"start" yaml:"start"` // 是否启用
- WithSeconds bool `mapstructure:"with_seconds" json:"with_seconds" yaml:"with_seconds"` // 是否精确到秒
-
-}
-
-type Detail struct {
- TableName string `mapstructure:"tableName" json:"tableName" yaml:"tableName"` // 需要清理的表名
- CompareField string `mapstructure:"compareField" json:"compareField" yaml:"compareField"` // 需要比较时间的字段
- Interval string `mapstructure:"interval" json:"interval" yaml:"interval"` // 时间间隔
-}
diff --git a/server/config/zap.go b/server/config/zap.go
index 287221971..0e8ae2b29 100644
--- a/server/config/zap.go
+++ b/server/config/zap.go
@@ -2,7 +2,7 @@ package config
import (
"go.uber.org/zap/zapcore"
- "strings"
+ "time"
)
type Zap struct {
@@ -12,49 +12,60 @@ type Zap struct {
Director string `mapstructure:"director" json:"director" yaml:"director"` // 日志文件夹
EncodeLevel string `mapstructure:"encode-level" json:"encode-level" yaml:"encode-level"` // 编码级
StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktrace-key" yaml:"stacktrace-key"` // 栈名
-
- MaxAge int `mapstructure:"max-age" json:"max-age" yaml:"max-age"` // 日志留存时间
- ShowLine bool `mapstructure:"show-line" json:"show-line" yaml:"show-line"` // 显示行
- LogInConsole bool `mapstructure:"log-in-console" json:"log-in-console" yaml:"log-in-console"` // 输出控制台
+ ShowLine bool `mapstructure:"show-line" json:"show-line" yaml:"show-line"` // 显示行
+ LogInConsole bool `mapstructure:"log-in-console" json:"log-in-console" yaml:"log-in-console"` // 输出控制台
+ RetentionDay int `mapstructure:"retention-day" json:"retention-day" yaml:"retention-day"` // 日志保留天数
}
-// ZapEncodeLevel 根据 EncodeLevel 返回 zapcore.LevelEncoder
+// Levels 根据字符串转化为 zapcore.Levels
+func (c *Zap) Levels() []zapcore.Level {
+ levels := make([]zapcore.Level, 0, 7)
+ level, err := zapcore.ParseLevel(c.Level)
+ if err != nil {
+ level = zapcore.DebugLevel
+ }
+ for ; level <= zapcore.FatalLevel; level++ {
+ levels = append(levels, level)
+ }
+ return levels
+}
+
+func (c *Zap) Encoder() zapcore.Encoder {
+ config := zapcore.EncoderConfig{
+ TimeKey: "time",
+ NameKey: "name",
+ LevelKey: "level",
+ CallerKey: "caller",
+ MessageKey: "message",
+ StacktraceKey: c.StacktraceKey,
+ LineEnding: zapcore.DefaultLineEnding,
+ EncodeTime: func(t time.Time, encoder zapcore.PrimitiveArrayEncoder) {
+ encoder.AppendString(c.Prefix + t.Format("2006-01-02 15:04:05.000"))
+ },
+ EncodeLevel: c.LevelEncoder(),
+ EncodeCaller: zapcore.FullCallerEncoder,
+ EncodeDuration: zapcore.SecondsDurationEncoder,
+ }
+ if c.Format == "json" {
+ return zapcore.NewJSONEncoder(config)
+ }
+ return zapcore.NewConsoleEncoder(config)
+
+}
+
+// LevelEncoder 根据 EncodeLevel 返回 zapcore.LevelEncoder
// Author [SliverHorn](https://github.com/SliverHorn)
-func (z *Zap) ZapEncodeLevel() zapcore.LevelEncoder {
+func (c *Zap) LevelEncoder() zapcore.LevelEncoder {
switch {
- case z.EncodeLevel == "LowercaseLevelEncoder": // 小写编码器(默认)
+ case c.EncodeLevel == "LowercaseLevelEncoder": // 小写编码器(默认)
return zapcore.LowercaseLevelEncoder
- case z.EncodeLevel == "LowercaseColorLevelEncoder": // 小写编码器带颜色
+ case c.EncodeLevel == "LowercaseColorLevelEncoder": // 小写编码器带颜色
return zapcore.LowercaseColorLevelEncoder
- case z.EncodeLevel == "CapitalLevelEncoder": // 大写编码器
+ case c.EncodeLevel == "CapitalLevelEncoder": // 大写编码器
return zapcore.CapitalLevelEncoder
- case z.EncodeLevel == "CapitalColorLevelEncoder": // 大写编码器带颜色
+ case c.EncodeLevel == "CapitalColorLevelEncoder": // 大写编码器带颜色
return zapcore.CapitalColorLevelEncoder
default:
return zapcore.LowercaseLevelEncoder
}
}
-
-// TransportLevel 根据字符串转化为 zapcore.Level
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (z *Zap) TransportLevel() zapcore.Level {
- z.Level = strings.ToLower(z.Level)
- switch z.Level {
- case "debug":
- return zapcore.DebugLevel
- case "info":
- return zapcore.InfoLevel
- case "warn":
- return zapcore.WarnLevel
- case "error":
- return zapcore.WarnLevel
- case "dpanic":
- return zapcore.DPanicLevel
- case "panic":
- return zapcore.PanicLevel
- case "fatal":
- return zapcore.FatalLevel
- default:
- return zapcore.DebugLevel
- }
-}
diff --git a/server/core/internal/cutter.go b/server/core/internal/cutter.go
new file mode 100644
index 000000000..e053af6e5
--- /dev/null
+++ b/server/core/internal/cutter.go
@@ -0,0 +1,121 @@
+package internal
+
+import (
+ "os"
+ "path/filepath"
+ "sync"
+ "time"
+)
+
+// Cutter 实现 io.Writer 接口
+// 用于日志切割, strings.Join([]string{director,layout, formats..., level+".log"}, os.PathSeparator)
+type Cutter struct {
+ level string // 日志级别(debug, info, warn, error, dpanic, panic, fatal)
+ layout string // 时间格式 2006-01-02 15:04:05
+ formats []string // 自定义参数([]string{Director,"2006-01-02", "business"(此参数可不写), level+".log"}
+ director string // 日志文件夹
+ retentionDay int //日志保留天数
+ file *os.File // 文件句柄
+ mutex *sync.RWMutex // 读写锁
+}
+
+type CutterOption func(*Cutter)
+
+// CutterWithLayout 时间格式
+func CutterWithLayout(layout string) CutterOption {
+ return func(c *Cutter) {
+ c.layout = layout
+ }
+}
+
+// CutterWithFormats 格式化参数
+func CutterWithFormats(format ...string) CutterOption {
+ return func(c *Cutter) {
+ if len(format) > 0 {
+ c.formats = format
+ }
+ }
+}
+
+func NewCutter(director string, level string, retentionDay int, options ...CutterOption) *Cutter {
+ rotate := &Cutter{
+ level: level,
+ director: director,
+ retentionDay: retentionDay,
+ mutex: new(sync.RWMutex),
+ }
+ for i := 0; i < len(options); i++ {
+ options[i](rotate)
+ }
+ return rotate
+}
+
+// Write satisfies the io.Writer interface. It writes to the
+// appropriate file handle that is currently being used.
+// If we have reached rotation time, the target file gets
+// automatically rotated, and also purged if necessary.
+func (c *Cutter) Write(bytes []byte) (n int, err error) {
+ c.mutex.Lock()
+ defer func() {
+ if c.file != nil {
+ _ = c.file.Close()
+ c.file = nil
+ }
+ c.mutex.Unlock()
+ }()
+ length := len(c.formats)
+ values := make([]string, 0, 3+length)
+ values = append(values, c.director)
+ if c.layout != "" {
+ values = append(values, time.Now().Format(c.layout))
+ }
+ for i := 0; i < length; i++ {
+ values = append(values, c.formats[i])
+ }
+ values = append(values, c.level+".log")
+ filename := filepath.Join(values...)
+ director := filepath.Dir(filename)
+ err = os.MkdirAll(director, os.ModePerm)
+ if err != nil {
+ return 0, err
+ }
+ err = removeNDaysFolders(c.director, c.retentionDay)
+ if err != nil {
+ return 0, err
+ }
+ c.file, err = os.OpenFile(filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
+ if err != nil {
+ return 0, err
+ }
+ return c.file.Write(bytes)
+}
+
+func (c *Cutter) Sync() error {
+ c.mutex.Lock()
+ defer c.mutex.Unlock()
+
+ if c.file != nil {
+ return c.file.Sync()
+ }
+ return nil
+}
+
+// 增加日志目录文件清理 小于等于零的值默认忽略不再处理
+func removeNDaysFolders(dir string, days int) error {
+ if days <= 0 {
+ return nil
+ }
+ cutoff := time.Now().AddDate(0, 0, -days)
+ return filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ return err
+ }
+ if info.IsDir() && info.ModTime().Before(cutoff) && path != dir {
+ err = os.RemoveAll(path)
+ if err != nil {
+ return err
+ }
+ }
+ return nil
+ })
+}
diff --git a/server/core/internal/file_rotatelogs.go b/server/core/internal/file_rotatelogs.go
deleted file mode 100644
index cde97b98a..000000000
--- a/server/core/internal/file_rotatelogs.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package internal
-
-import (
- "github.com/flipped-aurora/gin-vue-admin/server/global"
- rotatelogs "github.com/lestrrat-go/file-rotatelogs"
- "go.uber.org/zap/zapcore"
- "os"
- "path"
- "time"
-)
-
-var FileRotatelogs = new(fileRotatelogs)
-
-type fileRotatelogs struct{}
-
-// GetWriteSyncer 获取 zapcore.WriteSyncer
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (r *fileRotatelogs) GetWriteSyncer(level string) (zapcore.WriteSyncer, error) {
- fileWriter, err := rotatelogs.New(
- path.Join(global.GVA_CONFIG.Zap.Director, "%Y-%m-%d", level+".log"),
- rotatelogs.WithClock(rotatelogs.Local),
- rotatelogs.WithMaxAge(time.Duration(global.GVA_CONFIG.Zap.MaxAge)*24*time.Hour), // 日志留存时间
- rotatelogs.WithRotationTime(time.Hour*24),
- )
- if global.GVA_CONFIG.Zap.LogInConsole {
- return zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), zapcore.AddSync(fileWriter)), err
- }
- return zapcore.AddSync(fileWriter), err
-}
diff --git a/server/core/internal/zap.go b/server/core/internal/zap.go
deleted file mode 100644
index 9cfa55f4b..000000000
--- a/server/core/internal/zap.go
+++ /dev/null
@@ -1,107 +0,0 @@
-package internal
-
-import (
- "fmt"
- "github.com/flipped-aurora/gin-vue-admin/server/global"
- "go.uber.org/zap"
- "go.uber.org/zap/zapcore"
- "time"
-)
-
-var Zap = new(_zap)
-
-type _zap struct{}
-
-// GetEncoder 获取 zapcore.Encoder
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (z *_zap) GetEncoder() zapcore.Encoder {
- if global.GVA_CONFIG.Zap.Format == "json" {
- return zapcore.NewJSONEncoder(z.GetEncoderConfig())
- }
- return zapcore.NewConsoleEncoder(z.GetEncoderConfig())
-}
-
-// GetEncoderConfig 获取zapcore.EncoderConfig
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (z *_zap) GetEncoderConfig() zapcore.EncoderConfig {
- return zapcore.EncoderConfig{
- MessageKey: "message",
- LevelKey: "level",
- TimeKey: "time",
- NameKey: "logger",
- CallerKey: "caller",
- StacktraceKey: global.GVA_CONFIG.Zap.StacktraceKey,
- LineEnding: zapcore.DefaultLineEnding,
- EncodeLevel: global.GVA_CONFIG.Zap.ZapEncodeLevel(),
- EncodeTime: z.CustomTimeEncoder,
- EncodeDuration: zapcore.SecondsDurationEncoder,
- EncodeCaller: zapcore.FullCallerEncoder,
- }
-}
-
-// GetEncoderCore 获取Encoder的 zapcore.Core
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (z *_zap) GetEncoderCore(l zapcore.Level, level zap.LevelEnablerFunc) zapcore.Core {
- writer, err := FileRotatelogs.GetWriteSyncer(l.String()) // 使用file-rotatelogs进行日志分割
- if err != nil {
- fmt.Printf("Get Write Syncer Failed err:%v", err.Error())
- return nil
- }
-
- return zapcore.NewCore(z.GetEncoder(), writer, level)
-}
-
-// CustomTimeEncoder 自定义日志输出时间格式
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (z *_zap) CustomTimeEncoder(t time.Time, encoder zapcore.PrimitiveArrayEncoder) {
- encoder.AppendString(global.GVA_CONFIG.Zap.Prefix + t.Format("2006/01/02 - 15:04:05.000"))
-}
-
-// GetZapCores 根据配置文件的Level获取 []zapcore.Core
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (z *_zap) GetZapCores() []zapcore.Core {
- cores := make([]zapcore.Core, 0, 7)
- for level := global.GVA_CONFIG.Zap.TransportLevel(); level <= zapcore.FatalLevel; level++ {
- cores = append(cores, z.GetEncoderCore(level, z.GetLevelPriority(level)))
- }
- return cores
-}
-
-// GetLevelPriority 根据 zapcore.Level 获取 zap.LevelEnablerFunc
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (z *_zap) GetLevelPriority(level zapcore.Level) zap.LevelEnablerFunc {
- switch level {
- case zapcore.DebugLevel:
- return func(level zapcore.Level) bool { // 调试级别
- return level == zap.DebugLevel
- }
- case zapcore.InfoLevel:
- return func(level zapcore.Level) bool { // 日志级别
- return level == zap.InfoLevel
- }
- case zapcore.WarnLevel:
- return func(level zapcore.Level) bool { // 警告级别
- return level == zap.WarnLevel
- }
- case zapcore.ErrorLevel:
- return func(level zapcore.Level) bool { // 错误级别
- return level == zap.ErrorLevel
- }
- case zapcore.DPanicLevel:
- return func(level zapcore.Level) bool { // dpanic级别
- return level == zap.DPanicLevel
- }
- case zapcore.PanicLevel:
- return func(level zapcore.Level) bool { // panic级别
- return level == zap.PanicLevel
- }
- case zapcore.FatalLevel:
- return func(level zapcore.Level) bool { // 终止级别
- return level == zap.FatalLevel
- }
- default:
- return func(level zapcore.Level) bool { // 调试级别
- return level == zap.DebugLevel
- }
- }
-}
diff --git a/server/core/internal/zap_core.go b/server/core/internal/zap_core.go
new file mode 100644
index 000000000..4648e60cb
--- /dev/null
+++ b/server/core/internal/zap_core.go
@@ -0,0 +1,68 @@
+package internal
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "go.uber.org/zap"
+ "go.uber.org/zap/zapcore"
+ "os"
+ "time"
+)
+
+type ZapCore struct {
+ level zapcore.Level
+ zapcore.Core
+}
+
+func NewZapCore(level zapcore.Level) *ZapCore {
+ entity := &ZapCore{level: level}
+ syncer := entity.WriteSyncer()
+ levelEnabler := zap.LevelEnablerFunc(func(l zapcore.Level) bool {
+ return l == level
+ })
+ entity.Core = zapcore.NewCore(global.GVA_CONFIG.Zap.Encoder(), syncer, levelEnabler)
+ return entity
+}
+
+func (z *ZapCore) WriteSyncer(formats ...string) zapcore.WriteSyncer {
+ cutter := NewCutter(
+ global.GVA_CONFIG.Zap.Director,
+ z.level.String(),
+ global.GVA_CONFIG.Zap.RetentionDay,
+ CutterWithLayout(time.DateOnly),
+ CutterWithFormats(formats...),
+ )
+ if global.GVA_CONFIG.Zap.LogInConsole {
+ multiSyncer := zapcore.NewMultiWriteSyncer(os.Stdout, cutter)
+ return zapcore.AddSync(multiSyncer)
+ }
+ return zapcore.AddSync(cutter)
+}
+
+func (z *ZapCore) Enabled(level zapcore.Level) bool {
+ return z.level == level
+}
+
+func (z *ZapCore) With(fields []zapcore.Field) zapcore.Core {
+ return z.Core.With(fields)
+}
+
+func (z *ZapCore) Check(entry zapcore.Entry, check *zapcore.CheckedEntry) *zapcore.CheckedEntry {
+ if z.Enabled(entry.Level) {
+ return check.AddCore(entry, z)
+ }
+ return check
+}
+
+func (z *ZapCore) Write(entry zapcore.Entry, fields []zapcore.Field) error {
+ for i := 0; i < len(fields); i++ {
+ if fields[i].Key == "business" || fields[i].Key == "folder" || fields[i].Key == "directory" {
+ syncer := z.WriteSyncer(fields[i].String)
+ z.Core = zapcore.NewCore(global.GVA_CONFIG.Zap.Encoder(), syncer, z.level)
+ }
+ }
+ return z.Core.Write(entry, fields)
+}
+
+func (z *ZapCore) Sync() error {
+ return z.Core.Sync()
+}
diff --git a/server/core/server.go b/server/core/server.go
index 1a84f7515..e8561d47a 100644
--- a/server/core/server.go
+++ b/server/core/server.go
@@ -2,7 +2,6 @@ package core
import (
"fmt"
- "time"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/initialize"
@@ -19,7 +18,12 @@ func RunWindowsServer() {
// 初始化redis服务
initialize.Redis()
}
-
+ if global.GVA_CONFIG.System.UseMongo {
+ err := initialize.Mongo.Initialization()
+ if err != nil {
+ zap.L().Error(fmt.Sprintf("%+v", err))
+ }
+ }
// 从db加载jwt数据
if global.GVA_DB != nil {
system.LoadAll()
@@ -30,21 +34,25 @@ func RunWindowsServer() {
address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
s := initServer(address, Router)
- // 保证文本顺序输出
- // In order to ensure that the text order output can be deleted
- time.Sleep(10 * time.Microsecond)
+
global.GVA_LOG.Info("server run success on ", zap.String("address", address))
fmt.Printf(`
%s gin-vue-admin
- %s: v2.5.7
- 加群方式:微信号:shouzi_1994 QQ群:622360840
+ %s:v2.7.0
+ 加群方式:微信号:shouzi_1994 QQ群:470239250
+ 项目地址:https://github.com/flipped-aurora/gin-vue-admin
插件市场:https://plugin.gin-vue-admin.com
GVA讨论社区:https://support.qq.com/products/371961
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:8080
- 如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/coffee/index.html`,
+ --------------------------------------版权声明--------------------------------------
+ ** 版权所有方:flipped-aurora开源团队 **
+ ** 版权持有公司:北京翻转极光科技有限责任公司 **
+ ** 剔除授权标识需购买商用授权:https://gin-vue-admin.com/empower/index.html **
+`,
global.Translate("core.server.welcomeTo"),
- global.Translate("core.server.currentVersion"), address)
+ global.Translate("core.server.currentVersion"),
+ address)
global.GVA_LOG.Error(s.ListenAndServe().Error())
}
diff --git a/server/core/server_other.go b/server/core/server_other.go
index b95e90116..83645fced 100644
--- a/server/core/server_other.go
+++ b/server/core/server_other.go
@@ -12,8 +12,8 @@ import (
func initServer(address string, router *gin.Engine) server {
s := endless.NewServer(address, router)
- s.ReadHeaderTimeout = 20 * time.Second
- s.WriteTimeout = 20 * time.Second
+ s.ReadHeaderTimeout = 10 * time.Minute
+ s.WriteTimeout = 10 * time.Minute
s.MaxHeaderBytes = 1 << 20
return s
}
diff --git a/server/core/viper.go b/server/core/viper.go
index 3f67f9633..1d0bd705f 100644
--- a/server/core/viper.go
+++ b/server/core/viper.go
@@ -29,14 +29,12 @@ func Viper(path ...string) *viper.Viper {
switch gin.Mode() {
case gin.DebugMode:
config = internal.ConfigDefaultFile
- fmt.Printf("您正在使用gin模式的%s环境名称,config的路径为%s\n", gin.EnvGinMode, internal.ConfigDefaultFile)
case gin.ReleaseMode:
config = internal.ConfigReleaseFile
- fmt.Printf("您正在使用gin模式的%s环境名称,config的路径为%s\n", gin.EnvGinMode, internal.ConfigReleaseFile)
case gin.TestMode:
config = internal.ConfigTestFile
- fmt.Printf("您正在使用gin模式的%s环境名称,config的路径为%s\n", gin.EnvGinMode, internal.ConfigTestFile)
}
+ fmt.Printf("您正在使用gin模式的%s环境名称,config的路径为%s\n", gin.Mode(), config)
} else { // internal.ConfigEnv 常量存储的环境变量不为空 将值赋值于config
config = configEnv
fmt.Printf("您正在使用%s环境变量,config的路径为%s\n", internal.ConfigEnv, config)
@@ -65,7 +63,7 @@ func Viper(path ...string) *viper.Viper {
}
})
if err = v.Unmarshal(&global.GVA_CONFIG); err != nil {
- fmt.Println(err)
+ panic(err)
}
// root 适配性 根据root位置去找到对应迁移位置,保证root路径有效
diff --git a/server/core/zap.go b/server/core/zap.go
index 780119476..d7e08a44a 100644
--- a/server/core/zap.go
+++ b/server/core/zap.go
@@ -17,10 +17,14 @@ func Zap() (logger *zap.Logger) {
fmt.Printf("create %v directory\n", global.GVA_CONFIG.Zap.Director)
_ = os.Mkdir(global.GVA_CONFIG.Zap.Director, os.ModePerm)
}
-
- cores := internal.Zap.GetZapCores()
+ levels := global.GVA_CONFIG.Zap.Levels()
+ length := len(levels)
+ cores := make([]zapcore.Core, 0, length)
+ for i := 0; i < length; i++ {
+ core := internal.NewZapCore(levels[i])
+ cores = append(cores, core)
+ }
logger = zap.New(zapcore.NewTee(cores...))
-
if global.GVA_CONFIG.Zap.ShowLine {
logger = logger.WithOptions(zap.AddCaller())
}
diff --git a/server/docs/docs.go b/server/docs/docs.go
index b119fe18b..232540981 100644
--- a/server/docs/docs.go
+++ b/server/docs/docs.go
@@ -1,5 +1,4 @@
-// Code generated by swaggo/swag. DO NOT EDIT.
-
+// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
@@ -166,6 +165,45 @@ const docTemplate = `{
}
}
},
+ "/api/enterSyncApi": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysApi"
+ ],
+ "summary": "确认同步API",
+ "responses": {
+ "200": {
+ "description": "确认同步API",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/api/freshCasbin": {
"get": {
"consumes": [
@@ -292,6 +330,45 @@ const docTemplate = `{
}
}
},
+ "/api/getApiGroups": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysApi"
+ ],
+ "summary": "获取API分组",
+ "responses": {
+ "200": {
+ "description": "获取API分组",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/api/getApiList": {
"post": {
"security": [
@@ -345,6 +422,84 @@ const docTemplate = `{
}
}
},
+ "/api/ignoreApi": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IgnoreApi"
+ ],
+ "summary": "忽略API",
+ "responses": {
+ "200": {
+ "description": "同步API",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/syncApi": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysApi"
+ ],
+ "summary": "同步API",
+ "responses": {
+ "200": {
+ "description": "同步API",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/api/updateApi": {
"post": {
"security": [
@@ -849,6 +1004,44 @@ const docTemplate = `{
}
}
},
+ "/autoCode/addFunc": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "AddFunc"
+ ],
+ "summary": "增加方法",
+ "parameters": [
+ {
+ "description": "增加方法",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.AutoCode"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
"/autoCode/createPackage": {
"post": {
"security": [
@@ -863,7 +1056,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "AutoCode"
+ "AutoCodePackage"
],
"summary": "创建package",
"parameters": [
@@ -873,7 +1066,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/system.SysAutoCode"
+ "$ref": "#/definitions/request.SysAutoCodePackageCreate"
}
}
],
@@ -903,60 +1096,6 @@ const docTemplate = `{
}
}
},
- "/autoCode/createPlug": {
- "post": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
- "consumes": [
- "multipart/form-data"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "AutoCode"
- ],
- "summary": "安装插件",
- "parameters": [
- {
- "type": "file",
- "description": "this is a test file",
- "name": "plug",
- "in": "formData",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "安装插件成功",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/response.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "type": "object"
- }
- },
- "msg": {
- "type": "string"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
"/autoCode/createTemp": {
"post": {
"security": [
@@ -971,7 +1110,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "AutoCode"
+ "AutoCodeTemplate"
],
"summary": "自动代码模板",
"parameters": [
@@ -981,7 +1120,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/system.AutoCodeStruct"
+ "$ref": "#/definitions/request.AutoCode"
}
}
],
@@ -1019,7 +1158,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/system.SysAutoCode"
+ "$ref": "#/definitions/request.GetById"
}
}
],
@@ -1253,7 +1392,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "AutoCode"
+ "AutoCodePackage"
],
"summary": "获取package",
"responses": {
@@ -1306,7 +1445,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/request.SysAutoHistory"
+ "$ref": "#/definitions/request.PageInfo"
}
}
],
@@ -1378,6 +1517,103 @@ const docTemplate = `{
}
}
},
+ "/autoCode/getTemplates": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "AutoCodePackage"
+ ],
+ "summary": "获取package",
+ "responses": {
+ "200": {
+ "description": "创建package成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/autoCode/installPlugin": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "AutoCodePlugin"
+ ],
+ "summary": "安装插件",
+ "parameters": [
+ {
+ "type": "file",
+ "description": "this is a test file",
+ "name": "plug",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "安装插件成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ }
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/autoCode/preview": {
"post": {
"security": [
@@ -1392,7 +1628,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "AutoCode"
+ "AutoCodeTemplate"
],
"summary": "预览创建后的代码",
"parameters": [
@@ -1402,7 +1638,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/system.AutoCodeStruct"
+ "$ref": "#/definitions/request.AutoCode"
}
}
],
@@ -1432,6 +1668,58 @@ const docTemplate = `{
}
}
},
+ "/autoCode/pubPlug": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "AutoCodePlugin"
+ ],
+ "summary": "打包插件",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "插件名称",
+ "name": "plugName",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "打包插件成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/autoCode/rollback": {
"post": {
"security": [
@@ -1456,7 +1744,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/request.RollBack"
+ "$ref": "#/definitions/request.SysAutoHistoryRollBack"
}
}
],
@@ -1690,6 +1978,12 @@ const docTemplate = `{
],
"summary": "获取单一客户信息",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "创建时间",
@@ -1708,12 +2002,6 @@ const docTemplate = `{
"name": "customerPhoneData",
"in": "query"
},
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
{
"type": "integer",
"description": "管理角色ID",
@@ -2321,6 +2609,451 @@ const docTemplate = `{
}
}
},
+ "/info/createInfo": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "创建公告",
+ "parameters": [
+ {
+ "description": "创建公告",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/model.Info"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "创建成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/deleteInfo": {
+ "delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "删除公告",
+ "parameters": [
+ {
+ "description": "删除公告",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/model.Info"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/deleteInfoByIds": {
+ "delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "批量删除公告",
+ "responses": {
+ "200": {
+ "description": "批量删除成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/findInfo": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "用id查询公告",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "内容",
+ "name": "content",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "创建时间",
+ "name": "createdAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "标题",
+ "name": "title",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "更新时间",
+ "name": "updatedAt",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "作者",
+ "name": "userID",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "查询成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/model.Info"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/getInfoDataSource": {
+ "get": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "获取Info的数据源",
+ "responses": {
+ "200": {
+ "description": "查询成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/getInfoList": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "分页获取公告列表",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "endCreatedAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键字",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页大小",
+ "name": "pageSize",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "startCreatedAt",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "获取成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/response.PageResult"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/getInfoPublic": {
+ "get": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "不需要鉴权的公告接口",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "endCreatedAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键字",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页大小",
+ "name": "pageSize",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "startCreatedAt",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "获取成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/updateInfo": {
+ "put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "更新公告",
+ "parameters": [
+ {
+ "description": "更新公告",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/model.Info"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/init/checkdb": {
"post": {
"produces": [
@@ -3015,6 +3748,12 @@ const docTemplate = `{
],
"summary": "用id查询SysDictionary",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "创建时间",
@@ -3027,12 +3766,6 @@ const docTemplate = `{
"name": "desc",
"in": "query"
},
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
{
"type": "string",
"description": "字典名(中)",
@@ -3101,68 +3834,6 @@ const docTemplate = `{
"SysDictionary"
],
"summary": "分页获取SysDictionary列表",
- "parameters": [
- {
- "type": "string",
- "description": "创建时间",
- "name": "createdAt",
- "in": "query"
- },
- {
- "type": "string",
- "description": "描述",
- "name": "desc",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键字",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "string",
- "description": "字典名(中)",
- "name": "name",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页大小",
- "name": "pageSize",
- "in": "query"
- },
- {
- "type": "boolean",
- "description": "状态",
- "name": "status",
- "in": "query"
- },
- {
- "type": "string",
- "description": "字典名(英)",
- "name": "type",
- "in": "query"
- },
- {
- "type": "string",
- "description": "更新时间",
- "name": "updatedAt",
- "in": "query"
- }
- ],
"responses": {
"200": {
"description": "分页获取SysDictionary列表,返回包括列表,总数,页码,每页数量",
@@ -3356,6 +4027,12 @@ const docTemplate = `{
],
"summary": "用id查询SysDictionaryDetail",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "创建时间",
@@ -3363,9 +4040,9 @@ const docTemplate = `{
"in": "query"
},
{
- "type": "integer",
- "description": "主键ID",
- "name": "id",
+ "type": "string",
+ "description": "扩展值",
+ "name": "extend",
"in": "query"
},
{
@@ -3399,7 +4076,7 @@ const docTemplate = `{
"in": "query"
},
{
- "type": "integer",
+ "type": "string",
"description": "字典值",
"name": "value",
"in": "query"
@@ -3449,6 +4126,12 @@ const docTemplate = `{
],
"summary": "分页获取SysDictionaryDetail列表",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "创建时间",
@@ -3456,9 +4139,9 @@ const docTemplate = `{
"in": "query"
},
{
- "type": "integer",
- "description": "主键ID",
- "name": "id",
+ "type": "string",
+ "description": "扩展值",
+ "name": "extend",
"in": "query"
},
{
@@ -3510,7 +4193,7 @@ const docTemplate = `{
"in": "query"
},
{
- "type": "integer",
+ "type": "string",
"description": "字典值",
"name": "value",
"in": "query"
@@ -3591,6 +4274,400 @@ const docTemplate = `{
}
}
},
+ "/sysExportTemplate/createSysExportTemplate": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "创建导出模板",
+ "parameters": [
+ {
+ "description": "创建导出模板",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/system.SysExportTemplate"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/deleteSysExportTemplate": {
+ "delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "删除导出模板",
+ "parameters": [
+ {
+ "description": "删除导出模板",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/system.SysExportTemplate"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/deleteSysExportTemplateByIds": {
+ "delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "批量删除导出模板",
+ "parameters": [
+ {
+ "description": "批量删除导出模板",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.IdsReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/exportExcel": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "导出表格模板",
+ "responses": {}
+ }
+ },
+ "/sysExportTemplate/findSysExportTemplate": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "用id查询导出模板",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "创建时间",
+ "name": "createdAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "数据库名称",
+ "name": "dbName",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板名称",
+ "name": "name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "order",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "表名称",
+ "name": "tableName",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板标识",
+ "name": "templateID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板信息",
+ "name": "templateInfo",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "更新时间",
+ "name": "updatedAt",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/getSysExportTemplateList": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "分页获取导出模板列表",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "创建时间",
+ "name": "createdAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "数据库名称",
+ "name": "dbName",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "endCreatedAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键字",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板名称",
+ "name": "name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "order",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页大小",
+ "name": "pageSize",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "startCreatedAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "表名称",
+ "name": "tableName",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板标识",
+ "name": "templateID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板信息",
+ "name": "templateInfo",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "更新时间",
+ "name": "updatedAt",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/importExcel": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysImportTemplate"
+ ],
+ "summary": "导入表格",
+ "responses": {}
+ }
+ },
+ "/sysExportTemplate/updateSysExportTemplate": {
+ "put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "更新导出模板",
+ "parameters": [
+ {
+ "description": "更新导出模板",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/system.SysExportTemplate"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
"/sysOperationRecord/createSysOperationRecord": {
"post": {
"security": [
@@ -3759,6 +4836,12 @@ const docTemplate = `{
],
"summary": "用id查询SysOperationRecord",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "代理",
@@ -3783,12 +4866,6 @@ const docTemplate = `{
"name": "error_message",
"in": "query"
},
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
{
"type": "string",
"description": "请求ip",
@@ -3882,6 +4959,12 @@ const docTemplate = `{
],
"summary": "分页获取SysOperationRecord列表",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "代理",
@@ -3906,12 +4989,6 @@ const docTemplate = `{
"name": "error_message",
"in": "query"
},
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
{
"type": "string",
"description": "请求ip",
@@ -4687,47 +5764,20 @@ const docTemplate = `{
"config.Autocode": {
"type": "object",
"properties": {
+ "ai-path": {
+ "type": "string"
+ },
+ "module": {
+ "type": "string"
+ },
"root": {
"type": "string"
},
"server": {
"type": "string"
},
- "server-api": {
- "type": "string"
- },
- "server-initialize": {
- "type": "string"
- },
- "server-model": {
- "type": "string"
- },
- "server-plug": {
- "type": "string"
- },
- "server-request": {
- "type": "string"
- },
- "server-router": {
- "type": "string"
- },
- "server-service": {
- "type": "string"
- },
- "transfer-restart": {
- "type": "boolean"
- },
"web": {
"type": "string"
- },
- "web-api": {
- "type": "string"
- },
- "web-form": {
- "type": "string"
- },
- "web-table": {
- "type": "string"
}
}
},
@@ -4822,19 +5872,33 @@ const docTemplate = `{
}
}
},
- "config.Detail": {
+ "config.CloudflareR2": {
"type": "object",
"properties": {
- "compareField": {
- "description": "需要比较时间的字段",
+ "access-key-id": {
"type": "string"
},
- "interval": {
- "description": "时间间隔",
+ "account-id": {
"type": "string"
},
- "tableName": {
- "description": "需要清理的表名",
+ "base-url": {
+ "type": "string"
+ },
+ "bucket": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "secret-access-key": {
+ "type": "string"
+ }
+ }
+ },
+ "config.DiskList": {
+ "type": "object",
+ "properties": {
+ "mount-point": {
"type": "string"
}
}
@@ -4901,6 +5965,75 @@ const docTemplate = `{
}
}
},
+ "config.Mongo": {
+ "type": "object",
+ "properties": {
+ "auth-source": {
+ "description": "验证数据库",
+ "type": "string"
+ },
+ "coll": {
+ "description": "collection name",
+ "type": "string"
+ },
+ "connect-timeout-ms": {
+ "description": "连接超时时间",
+ "type": "integer"
+ },
+ "database": {
+ "description": "database name",
+ "type": "string"
+ },
+ "hosts": {
+ "description": "主机列表",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/config.MongoHost"
+ }
+ },
+ "is-zap": {
+ "description": "是否开启zap日志",
+ "type": "boolean"
+ },
+ "max-pool-size": {
+ "description": "最大连接池",
+ "type": "integer"
+ },
+ "min-pool-size": {
+ "description": "最小连接池",
+ "type": "integer"
+ },
+ "options": {
+ "description": "mongodb options",
+ "type": "string"
+ },
+ "password": {
+ "description": "密码",
+ "type": "string"
+ },
+ "socket-timeout-ms": {
+ "description": "socket超时时间",
+ "type": "integer"
+ },
+ "username": {
+ "description": "用户名",
+ "type": "string"
+ }
+ }
+ },
+ "config.MongoHost": {
+ "type": "object",
+ "properties": {
+ "host": {
+ "description": "ip地址",
+ "type": "string"
+ },
+ "port": {
+ "description": "端口",
+ "type": "string"
+ }
+ }
+ },
"config.Mssql": {
"type": "object",
"properties": {
@@ -4938,15 +6071,15 @@ const docTemplate = `{
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -4954,7 +6087,7 @@ const docTemplate = `{
"type": "boolean"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
"type": "string"
}
}
@@ -4996,15 +6129,15 @@ const docTemplate = `{
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -5012,7 +6145,7 @@ const docTemplate = `{
"type": "boolean"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
"type": "string"
}
}
@@ -5054,15 +6187,15 @@ const docTemplate = `{
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -5070,7 +6203,7 @@ const docTemplate = `{
"type": "boolean"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
"type": "string"
}
}
@@ -5112,15 +6245,15 @@ const docTemplate = `{
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -5128,7 +6261,7 @@ const docTemplate = `{
"type": "boolean"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
"type": "string"
}
}
@@ -5173,13 +6306,24 @@ const docTemplate = `{
"description": "服务器地址:端口",
"type": "string"
},
+ "clusterAddrs": {
+ "description": "集群模式下的节点地址列表",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"db": {
- "description": "redis的哪个数据库",
+ "description": "单实例模式下redis的哪个数据库",
"type": "integer"
},
"password": {
"description": "密码",
"type": "string"
+ },
+ "useCluster": {
+ "description": "是否使用集群模式",
+ "type": "boolean"
}
}
},
@@ -5203,6 +6347,9 @@ const docTemplate = `{
"captcha": {
"$ref": "#/definitions/config.Captcha"
},
+ "cloudflare-r2": {
+ "$ref": "#/definitions/config.CloudflareR2"
+ },
"cors": {
"description": "跨域配置",
"allOf": [
@@ -5217,6 +6364,12 @@ const docTemplate = `{
"$ref": "#/definitions/config.SpecializedDB"
}
},
+ "disk-list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/config.DiskList"
+ }
+ },
"email": {
"$ref": "#/definitions/github_com_flipped-aurora_gin-vue-admin_server_config.Email"
},
@@ -5237,6 +6390,9 @@ const docTemplate = `{
}
]
},
+ "mongo": {
+ "$ref": "#/definitions/config.Mongo"
+ },
"mssql": {
"$ref": "#/definitions/config.Mssql"
},
@@ -5260,15 +6416,15 @@ const docTemplate = `{
"redis": {
"$ref": "#/definitions/config.Redis"
},
+ "sqlite": {
+ "$ref": "#/definitions/config.Sqlite"
+ },
"system": {
"$ref": "#/definitions/config.System"
},
"tencent-cos": {
"$ref": "#/definitions/config.TencentCOS"
},
- "timer": {
- "$ref": "#/definitions/config.Timer"
- },
"zap": {
"$ref": "#/definitions/config.Zap"
}
@@ -5317,15 +6473,15 @@ const docTemplate = `{
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -5336,7 +6492,65 @@ const docTemplate = `{
"type": "string"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
+ "type": "string"
+ }
+ }
+ },
+ "config.Sqlite": {
+ "type": "object",
+ "properties": {
+ "config": {
+ "description": "高级配置",
+ "type": "string"
+ },
+ "db-name": {
+ "description": "数据库名",
+ "type": "string"
+ },
+ "engine": {
+ "description": "数据库引擎,默认InnoDB",
+ "type": "string",
+ "default": "InnoDB"
+ },
+ "log-mode": {
+ "description": "是否开启Gorm全局日志",
+ "type": "string"
+ },
+ "log-zap": {
+ "description": "是否通过zap写入日志文件",
+ "type": "boolean"
+ },
+ "max-idle-conns": {
+ "description": "空闲中的最大连接数",
+ "type": "integer"
+ },
+ "max-open-conns": {
+ "description": "打开到数据库的最大连接数",
+ "type": "integer"
+ },
+ "password": {
+ "description": "数据库密码",
+ "type": "string"
+ },
+ "path": {
+ "description": "数据库地址",
+ "type": "string"
+ },
+ "port": {
+ "description": "数据库端口",
+ "type": "string"
+ },
+ "prefix": {
+ "description": "数据库前缀",
+ "type": "string"
+ },
+ "singular": {
+ "description": "是否开启全局禁用复数,true表示开启",
+ "type": "boolean"
+ },
+ "username": {
+ "description": "数据库账号",
"type": "string"
}
}
@@ -5352,10 +6566,6 @@ const docTemplate = `{
"description": "数据库类型:mysql(默认)|sqlite|sqlserver|postgresql",
"type": "string"
},
- "env": {
- "description": "环境值",
- "type": "string"
- },
"iplimit-count": {
"type": "integer"
},
@@ -5369,6 +6579,10 @@ const docTemplate = `{
"router-prefix": {
"type": "string"
},
+ "use-mongo": {
+ "description": "使用mongo",
+ "type": "boolean"
+ },
"use-multipoint": {
"description": "多点登录拦截",
"type": "boolean"
@@ -5402,29 +6616,6 @@ const docTemplate = `{
}
}
},
- "config.Timer": {
- "type": "object",
- "properties": {
- "detail": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/config.Detail"
- }
- },
- "spec": {
- "description": "CRON表达式",
- "type": "string"
- },
- "start": {
- "description": "是否启用",
- "type": "boolean"
- },
- "with_seconds": {
- "description": "是否精确到秒",
- "type": "boolean"
- }
- }
- },
"config.Zap": {
"type": "object",
"properties": {
@@ -5448,14 +6639,14 @@ const docTemplate = `{
"description": "输出控制台",
"type": "boolean"
},
- "max-age": {
- "description": "日志留存时间",
- "type": "integer"
- },
"prefix": {
"description": "日志前缀",
"type": "string"
},
+ "retention-day": {
+ "description": "日志保留天数",
+ "type": "integer"
+ },
"show-line": {
"description": "显示行",
"type": "boolean"
@@ -5469,6 +6660,10 @@ const docTemplate = `{
"example.ExaCustomer": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
@@ -5481,10 +6676,6 @@ const docTemplate = `{
"description": "客户手机号",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"sysUser": {
"description": "管理详情",
"allOf": [
@@ -5510,6 +6701,10 @@ const docTemplate = `{
"example.ExaFile": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"chunkTotal": {
"type": "integer"
},
@@ -5532,10 +6727,6 @@ const docTemplate = `{
"filePath": {
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"isFinish": {
"type": "boolean"
},
@@ -5548,6 +6739,10 @@ const docTemplate = `{
"example.ExaFileChunk": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
@@ -5561,10 +6756,6 @@ const docTemplate = `{
"fileChunkPath": {
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"updatedAt": {
"description": "更新时间",
"type": "string"
@@ -5574,14 +6765,14 @@ const docTemplate = `{
"example.ExaFileUploadAndDownload": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"key": {
"description": "编号",
"type": "string"
@@ -5608,35 +6799,71 @@ const docTemplate = `{
"type": "object",
"properties": {
"from": {
- "description": "收件人",
+ "description": "发件人 你自己要发邮件的邮箱",
"type": "string"
},
"host": {
- "description": "服务器地址",
+ "description": "服务器地址 例如 smtp.qq.com 请前往QQ或者你要发邮件的邮箱查看其smtp协议",
"type": "string"
},
"is-ssl": {
- "description": "是否SSL",
+ "description": "是否SSL 是否开启SSL",
"type": "boolean"
},
"nickname": {
- "description": "昵称",
+ "description": "昵称 发件人昵称 通常为自己的邮箱",
"type": "string"
},
"port": {
- "description": "端口",
+ "description": "端口 请前往QQ或者你要发邮件的邮箱查看其smtp协议 大多为 465",
"type": "integer"
},
"secret": {
- "description": "密钥",
+ "description": "密钥 用于登录的密钥 最好不要用邮箱密码 去邮箱smtp申请一个用于登录的密钥",
"type": "string"
},
"to": {
- "description": "收件人:多个以英文逗号分隔",
+ "description": "收件人:多个以英文逗号分隔 例:a@qq.com b@qq.com 正式开发中请把此项目作为参数使用",
"type": "string"
}
}
},
+ "model.Info": {
+ "type": "object",
+ "properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
+ "attachments": {
+ "description": "附件",
+ "type": "array",
+ "items": {
+ "type": "object"
+ }
+ },
+ "content": {
+ "description": "内容",
+ "type": "string"
+ },
+ "createdAt": {
+ "description": "创建时间",
+ "type": "string"
+ },
+ "title": {
+ "description": "标题",
+ "type": "string"
+ },
+ "updatedAt": {
+ "description": "更新时间",
+ "type": "string"
+ },
+ "userID": {
+ "description": "作者",
+ "type": "integer"
+ }
+ }
+ },
"request.AddMenuAuthorityInfo": {
"type": "object",
"properties": {
@@ -5652,6 +6879,9 @@ const docTemplate = `{
}
}
},
+ "request.AutoCode": {
+ "type": "object"
+ },
"request.CasbinInReceive": {
"type": "object",
"properties": {
@@ -5728,14 +6958,21 @@ const docTemplate = `{
"request.InitDB": {
"type": "object",
"required": [
- "dbName",
- "userName"
+ "adminPassword",
+ "dbName"
],
"properties": {
+ "adminPassword": {
+ "type": "string"
+ },
"dbName": {
"description": "数据库名",
"type": "string"
},
+ "dbPath": {
+ "description": "sqlite数据库文件路径",
+ "type": "string"
+ },
"dbType": {
"description": "数据库类型",
"type": "string"
@@ -5837,22 +7074,13 @@ const docTemplate = `{
}
}
},
- "request.RollBack": {
- "type": "object",
- "properties": {
- "deleteTable": {
- "description": "是否删除表",
- "type": "boolean"
- },
- "id": {
- "description": "主键ID",
- "type": "integer"
- }
- }
- },
"request.SearchApiParams": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"apiGroup": {
"description": "api组",
"type": "string"
@@ -5869,10 +7097,6 @@ const docTemplate = `{
"description": "api中文描述",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"keyword": {
"description": "关键字",
"type": "string"
@@ -5944,19 +7168,44 @@ const docTemplate = `{
}
}
},
- "request.SysAutoHistory": {
+ "request.SysAutoCodePackageCreate": {
"type": "object",
"properties": {
- "keyword": {
- "description": "关键字",
- "type": "string"
+ "desc": {
+ "type": "string",
+ "example": "描述"
},
- "page": {
- "description": "页码",
- "type": "integer"
+ "label": {
+ "type": "string",
+ "example": "展示名"
},
- "pageSize": {
- "description": "每页大小",
+ "packageName": {
+ "type": "string",
+ "example": "包名"
+ },
+ "template": {
+ "type": "string",
+ "example": "模版"
+ }
+ }
+ },
+ "request.SysAutoHistoryRollBack": {
+ "type": "object",
+ "properties": {
+ "deleteApi": {
+ "description": "是否删除接口",
+ "type": "boolean"
+ },
+ "deleteMenu": {
+ "description": "是否删除菜单",
+ "type": "boolean"
+ },
+ "deleteTable": {
+ "description": "是否删除表",
+ "type": "boolean"
+ },
+ "id": {
+ "description": "主键ID",
"type": "integer"
}
}
@@ -6175,117 +7424,61 @@ const docTemplate = `{
}
}
},
- "system.AutoCodeStruct": {
+ "system.Condition": {
"type": "object",
"properties": {
- "abbreviation": {
- "description": "Struct简称",
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
+ "column": {
"type": "string"
},
- "autoCreateApiToSql": {
- "description": "是否自动创建api",
- "type": "boolean"
- },
- "autoCreateResource": {
- "description": "是否自动创建资源标识",
- "type": "boolean"
- },
- "autoMoveFile": {
- "description": "是否自动移动文件",
- "type": "boolean"
- },
- "businessDB": {
- "description": "业务数据库",
+ "createdAt": {
+ "description": "创建时间",
"type": "string"
},
- "description": {
- "description": "Struct中文名称",
+ "from": {
"type": "string"
},
- "fields": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/system.Field"
- }
- },
- "hasTimer": {
- "type": "boolean"
- },
- "humpPackageName": {
- "description": "go文件名称",
+ "operator": {
"type": "string"
},
- "package": {
+ "templateID": {
"type": "string"
},
- "packageName": {
- "description": "文件名称",
- "type": "string"
- },
- "structName": {
- "description": "Struct名称",
- "type": "string"
- },
- "tableName": {
- "description": "表名",
+ "updatedAt": {
+ "description": "更新时间",
"type": "string"
}
}
},
- "system.Field": {
+ "system.JoinTemplate": {
"type": "object",
"properties": {
- "clearable": {
- "description": "是否可清空",
- "type": "boolean"
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
},
- "columnName": {
- "description": "数据库字段",
+ "createdAt": {
+ "description": "创建时间",
"type": "string"
},
- "comment": {
- "description": "数据库字段描述",
+ "joins": {
"type": "string"
},
- "dataTypeLong": {
- "description": "数据库字段长度",
+ "on": {
"type": "string"
},
- "dictType": {
- "description": "字典",
+ "table": {
"type": "string"
},
- "errorText": {
- "description": "校验失败文字",
+ "templateID": {
"type": "string"
},
- "fieldDesc": {
- "description": "中文名",
+ "updatedAt": {
+ "description": "更新时间",
"type": "string"
- },
- "fieldJson": {
- "description": "FieldJson",
- "type": "string"
- },
- "fieldName": {
- "description": "Field名",
- "type": "string"
- },
- "fieldSearchType": {
- "description": "搜索条件",
- "type": "string"
- },
- "fieldType": {
- "description": "Field数据类型",
- "type": "string"
- },
- "require": {
- "description": "是否必填",
- "type": "boolean"
- },
- "sort": {
- "description": "是否增加排序",
- "type": "boolean"
}
}
},
@@ -6320,6 +7513,10 @@ const docTemplate = `{
"system.SysApi": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"apiGroup": {
"description": "api组",
"type": "string"
@@ -6332,10 +7529,6 @@ const docTemplate = `{
"description": "api中文描述",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"method": {
"description": "方法:创建POST(默认)|查看GET|更新PUT|删除DELETE",
"type": "string"
@@ -6400,35 +7593,13 @@ const docTemplate = `{
}
}
},
- "system.SysAutoCode": {
- "type": "object",
- "properties": {
- "createdAt": {
- "description": "创建时间",
- "type": "string"
- },
- "desc": {
- "type": "string"
- },
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
- "label": {
- "type": "string"
- },
- "packageName": {
- "type": "string"
- },
- "updatedAt": {
- "description": "更新时间",
- "type": "string"
- }
- }
- },
"system.SysBaseMenu": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"authoritys": {
"type": "array",
"items": {
@@ -6453,10 +7624,6 @@ const docTemplate = `{
"description": "是否在列表隐藏",
"type": "boolean"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"menuBtn": {
"type": "array",
"items": {
@@ -6483,7 +7650,7 @@ const docTemplate = `{
},
"parentId": {
"description": "父菜单ID",
- "type": "string"
+ "type": "integer"
},
"path": {
"description": "路由path",
@@ -6502,6 +7669,10 @@ const docTemplate = `{
"system.SysBaseMenuBtn": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
@@ -6509,10 +7680,6 @@ const docTemplate = `{
"desc": {
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"name": {
"type": "string"
},
@@ -6528,14 +7695,14 @@ const docTemplate = `{
"system.SysBaseMenuParameter": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"key": {
"description": "地址栏携带参数的key",
"type": "string"
@@ -6560,6 +7727,10 @@ const docTemplate = `{
"system.SysDictionary": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
@@ -6568,10 +7739,6 @@ const docTemplate = `{
"description": "描述",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"name": {
"description": "字典名(中)",
"type": "string"
@@ -6599,13 +7766,17 @@ const docTemplate = `{
"system.SysDictionaryDetail": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
+ "extend": {
+ "description": "扩展值",
+ "type": "string"
},
"label": {
"description": "展示值",
@@ -6629,13 +7800,72 @@ const docTemplate = `{
},
"value": {
"description": "字典值",
+ "type": "string"
+ }
+ }
+ },
+ "system.SysExportTemplate": {
+ "type": "object",
+ "properties": {
+ "ID": {
+ "description": "主键ID",
"type": "integer"
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/system.Condition"
+ }
+ },
+ "createdAt": {
+ "description": "创建时间",
+ "type": "string"
+ },
+ "dbName": {
+ "description": "数据库名称",
+ "type": "string"
+ },
+ "joinTemplate": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/system.JoinTemplate"
+ }
+ },
+ "limit": {
+ "type": "integer"
+ },
+ "name": {
+ "description": "模板名称",
+ "type": "string"
+ },
+ "order": {
+ "type": "string"
+ },
+ "tableName": {
+ "description": "表名称",
+ "type": "string"
+ },
+ "templateID": {
+ "description": "模板标识",
+ "type": "string"
+ },
+ "templateInfo": {
+ "description": "模板信息",
+ "type": "string"
+ },
+ "updatedAt": {
+ "description": "更新时间",
+ "type": "string"
}
}
},
"system.SysMenu": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"authoritys": {
"type": "array",
"items": {
@@ -6666,10 +7896,6 @@ const docTemplate = `{
"description": "是否在列表隐藏",
"type": "boolean"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"menuBtn": {
"type": "array",
"items": {
@@ -6677,7 +7903,7 @@ const docTemplate = `{
}
},
"menuId": {
- "type": "string"
+ "type": "integer"
},
"meta": {
"description": "附加属性",
@@ -6699,7 +7925,7 @@ const docTemplate = `{
},
"parentId": {
"description": "父菜单ID",
- "type": "string"
+ "type": "integer"
},
"path": {
"description": "路由path",
@@ -6718,6 +7944,10 @@ const docTemplate = `{
"system.SysOperationRecord": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"agent": {
"description": "代理",
"type": "string"
@@ -6734,10 +7964,6 @@ const docTemplate = `{
"description": "错误信息",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"ip": {
"description": "请求ip",
"type": "string"
@@ -6778,9 +8004,9 @@ const docTemplate = `{
"system.SysUser": {
"type": "object",
"properties": {
- "activeColor": {
- "description": "活跃颜色",
- "type": "string"
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
},
"authorities": {
"type": "array",
@@ -6815,10 +8041,6 @@ const docTemplate = `{
"description": "用户头像",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"nickName": {
"description": "用户昵称",
"type": "string"
@@ -6865,12 +8087,12 @@ const docTemplate = `{
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
- Version: "0.0.1",
+ Version: "v2.7.0",
Host: "",
BasePath: "",
Schemes: []string{},
- Title: "Swagger Example API",
- Description: "This is a sample Server pets",
+ Title: "Gin-Vue-Admin Swagger API接口文档",
+ Description: "使用gin+vue进行极速开发的全栈开发基础平台",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
diff --git a/server/docs/swagger.json b/server/docs/swagger.json
index 3e5cb933c..33e82d34e 100644
--- a/server/docs/swagger.json
+++ b/server/docs/swagger.json
@@ -1,10 +1,10 @@
{
"swagger": "2.0",
"info": {
- "description": "This is a sample Server pets",
- "title": "Swagger Example API",
+ "description": "使用gin+vue进行极速开发的全栈开发基础平台",
+ "title": "Gin-Vue-Admin Swagger API接口文档",
"contact": {},
- "version": "0.0.1"
+ "version": "v2.7.0"
},
"paths": {
"/api/createApi": {
@@ -157,6 +157,45 @@
}
}
},
+ "/api/enterSyncApi": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysApi"
+ ],
+ "summary": "确认同步API",
+ "responses": {
+ "200": {
+ "description": "确认同步API",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/api/freshCasbin": {
"get": {
"consumes": [
@@ -283,6 +322,45 @@
}
}
},
+ "/api/getApiGroups": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysApi"
+ ],
+ "summary": "获取API分组",
+ "responses": {
+ "200": {
+ "description": "获取API分组",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/api/getApiList": {
"post": {
"security": [
@@ -336,6 +414,84 @@
}
}
},
+ "/api/ignoreApi": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "IgnoreApi"
+ ],
+ "summary": "忽略API",
+ "responses": {
+ "200": {
+ "description": "同步API",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/syncApi": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysApi"
+ ],
+ "summary": "同步API",
+ "responses": {
+ "200": {
+ "description": "同步API",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/api/updateApi": {
"post": {
"security": [
@@ -840,6 +996,44 @@
}
}
},
+ "/autoCode/addFunc": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "AddFunc"
+ ],
+ "summary": "增加方法",
+ "parameters": [
+ {
+ "description": "增加方法",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.AutoCode"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
"/autoCode/createPackage": {
"post": {
"security": [
@@ -854,7 +1048,7 @@
"application/json"
],
"tags": [
- "AutoCode"
+ "AutoCodePackage"
],
"summary": "创建package",
"parameters": [
@@ -864,7 +1058,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/system.SysAutoCode"
+ "$ref": "#/definitions/request.SysAutoCodePackageCreate"
}
}
],
@@ -894,60 +1088,6 @@
}
}
},
- "/autoCode/createPlug": {
- "post": {
- "security": [
- {
- "ApiKeyAuth": []
- }
- ],
- "consumes": [
- "multipart/form-data"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "AutoCode"
- ],
- "summary": "安装插件",
- "parameters": [
- {
- "type": "file",
- "description": "this is a test file",
- "name": "plug",
- "in": "formData",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "安装插件成功",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/response.Response"
- },
- {
- "type": "object",
- "properties": {
- "data": {
- "type": "array",
- "items": {
- "type": "object"
- }
- },
- "msg": {
- "type": "string"
- }
- }
- }
- ]
- }
- }
- }
- }
- },
"/autoCode/createTemp": {
"post": {
"security": [
@@ -962,7 +1102,7 @@
"application/json"
],
"tags": [
- "AutoCode"
+ "AutoCodeTemplate"
],
"summary": "自动代码模板",
"parameters": [
@@ -972,7 +1112,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/system.AutoCodeStruct"
+ "$ref": "#/definitions/request.AutoCode"
}
}
],
@@ -1010,7 +1150,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/system.SysAutoCode"
+ "$ref": "#/definitions/request.GetById"
}
}
],
@@ -1244,7 +1384,7 @@
"application/json"
],
"tags": [
- "AutoCode"
+ "AutoCodePackage"
],
"summary": "获取package",
"responses": {
@@ -1297,7 +1437,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/request.SysAutoHistory"
+ "$ref": "#/definitions/request.PageInfo"
}
}
],
@@ -1369,6 +1509,103 @@
}
}
},
+ "/autoCode/getTemplates": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "AutoCodePackage"
+ ],
+ "summary": "获取package",
+ "responses": {
+ "200": {
+ "description": "创建package成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/autoCode/installPlugin": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "AutoCodePlugin"
+ ],
+ "summary": "安装插件",
+ "parameters": [
+ {
+ "type": "file",
+ "description": "this is a test file",
+ "name": "plug",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "安装插件成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ }
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/autoCode/preview": {
"post": {
"security": [
@@ -1383,7 +1620,7 @@
"application/json"
],
"tags": [
- "AutoCode"
+ "AutoCodeTemplate"
],
"summary": "预览创建后的代码",
"parameters": [
@@ -1393,7 +1630,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/system.AutoCodeStruct"
+ "$ref": "#/definitions/request.AutoCode"
}
}
],
@@ -1423,6 +1660,58 @@
}
}
},
+ "/autoCode/pubPlug": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "AutoCodePlugin"
+ ],
+ "summary": "打包插件",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "插件名称",
+ "name": "plugName",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "打包插件成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/autoCode/rollback": {
"post": {
"security": [
@@ -1447,7 +1736,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/request.RollBack"
+ "$ref": "#/definitions/request.SysAutoHistoryRollBack"
}
}
],
@@ -1681,6 +1970,12 @@
],
"summary": "获取单一客户信息",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "创建时间",
@@ -1699,12 +1994,6 @@
"name": "customerPhoneData",
"in": "query"
},
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
{
"type": "integer",
"description": "管理角色ID",
@@ -2312,6 +2601,451 @@
}
}
},
+ "/info/createInfo": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "创建公告",
+ "parameters": [
+ {
+ "description": "创建公告",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/model.Info"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "创建成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/deleteInfo": {
+ "delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "删除公告",
+ "parameters": [
+ {
+ "description": "删除公告",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/model.Info"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "删除成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/deleteInfoByIds": {
+ "delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "批量删除公告",
+ "responses": {
+ "200": {
+ "description": "批量删除成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/findInfo": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "用id查询公告",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "内容",
+ "name": "content",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "创建时间",
+ "name": "createdAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "标题",
+ "name": "title",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "更新时间",
+ "name": "updatedAt",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "作者",
+ "name": "userID",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "查询成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/model.Info"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/getInfoDataSource": {
+ "get": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "获取Info的数据源",
+ "responses": {
+ "200": {
+ "description": "查询成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/getInfoList": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "分页获取公告列表",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "endCreatedAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键字",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页大小",
+ "name": "pageSize",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "startCreatedAt",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "获取成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/response.PageResult"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/getInfoPublic": {
+ "get": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "不需要鉴权的公告接口",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "endCreatedAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键字",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页大小",
+ "name": "pageSize",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "startCreatedAt",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "获取成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object"
+ },
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/info/updateInfo": {
+ "put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Info"
+ ],
+ "summary": "更新公告",
+ "parameters": [
+ {
+ "description": "更新公告",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/model.Info"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "更新成功",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/response.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/init/checkdb": {
"post": {
"produces": [
@@ -3006,6 +3740,12 @@
],
"summary": "用id查询SysDictionary",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "创建时间",
@@ -3018,12 +3758,6 @@
"name": "desc",
"in": "query"
},
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
{
"type": "string",
"description": "字典名(中)",
@@ -3092,68 +3826,6 @@
"SysDictionary"
],
"summary": "分页获取SysDictionary列表",
- "parameters": [
- {
- "type": "string",
- "description": "创建时间",
- "name": "createdAt",
- "in": "query"
- },
- {
- "type": "string",
- "description": "描述",
- "name": "desc",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
- {
- "type": "string",
- "description": "关键字",
- "name": "keyword",
- "in": "query"
- },
- {
- "type": "string",
- "description": "字典名(中)",
- "name": "name",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "页码",
- "name": "page",
- "in": "query"
- },
- {
- "type": "integer",
- "description": "每页大小",
- "name": "pageSize",
- "in": "query"
- },
- {
- "type": "boolean",
- "description": "状态",
- "name": "status",
- "in": "query"
- },
- {
- "type": "string",
- "description": "字典名(英)",
- "name": "type",
- "in": "query"
- },
- {
- "type": "string",
- "description": "更新时间",
- "name": "updatedAt",
- "in": "query"
- }
- ],
"responses": {
"200": {
"description": "分页获取SysDictionary列表,返回包括列表,总数,页码,每页数量",
@@ -3347,6 +4019,12 @@
],
"summary": "用id查询SysDictionaryDetail",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "创建时间",
@@ -3354,9 +4032,9 @@
"in": "query"
},
{
- "type": "integer",
- "description": "主键ID",
- "name": "id",
+ "type": "string",
+ "description": "扩展值",
+ "name": "extend",
"in": "query"
},
{
@@ -3390,7 +4068,7 @@
"in": "query"
},
{
- "type": "integer",
+ "type": "string",
"description": "字典值",
"name": "value",
"in": "query"
@@ -3440,6 +4118,12 @@
],
"summary": "分页获取SysDictionaryDetail列表",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "创建时间",
@@ -3447,9 +4131,9 @@
"in": "query"
},
{
- "type": "integer",
- "description": "主键ID",
- "name": "id",
+ "type": "string",
+ "description": "扩展值",
+ "name": "extend",
"in": "query"
},
{
@@ -3501,7 +4185,7 @@
"in": "query"
},
{
- "type": "integer",
+ "type": "string",
"description": "字典值",
"name": "value",
"in": "query"
@@ -3582,6 +4266,400 @@
}
}
},
+ "/sysExportTemplate/createSysExportTemplate": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "创建导出模板",
+ "parameters": [
+ {
+ "description": "创建导出模板",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/system.SysExportTemplate"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/deleteSysExportTemplate": {
+ "delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "删除导出模板",
+ "parameters": [
+ {
+ "description": "删除导出模板",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/system.SysExportTemplate"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/deleteSysExportTemplateByIds": {
+ "delete": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "批量删除导出模板",
+ "parameters": [
+ {
+ "description": "批量删除导出模板",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.IdsReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/exportExcel": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "导出表格模板",
+ "responses": {}
+ }
+ },
+ "/sysExportTemplate/findSysExportTemplate": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "用id查询导出模板",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "创建时间",
+ "name": "createdAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "数据库名称",
+ "name": "dbName",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板名称",
+ "name": "name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "order",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "表名称",
+ "name": "tableName",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板标识",
+ "name": "templateID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板信息",
+ "name": "templateInfo",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "更新时间",
+ "name": "updatedAt",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/getSysExportTemplateList": {
+ "get": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "分页获取导出模板列表",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "创建时间",
+ "name": "createdAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "数据库名称",
+ "name": "dbName",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "endCreatedAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "关键字",
+ "name": "keyword",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板名称",
+ "name": "name",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "order",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "页码",
+ "name": "page",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "每页大小",
+ "name": "pageSize",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "startCreatedAt",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "表名称",
+ "name": "tableName",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板标识",
+ "name": "templateID",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "模板信息",
+ "name": "templateInfo",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "description": "更新时间",
+ "name": "updatedAt",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/sysExportTemplate/importExcel": {
+ "post": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysImportTemplate"
+ ],
+ "summary": "导入表格",
+ "responses": {}
+ }
+ },
+ "/sysExportTemplate/updateSysExportTemplate": {
+ "put": {
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SysExportTemplate"
+ ],
+ "summary": "更新导出模板",
+ "parameters": [
+ {
+ "description": "更新导出模板",
+ "name": "data",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/system.SysExportTemplate"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
"/sysOperationRecord/createSysOperationRecord": {
"post": {
"security": [
@@ -3750,6 +4828,12 @@
],
"summary": "用id查询SysOperationRecord",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "代理",
@@ -3774,12 +4858,6 @@
"name": "error_message",
"in": "query"
},
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
{
"type": "string",
"description": "请求ip",
@@ -3873,6 +4951,12 @@
],
"summary": "分页获取SysOperationRecord列表",
"parameters": [
+ {
+ "type": "integer",
+ "description": "主键ID",
+ "name": "ID",
+ "in": "query"
+ },
{
"type": "string",
"description": "代理",
@@ -3897,12 +4981,6 @@
"name": "error_message",
"in": "query"
},
- {
- "type": "integer",
- "description": "主键ID",
- "name": "id",
- "in": "query"
- },
{
"type": "string",
"description": "请求ip",
@@ -4678,47 +5756,20 @@
"config.Autocode": {
"type": "object",
"properties": {
+ "ai-path": {
+ "type": "string"
+ },
+ "module": {
+ "type": "string"
+ },
"root": {
"type": "string"
},
"server": {
"type": "string"
},
- "server-api": {
- "type": "string"
- },
- "server-initialize": {
- "type": "string"
- },
- "server-model": {
- "type": "string"
- },
- "server-plug": {
- "type": "string"
- },
- "server-request": {
- "type": "string"
- },
- "server-router": {
- "type": "string"
- },
- "server-service": {
- "type": "string"
- },
- "transfer-restart": {
- "type": "boolean"
- },
"web": {
"type": "string"
- },
- "web-api": {
- "type": "string"
- },
- "web-form": {
- "type": "string"
- },
- "web-table": {
- "type": "string"
}
}
},
@@ -4813,19 +5864,33 @@
}
}
},
- "config.Detail": {
+ "config.CloudflareR2": {
"type": "object",
"properties": {
- "compareField": {
- "description": "需要比较时间的字段",
+ "access-key-id": {
"type": "string"
},
- "interval": {
- "description": "时间间隔",
+ "account-id": {
"type": "string"
},
- "tableName": {
- "description": "需要清理的表名",
+ "base-url": {
+ "type": "string"
+ },
+ "bucket": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "secret-access-key": {
+ "type": "string"
+ }
+ }
+ },
+ "config.DiskList": {
+ "type": "object",
+ "properties": {
+ "mount-point": {
"type": "string"
}
}
@@ -4892,6 +5957,75 @@
}
}
},
+ "config.Mongo": {
+ "type": "object",
+ "properties": {
+ "auth-source": {
+ "description": "验证数据库",
+ "type": "string"
+ },
+ "coll": {
+ "description": "collection name",
+ "type": "string"
+ },
+ "connect-timeout-ms": {
+ "description": "连接超时时间",
+ "type": "integer"
+ },
+ "database": {
+ "description": "database name",
+ "type": "string"
+ },
+ "hosts": {
+ "description": "主机列表",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/config.MongoHost"
+ }
+ },
+ "is-zap": {
+ "description": "是否开启zap日志",
+ "type": "boolean"
+ },
+ "max-pool-size": {
+ "description": "最大连接池",
+ "type": "integer"
+ },
+ "min-pool-size": {
+ "description": "最小连接池",
+ "type": "integer"
+ },
+ "options": {
+ "description": "mongodb options",
+ "type": "string"
+ },
+ "password": {
+ "description": "密码",
+ "type": "string"
+ },
+ "socket-timeout-ms": {
+ "description": "socket超时时间",
+ "type": "integer"
+ },
+ "username": {
+ "description": "用户名",
+ "type": "string"
+ }
+ }
+ },
+ "config.MongoHost": {
+ "type": "object",
+ "properties": {
+ "host": {
+ "description": "ip地址",
+ "type": "string"
+ },
+ "port": {
+ "description": "端口",
+ "type": "string"
+ }
+ }
+ },
"config.Mssql": {
"type": "object",
"properties": {
@@ -4929,15 +6063,15 @@
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -4945,7 +6079,7 @@
"type": "boolean"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
"type": "string"
}
}
@@ -4987,15 +6121,15 @@
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -5003,7 +6137,7 @@
"type": "boolean"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
"type": "string"
}
}
@@ -5045,15 +6179,15 @@
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -5061,7 +6195,7 @@
"type": "boolean"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
"type": "string"
}
}
@@ -5103,15 +6237,15 @@
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -5119,65 +6253,7 @@
"type": "boolean"
},
"username": {
- "description": "数据库用户名",
- "type": "string"
- }
- }
- },
- "config.Sqlite": {
- "type": "object",
- "properties": {
- "config": {
- "description": "高级配置",
- "type": "string"
- },
- "db-name": {
- "description": "数据库名",
- "type": "string"
- },
- "engine": {
- "description": "数据库引擎,默认InnoDB",
- "type": "string",
- "default": "InnoDB"
- },
- "log-mode": {
- "description": "是否开启Gorm全局日志",
- "type": "string"
- },
- "log-zap": {
- "description": "是否通过zap写入日志文件",
- "type": "boolean"
- },
- "max-idle-conns": {
- "description": "空闲中的最大连接数",
- "type": "integer"
- },
- "max-open-conns": {
- "description": "打开到数据库的最大连接数",
- "type": "integer"
- },
- "password": {
- "description": "数据库密码",
- "type": "string"
- },
- "path": {
- "description": "服务器地址:端口",
- "type": "string"
- },
- "port": {
- "description": ":端口",
- "type": "string"
- },
- "prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
- "type": "string"
- },
- "singular": {
- "description": "是否开启全局禁用复数,true表示开启",
- "type": "boolean"
- },
- "username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
"type": "string"
}
}
@@ -5222,13 +6298,24 @@
"description": "服务器地址:端口",
"type": "string"
},
+ "clusterAddrs": {
+ "description": "集群模式下的节点地址列表",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
"db": {
- "description": "redis的哪个数据库",
+ "description": "单实例模式下redis的哪个数据库",
"type": "integer"
},
"password": {
"description": "密码",
"type": "string"
+ },
+ "useCluster": {
+ "description": "是否使用集群模式",
+ "type": "boolean"
}
}
},
@@ -5252,6 +6339,9 @@
"captcha": {
"$ref": "#/definitions/config.Captcha"
},
+ "cloudflare-r2": {
+ "$ref": "#/definitions/config.CloudflareR2"
+ },
"cors": {
"description": "跨域配置",
"allOf": [
@@ -5266,6 +6356,12 @@
"$ref": "#/definitions/config.SpecializedDB"
}
},
+ "disk-list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/config.DiskList"
+ }
+ },
"email": {
"$ref": "#/definitions/github_com_flipped-aurora_gin-vue-admin_server_config.Email"
},
@@ -5286,6 +6382,9 @@
}
]
},
+ "mongo": {
+ "$ref": "#/definitions/config.Mongo"
+ },
"mssql": {
"$ref": "#/definitions/config.Mssql"
},
@@ -5303,24 +6402,21 @@
"pgsql": {
"$ref": "#/definitions/config.Pgsql"
},
- "sqlite": {
- "$ref": "#/definitions/config.Sqlite"
- },
"qiniu": {
"$ref": "#/definitions/config.Qiniu"
},
"redis": {
"$ref": "#/definitions/config.Redis"
},
+ "sqlite": {
+ "$ref": "#/definitions/config.Sqlite"
+ },
"system": {
"$ref": "#/definitions/config.System"
},
"tencent-cos": {
"$ref": "#/definitions/config.TencentCOS"
},
- "timer": {
- "$ref": "#/definitions/config.Timer"
- },
"zap": {
"$ref": "#/definitions/config.Zap"
}
@@ -5369,15 +6465,15 @@
"type": "string"
},
"path": {
- "description": "服务器地址:端口",
+ "description": "数据库地址",
"type": "string"
},
"port": {
- "description": ":端口",
+ "description": "数据库端口",
"type": "string"
},
"prefix": {
- "description": "全局表前缀,单独定义TableName则不生效",
+ "description": "数据库前缀",
"type": "string"
},
"singular": {
@@ -5388,7 +6484,65 @@
"type": "string"
},
"username": {
- "description": "数据库用户名",
+ "description": "数据库账号",
+ "type": "string"
+ }
+ }
+ },
+ "config.Sqlite": {
+ "type": "object",
+ "properties": {
+ "config": {
+ "description": "高级配置",
+ "type": "string"
+ },
+ "db-name": {
+ "description": "数据库名",
+ "type": "string"
+ },
+ "engine": {
+ "description": "数据库引擎,默认InnoDB",
+ "type": "string",
+ "default": "InnoDB"
+ },
+ "log-mode": {
+ "description": "是否开启Gorm全局日志",
+ "type": "string"
+ },
+ "log-zap": {
+ "description": "是否通过zap写入日志文件",
+ "type": "boolean"
+ },
+ "max-idle-conns": {
+ "description": "空闲中的最大连接数",
+ "type": "integer"
+ },
+ "max-open-conns": {
+ "description": "打开到数据库的最大连接数",
+ "type": "integer"
+ },
+ "password": {
+ "description": "数据库密码",
+ "type": "string"
+ },
+ "path": {
+ "description": "数据库地址",
+ "type": "string"
+ },
+ "port": {
+ "description": "数据库端口",
+ "type": "string"
+ },
+ "prefix": {
+ "description": "数据库前缀",
+ "type": "string"
+ },
+ "singular": {
+ "description": "是否开启全局禁用复数,true表示开启",
+ "type": "boolean"
+ },
+ "username": {
+ "description": "数据库账号",
"type": "string"
}
}
@@ -5404,10 +6558,6 @@
"description": "数据库类型:mysql(默认)|sqlite|sqlserver|postgresql",
"type": "string"
},
- "env": {
- "description": "环境值",
- "type": "string"
- },
"iplimit-count": {
"type": "integer"
},
@@ -5421,6 +6571,10 @@
"router-prefix": {
"type": "string"
},
+ "use-mongo": {
+ "description": "使用mongo",
+ "type": "boolean"
+ },
"use-multipoint": {
"description": "多点登录拦截",
"type": "boolean"
@@ -5454,29 +6608,6 @@
}
}
},
- "config.Timer": {
- "type": "object",
- "properties": {
- "detail": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/config.Detail"
- }
- },
- "spec": {
- "description": "CRON表达式",
- "type": "string"
- },
- "start": {
- "description": "是否启用",
- "type": "boolean"
- },
- "with_seconds": {
- "description": "是否精确到秒",
- "type": "boolean"
- }
- }
- },
"config.Zap": {
"type": "object",
"properties": {
@@ -5500,14 +6631,14 @@
"description": "输出控制台",
"type": "boolean"
},
- "max-age": {
- "description": "日志留存时间",
- "type": "integer"
- },
"prefix": {
"description": "日志前缀",
"type": "string"
},
+ "retention-day": {
+ "description": "日志保留天数",
+ "type": "integer"
+ },
"show-line": {
"description": "显示行",
"type": "boolean"
@@ -5521,6 +6652,10 @@
"example.ExaCustomer": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
@@ -5533,10 +6668,6 @@
"description": "客户手机号",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"sysUser": {
"description": "管理详情",
"allOf": [
@@ -5562,6 +6693,10 @@
"example.ExaFile": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"chunkTotal": {
"type": "integer"
},
@@ -5584,10 +6719,6 @@
"filePath": {
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"isFinish": {
"type": "boolean"
},
@@ -5600,6 +6731,10 @@
"example.ExaFileChunk": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
@@ -5613,10 +6748,6 @@
"fileChunkPath": {
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"updatedAt": {
"description": "更新时间",
"type": "string"
@@ -5626,14 +6757,14 @@
"example.ExaFileUploadAndDownload": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"key": {
"description": "编号",
"type": "string"
@@ -5660,35 +6791,71 @@
"type": "object",
"properties": {
"from": {
- "description": "收件人",
+ "description": "发件人 你自己要发邮件的邮箱",
"type": "string"
},
"host": {
- "description": "服务器地址",
+ "description": "服务器地址 例如 smtp.qq.com 请前往QQ或者你要发邮件的邮箱查看其smtp协议",
"type": "string"
},
"is-ssl": {
- "description": "是否SSL",
+ "description": "是否SSL 是否开启SSL",
"type": "boolean"
},
"nickname": {
- "description": "昵称",
+ "description": "昵称 发件人昵称 通常为自己的邮箱",
"type": "string"
},
"port": {
- "description": "端口",
+ "description": "端口 请前往QQ或者你要发邮件的邮箱查看其smtp协议 大多为 465",
"type": "integer"
},
"secret": {
- "description": "密钥",
+ "description": "密钥 用于登录的密钥 最好不要用邮箱密码 去邮箱smtp申请一个用于登录的密钥",
"type": "string"
},
"to": {
- "description": "收件人:多个以英文逗号分隔",
+ "description": "收件人:多个以英文逗号分隔 例:a@qq.com b@qq.com 正式开发中请把此项目作为参数使用",
"type": "string"
}
}
},
+ "model.Info": {
+ "type": "object",
+ "properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
+ "attachments": {
+ "description": "附件",
+ "type": "array",
+ "items": {
+ "type": "object"
+ }
+ },
+ "content": {
+ "description": "内容",
+ "type": "string"
+ },
+ "createdAt": {
+ "description": "创建时间",
+ "type": "string"
+ },
+ "title": {
+ "description": "标题",
+ "type": "string"
+ },
+ "updatedAt": {
+ "description": "更新时间",
+ "type": "string"
+ },
+ "userID": {
+ "description": "作者",
+ "type": "integer"
+ }
+ }
+ },
"request.AddMenuAuthorityInfo": {
"type": "object",
"properties": {
@@ -5704,6 +6871,9 @@
}
}
},
+ "request.AutoCode": {
+ "type": "object"
+ },
"request.CasbinInReceive": {
"type": "object",
"properties": {
@@ -5780,14 +6950,21 @@
"request.InitDB": {
"type": "object",
"required": [
- "dbName",
- "userName"
+ "adminPassword",
+ "dbName"
],
"properties": {
+ "adminPassword": {
+ "type": "string"
+ },
"dbName": {
"description": "数据库名",
"type": "string"
},
+ "dbPath": {
+ "description": "sqlite数据库文件路径",
+ "type": "string"
+ },
"dbType": {
"description": "数据库类型",
"type": "string"
@@ -5889,22 +7066,13 @@
}
}
},
- "request.RollBack": {
- "type": "object",
- "properties": {
- "deleteTable": {
- "description": "是否删除表",
- "type": "boolean"
- },
- "id": {
- "description": "主键ID",
- "type": "integer"
- }
- }
- },
"request.SearchApiParams": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"apiGroup": {
"description": "api组",
"type": "string"
@@ -5921,10 +7089,6 @@
"description": "api中文描述",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"keyword": {
"description": "关键字",
"type": "string"
@@ -5996,19 +7160,44 @@
}
}
},
- "request.SysAutoHistory": {
+ "request.SysAutoCodePackageCreate": {
"type": "object",
"properties": {
- "keyword": {
- "description": "关键字",
- "type": "string"
+ "desc": {
+ "type": "string",
+ "example": "描述"
},
- "page": {
- "description": "页码",
- "type": "integer"
+ "label": {
+ "type": "string",
+ "example": "展示名"
},
- "pageSize": {
- "description": "每页大小",
+ "packageName": {
+ "type": "string",
+ "example": "包名"
+ },
+ "template": {
+ "type": "string",
+ "example": "模版"
+ }
+ }
+ },
+ "request.SysAutoHistoryRollBack": {
+ "type": "object",
+ "properties": {
+ "deleteApi": {
+ "description": "是否删除接口",
+ "type": "boolean"
+ },
+ "deleteMenu": {
+ "description": "是否删除菜单",
+ "type": "boolean"
+ },
+ "deleteTable": {
+ "description": "是否删除表",
+ "type": "boolean"
+ },
+ "id": {
+ "description": "主键ID",
"type": "integer"
}
}
@@ -6227,117 +7416,61 @@
}
}
},
- "system.AutoCodeStruct": {
+ "system.Condition": {
"type": "object",
"properties": {
- "abbreviation": {
- "description": "Struct简称",
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
+ "column": {
"type": "string"
},
- "autoCreateApiToSql": {
- "description": "是否自动创建api",
- "type": "boolean"
- },
- "autoCreateResource": {
- "description": "是否自动创建资源标识",
- "type": "boolean"
- },
- "autoMoveFile": {
- "description": "是否自动移动文件",
- "type": "boolean"
- },
- "businessDB": {
- "description": "业务数据库",
+ "createdAt": {
+ "description": "创建时间",
"type": "string"
},
- "description": {
- "description": "Struct中文名称",
+ "from": {
"type": "string"
},
- "fields": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/system.Field"
- }
- },
- "hasTimer": {
- "type": "boolean"
- },
- "humpPackageName": {
- "description": "go文件名称",
+ "operator": {
"type": "string"
},
- "package": {
+ "templateID": {
"type": "string"
},
- "packageName": {
- "description": "文件名称",
- "type": "string"
- },
- "structName": {
- "description": "Struct名称",
- "type": "string"
- },
- "tableName": {
- "description": "表名",
+ "updatedAt": {
+ "description": "更新时间",
"type": "string"
}
}
},
- "system.Field": {
+ "system.JoinTemplate": {
"type": "object",
"properties": {
- "clearable": {
- "description": "是否可清空",
- "type": "boolean"
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
},
- "columnName": {
- "description": "数据库字段",
+ "createdAt": {
+ "description": "创建时间",
"type": "string"
},
- "comment": {
- "description": "数据库字段描述",
+ "joins": {
"type": "string"
},
- "dataTypeLong": {
- "description": "数据库字段长度",
+ "on": {
"type": "string"
},
- "dictType": {
- "description": "字典",
+ "table": {
"type": "string"
},
- "errorText": {
- "description": "校验失败文字",
+ "templateID": {
"type": "string"
},
- "fieldDesc": {
- "description": "中文名",
+ "updatedAt": {
+ "description": "更新时间",
"type": "string"
- },
- "fieldJson": {
- "description": "FieldJson",
- "type": "string"
- },
- "fieldName": {
- "description": "Field名",
- "type": "string"
- },
- "fieldSearchType": {
- "description": "搜索条件",
- "type": "string"
- },
- "fieldType": {
- "description": "Field数据类型",
- "type": "string"
- },
- "require": {
- "description": "是否必填",
- "type": "boolean"
- },
- "sort": {
- "description": "是否增加排序",
- "type": "boolean"
}
}
},
@@ -6372,6 +7505,10 @@
"system.SysApi": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"apiGroup": {
"description": "api组",
"type": "string"
@@ -6384,10 +7521,6 @@
"description": "api中文描述",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"method": {
"description": "方法:创建POST(默认)|查看GET|更新PUT|删除DELETE",
"type": "string"
@@ -6452,35 +7585,13 @@
}
}
},
- "system.SysAutoCode": {
- "type": "object",
- "properties": {
- "createdAt": {
- "description": "创建时间",
- "type": "string"
- },
- "desc": {
- "type": "string"
- },
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
- "label": {
- "type": "string"
- },
- "packageName": {
- "type": "string"
- },
- "updatedAt": {
- "description": "更新时间",
- "type": "string"
- }
- }
- },
"system.SysBaseMenu": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"authoritys": {
"type": "array",
"items": {
@@ -6505,10 +7616,6 @@
"description": "是否在列表隐藏",
"type": "boolean"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"menuBtn": {
"type": "array",
"items": {
@@ -6535,7 +7642,7 @@
},
"parentId": {
"description": "父菜单ID",
- "type": "string"
+ "type": "integer"
},
"path": {
"description": "路由path",
@@ -6554,6 +7661,10 @@
"system.SysBaseMenuBtn": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
@@ -6561,10 +7672,6 @@
"desc": {
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"name": {
"type": "string"
},
@@ -6580,14 +7687,14 @@
"system.SysBaseMenuParameter": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"key": {
"description": "地址栏携带参数的key",
"type": "string"
@@ -6612,6 +7719,10 @@
"system.SysDictionary": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
@@ -6620,10 +7731,6 @@
"description": "描述",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"name": {
"description": "字典名(中)",
"type": "string"
@@ -6651,13 +7758,17 @@
"system.SysDictionaryDetail": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"createdAt": {
"description": "创建时间",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
+ "extend": {
+ "description": "扩展值",
+ "type": "string"
},
"label": {
"description": "展示值",
@@ -6681,13 +7792,72 @@
},
"value": {
"description": "字典值",
+ "type": "string"
+ }
+ }
+ },
+ "system.SysExportTemplate": {
+ "type": "object",
+ "properties": {
+ "ID": {
+ "description": "主键ID",
"type": "integer"
+ },
+ "conditions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/system.Condition"
+ }
+ },
+ "createdAt": {
+ "description": "创建时间",
+ "type": "string"
+ },
+ "dbName": {
+ "description": "数据库名称",
+ "type": "string"
+ },
+ "joinTemplate": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/system.JoinTemplate"
+ }
+ },
+ "limit": {
+ "type": "integer"
+ },
+ "name": {
+ "description": "模板名称",
+ "type": "string"
+ },
+ "order": {
+ "type": "string"
+ },
+ "tableName": {
+ "description": "表名称",
+ "type": "string"
+ },
+ "templateID": {
+ "description": "模板标识",
+ "type": "string"
+ },
+ "templateInfo": {
+ "description": "模板信息",
+ "type": "string"
+ },
+ "updatedAt": {
+ "description": "更新时间",
+ "type": "string"
}
}
},
"system.SysMenu": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"authoritys": {
"type": "array",
"items": {
@@ -6718,10 +7888,6 @@
"description": "是否在列表隐藏",
"type": "boolean"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"menuBtn": {
"type": "array",
"items": {
@@ -6729,7 +7895,7 @@
}
},
"menuId": {
- "type": "string"
+ "type": "integer"
},
"meta": {
"description": "附加属性",
@@ -6751,7 +7917,7 @@
},
"parentId": {
"description": "父菜单ID",
- "type": "string"
+ "type": "integer"
},
"path": {
"description": "路由path",
@@ -6770,6 +7936,10 @@
"system.SysOperationRecord": {
"type": "object",
"properties": {
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
+ },
"agent": {
"description": "代理",
"type": "string"
@@ -6786,10 +7956,6 @@
"description": "错误信息",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"ip": {
"description": "请求ip",
"type": "string"
@@ -6830,9 +7996,9 @@
"system.SysUser": {
"type": "object",
"properties": {
- "activeColor": {
- "description": "活跃颜色",
- "type": "string"
+ "ID": {
+ "description": "主键ID",
+ "type": "integer"
},
"authorities": {
"type": "array",
@@ -6867,10 +8033,6 @@
"description": "用户头像",
"type": "string"
},
- "id": {
- "description": "主键ID",
- "type": "integer"
- },
"nickName": {
"description": "用户昵称",
"type": "string"
diff --git a/server/docs/swagger.yaml b/server/docs/swagger.yaml
index 4f1a69765..a1abe7792 100644
--- a/server/docs/swagger.yaml
+++ b/server/docs/swagger.yaml
@@ -16,34 +16,16 @@ definitions:
type: object
config.Autocode:
properties:
+ ai-path:
+ type: string
+ module:
+ type: string
root:
type: string
server:
type: string
- server-api:
- type: string
- server-initialize:
- type: string
- server-model:
- type: string
- server-plug:
- type: string
- server-request:
- type: string
- server-router:
- type: string
- server-service:
- type: string
- transfer-restart:
- type: boolean
web:
type: string
- web-api:
- type: string
- web-form:
- type: string
- web-table:
- type: string
type: object
config.AwsS3:
properties:
@@ -106,16 +88,24 @@ definitions:
description: 防爆破验证码超时时间,单位:s(秒)
type: integer
type: object
- config.Detail:
+ config.CloudflareR2:
properties:
- compareField:
- description: 需要比较时间的字段
+ access-key-id:
type: string
- interval:
- description: 时间间隔
+ account-id:
type: string
- tableName:
- description: 需要清理的表名
+ base-url:
+ type: string
+ bucket:
+ type: string
+ path:
+ type: string
+ secret-access-key:
+ type: string
+ type: object
+ config.DiskList:
+ properties:
+ mount-point:
type: string
type: object
config.Excel:
@@ -160,6 +150,56 @@ definitions:
description: 本地文件存储路径
type: string
type: object
+ config.Mongo:
+ properties:
+ auth-source:
+ description: 验证数据库
+ type: string
+ coll:
+ description: collection name
+ type: string
+ connect-timeout-ms:
+ description: 连接超时时间
+ type: integer
+ database:
+ description: database name
+ type: string
+ hosts:
+ description: 主机列表
+ items:
+ $ref: '#/definitions/config.MongoHost'
+ type: array
+ is-zap:
+ description: 是否开启zap日志
+ type: boolean
+ max-pool-size:
+ description: 最大连接池
+ type: integer
+ min-pool-size:
+ description: 最小连接池
+ type: integer
+ options:
+ description: mongodb options
+ type: string
+ password:
+ description: 密码
+ type: string
+ socket-timeout-ms:
+ description: socket超时时间
+ type: integer
+ username:
+ description: 用户名
+ type: string
+ type: object
+ config.MongoHost:
+ properties:
+ host:
+ description: ip地址
+ type: string
+ port:
+ description: 端口
+ type: string
+ type: object
config.Mssql:
properties:
config:
@@ -188,19 +228,19 @@ definitions:
description: 数据库密码
type: string
path:
- description: 服务器地址:端口
+ description: 数据库地址
type: string
port:
- description: :端口
+ description: 数据库端口
type: string
prefix:
- description: 全局表前缀,单独定义TableName则不生效
+ description: 数据库前缀
type: string
singular:
description: 是否开启全局禁用复数,true表示开启
type: boolean
username:
- description: 数据库用户名
+ description: 数据库账号
type: string
type: object
config.Mysql:
@@ -231,19 +271,19 @@ definitions:
description: 数据库密码
type: string
path:
- description: 服务器地址:端口
+ description: 数据库地址
type: string
port:
- description: :端口
+ description: 数据库端口
type: string
prefix:
- description: 全局表前缀,单独定义TableName则不生效
+ description: 数据库前缀
type: string
singular:
description: 是否开启全局禁用复数,true表示开启
type: boolean
username:
- description: 数据库用户名
+ description: 数据库账号
type: string
type: object
config.Oracle:
@@ -274,19 +314,19 @@ definitions:
description: 数据库密码
type: string
path:
- description: 服务器地址:端口
+ description: 数据库地址
type: string
port:
- description: :端口
+ description: 数据库端口
type: string
prefix:
- description: 全局表前缀,单独定义TableName则不生效
+ description: 数据库前缀
type: string
singular:
description: 是否开启全局禁用复数,true表示开启
type: boolean
username:
- description: 数据库用户名
+ description: 数据库账号
type: string
type: object
config.Pgsql:
@@ -317,19 +357,19 @@ definitions:
description: 数据库密码
type: string
path:
- description: 服务器地址:端口
+ description: 数据库地址
type: string
port:
- description: :端口
+ description: 数据库端口
type: string
prefix:
- description: 全局表前缀,单独定义TableName则不生效
+ description: 数据库前缀
type: string
singular:
description: 是否开启全局禁用复数,true表示开启
type: boolean
username:
- description: 数据库用户名
+ description: 数据库账号
type: string
type: object
config.Qiniu:
@@ -361,12 +401,20 @@ definitions:
addr:
description: 服务器地址:端口
type: string
+ clusterAddrs:
+ description: 集群模式下的节点地址列表
+ items:
+ type: string
+ type: array
db:
- description: redis的哪个数据库
+ description: 单实例模式下redis的哪个数据库
type: integer
password:
description: 密码
type: string
+ useCluster:
+ description: 是否使用集群模式
+ type: boolean
type: object
config.Server:
properties:
@@ -380,6 +428,8 @@ definitions:
$ref: '#/definitions/config.AwsS3'
captcha:
$ref: '#/definitions/config.Captcha'
+ cloudflare-r2:
+ $ref: '#/definitions/config.CloudflareR2'
cors:
allOf:
- $ref: '#/definitions/config.CORS'
@@ -388,6 +438,10 @@ definitions:
items:
$ref: '#/definitions/config.SpecializedDB'
type: array
+ disk-list:
+ items:
+ $ref: '#/definitions/config.DiskList'
+ type: array
email:
$ref: '#/definitions/github_com_flipped-aurora_gin-vue-admin_server_config.Email'
excel:
@@ -400,6 +454,8 @@ definitions:
allOf:
- $ref: '#/definitions/config.Local'
description: oss
+ mongo:
+ $ref: '#/definitions/config.Mongo'
mssql:
$ref: '#/definitions/config.Mssql'
mysql:
@@ -414,12 +470,12 @@ definitions:
$ref: '#/definitions/config.Qiniu'
redis:
$ref: '#/definitions/config.Redis'
+ sqlite:
+ $ref: '#/definitions/config.Sqlite'
system:
$ref: '#/definitions/config.System'
tencent-cos:
$ref: '#/definitions/config.TencentCOS'
- timer:
- $ref: '#/definitions/config.Timer'
zap:
$ref: '#/definitions/config.Zap'
type: object
@@ -455,13 +511,13 @@ definitions:
description: 数据库密码
type: string
path:
- description: 服务器地址:端口
+ description: 数据库地址
type: string
port:
- description: :端口
+ description: 数据库端口
type: string
prefix:
- description: 全局表前缀,单独定义TableName则不生效
+ description: 数据库前缀
type: string
singular:
description: 是否开启全局禁用复数,true表示开启
@@ -469,7 +525,50 @@ definitions:
type:
type: string
username:
- description: 数据库用户名
+ description: 数据库账号
+ type: string
+ type: object
+ config.Sqlite:
+ properties:
+ config:
+ description: 高级配置
+ type: string
+ db-name:
+ description: 数据库名
+ type: string
+ engine:
+ default: InnoDB
+ description: 数据库引擎,默认InnoDB
+ type: string
+ log-mode:
+ description: 是否开启Gorm全局日志
+ type: string
+ log-zap:
+ description: 是否通过zap写入日志文件
+ type: boolean
+ max-idle-conns:
+ description: 空闲中的最大连接数
+ type: integer
+ max-open-conns:
+ description: 打开到数据库的最大连接数
+ type: integer
+ password:
+ description: 数据库密码
+ type: string
+ path:
+ description: 数据库地址
+ type: string
+ port:
+ description: 数据库端口
+ type: string
+ prefix:
+ description: 数据库前缀
+ type: string
+ singular:
+ description: 是否开启全局禁用复数,true表示开启
+ type: boolean
+ username:
+ description: 数据库账号
type: string
type: object
config.System:
@@ -480,9 +579,6 @@ definitions:
db-type:
description: 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql
type: string
- env:
- description: 环境值
- type: string
iplimit-count:
type: integer
iplimit-time:
@@ -492,6 +588,9 @@ definitions:
type: string
router-prefix:
type: string
+ use-mongo:
+ description: 使用mongo
+ type: boolean
use-multipoint:
description: 多点登录拦截
type: boolean
@@ -514,22 +613,6 @@ definitions:
secret-key:
type: string
type: object
- config.Timer:
- properties:
- detail:
- items:
- $ref: '#/definitions/config.Detail'
- type: array
- spec:
- description: CRON表达式
- type: string
- start:
- description: 是否启用
- type: boolean
- with_seconds:
- description: 是否精确到秒
- type: boolean
- type: object
config.Zap:
properties:
director:
@@ -547,12 +630,12 @@ definitions:
log-in-console:
description: 输出控制台
type: boolean
- max-age:
- description: 日志留存时间
- type: integer
prefix:
description: 日志前缀
type: string
+ retention-day:
+ description: 日志保留天数
+ type: integer
show-line:
description: 显示行
type: boolean
@@ -562,6 +645,9 @@ definitions:
type: object
example.ExaCustomer:
properties:
+ ID:
+ description: 主键ID
+ type: integer
createdAt:
description: 创建时间
type: string
@@ -571,9 +657,6 @@ definitions:
customerPhoneData:
description: 客户手机号
type: string
- id:
- description: 主键ID
- type: integer
sysUser:
allOf:
- $ref: '#/definitions/system.SysUser'
@@ -590,6 +673,9 @@ definitions:
type: object
example.ExaFile:
properties:
+ ID:
+ description: 主键ID
+ type: integer
chunkTotal:
type: integer
createdAt:
@@ -605,9 +691,6 @@ definitions:
type: string
filePath:
type: string
- id:
- description: 主键ID
- type: integer
isFinish:
type: boolean
updatedAt:
@@ -616,6 +699,9 @@ definitions:
type: object
example.ExaFileChunk:
properties:
+ ID:
+ description: 主键ID
+ type: integer
createdAt:
description: 创建时间
type: string
@@ -625,21 +711,18 @@ definitions:
type: integer
fileChunkPath:
type: string
- id:
- description: 主键ID
- type: integer
updatedAt:
description: 更新时间
type: string
type: object
example.ExaFileUploadAndDownload:
properties:
+ ID:
+ description: 主键ID
+ type: integer
createdAt:
description: 创建时间
type: string
- id:
- description: 主键ID
- type: integer
key:
description: 编号
type: string
@@ -659,27 +742,53 @@ definitions:
github_com_flipped-aurora_gin-vue-admin_server_config.Email:
properties:
from:
- description: 收件人
+ description: 发件人 你自己要发邮件的邮箱
type: string
host:
- description: 服务器地址
+ description: 服务器地址 例如 smtp.qq.com 请前往QQ或者你要发邮件的邮箱查看其smtp协议
type: string
is-ssl:
- description: 是否SSL
+ description: 是否SSL 是否开启SSL
type: boolean
nickname:
- description: 昵称
+ description: 昵称 发件人昵称 通常为自己的邮箱
type: string
port:
- description: 端口
+ description: 端口 请前往QQ或者你要发邮件的邮箱查看其smtp协议 大多为 465
type: integer
secret:
- description: 密钥
+ description: 密钥 用于登录的密钥 最好不要用邮箱密码 去邮箱smtp申请一个用于登录的密钥
type: string
to:
- description: 收件人:多个以英文逗号分隔
+ description: 收件人:多个以英文逗号分隔 例:a@qq.com b@qq.com 正式开发中请把此项目作为参数使用
type: string
type: object
+ model.Info:
+ properties:
+ ID:
+ description: 主键ID
+ type: integer
+ attachments:
+ description: 附件
+ items:
+ type: object
+ type: array
+ content:
+ description: 内容
+ type: string
+ createdAt:
+ description: 创建时间
+ type: string
+ title:
+ description: 标题
+ type: string
+ updatedAt:
+ description: 更新时间
+ type: string
+ userID:
+ description: 作者
+ type: integer
+ type: object
request.AddMenuAuthorityInfo:
properties:
authorityId:
@@ -690,6 +799,8 @@ definitions:
$ref: '#/definitions/system.SysBaseMenu'
type: array
type: object
+ request.AutoCode:
+ type: object
request.CasbinInReceive:
properties:
authorityId:
@@ -741,9 +852,14 @@ definitions:
type: object
request.InitDB:
properties:
+ adminPassword:
+ type: string
dbName:
description: 数据库名
type: string
+ dbPath:
+ description: sqlite数据库文件路径
+ type: string
dbType:
description: 数据库类型
type: string
@@ -760,8 +876,8 @@ definitions:
description: 数据库用户名
type: string
required:
+ - adminPassword
- dbName
- - userName
type: object
request.Login:
properties:
@@ -820,17 +936,11 @@ definitions:
example: 用户名
type: string
type: object
- request.RollBack:
- properties:
- deleteTable:
- description: 是否删除表
- type: boolean
- id:
- description: 主键ID
- type: integer
- type: object
request.SearchApiParams:
properties:
+ ID:
+ description: 主键ID
+ type: integer
apiGroup:
description: api组
type: string
@@ -843,9 +953,6 @@ definitions:
description:
description: api中文描述
type: string
- id:
- description: 主键ID
- type: integer
keyword:
description: 关键字
type: string
@@ -895,16 +1002,34 @@ definitions:
type: integer
type: array
type: object
- request.SysAutoHistory:
+ request.SysAutoCodePackageCreate:
properties:
- keyword:
- description: 关键字
+ desc:
+ example: 描述
type: string
- page:
- description: 页码
- type: integer
- pageSize:
- description: 每页大小
+ label:
+ example: 展示名
+ type: string
+ packageName:
+ example: 包名
+ type: string
+ template:
+ example: 模版
+ type: string
+ type: object
+ request.SysAutoHistoryRollBack:
+ properties:
+ deleteApi:
+ description: 是否删除接口
+ type: boolean
+ deleteMenu:
+ description: 是否删除菜单
+ type: boolean
+ deleteTable:
+ description: 是否删除表
+ type: boolean
+ id:
+ description: 主键ID
type: integer
type: object
response.Email:
@@ -1045,88 +1170,45 @@ definitions:
user:
$ref: '#/definitions/system.SysUser'
type: object
- system.AutoCodeStruct:
+ system.Condition:
properties:
- abbreviation:
- description: Struct简称
+ ID:
+ description: 主键ID
+ type: integer
+ column:
type: string
- autoCreateApiToSql:
- description: 是否自动创建api
- type: boolean
- autoCreateResource:
- description: 是否自动创建资源标识
- type: boolean
- autoMoveFile:
- description: 是否自动移动文件
- type: boolean
- businessDB:
- description: 业务数据库
+ createdAt:
+ description: 创建时间
type: string
- description:
- description: Struct中文名称
+ from:
type: string
- fields:
- items:
- $ref: '#/definitions/system.Field'
- type: array
- hasTimer:
- type: boolean
- humpPackageName:
- description: go文件名称
+ operator:
type: string
- package:
+ templateID:
type: string
- packageName:
- description: 文件名称
- type: string
- structName:
- description: Struct名称
- type: string
- tableName:
- description: 表名
+ updatedAt:
+ description: 更新时间
type: string
type: object
- system.Field:
+ system.JoinTemplate:
properties:
- clearable:
- description: 是否可清空
- type: boolean
- columnName:
- description: 数据库字段
+ ID:
+ description: 主键ID
+ type: integer
+ createdAt:
+ description: 创建时间
type: string
- comment:
- description: 数据库字段描述
+ joins:
type: string
- dataTypeLong:
- description: 数据库字段长度
+ "on":
type: string
- dictType:
- description: 字典
+ table:
type: string
- errorText:
- description: 校验失败文字
+ templateID:
type: string
- fieldDesc:
- description: 中文名
+ updatedAt:
+ description: 更新时间
type: string
- fieldJson:
- description: FieldJson
- type: string
- fieldName:
- description: Field名
- type: string
- fieldSearchType:
- description: 搜索条件
- type: string
- fieldType:
- description: Field数据类型
- type: string
- require:
- description: 是否必填
- type: boolean
- sort:
- description: 是否增加排序
- type: boolean
type: object
system.Meta:
properties:
@@ -1150,6 +1232,9 @@ definitions:
type: object
system.SysApi:
properties:
+ ID:
+ description: 主键ID
+ type: integer
apiGroup:
description: api组
type: string
@@ -1159,9 +1244,6 @@ definitions:
description:
description: api中文描述
type: string
- id:
- description: 主键ID
- type: integer
method:
description: 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE
type: string
@@ -1207,26 +1289,11 @@ definitions:
description: 更新时间
type: string
type: object
- system.SysAutoCode:
- properties:
- createdAt:
- description: 创建时间
- type: string
- desc:
- type: string
- id:
- description: 主键ID
- type: integer
- label:
- type: string
- packageName:
- type: string
- updatedAt:
- description: 更新时间
- type: string
- type: object
system.SysBaseMenu:
properties:
+ ID:
+ description: 主键ID
+ type: integer
authoritys:
items:
$ref: '#/definitions/system.SysAuthority'
@@ -1244,9 +1311,6 @@ definitions:
hidden:
description: 是否在列表隐藏
type: boolean
- id:
- description: 主键ID
- type: integer
menuBtn:
items:
$ref: '#/definitions/system.SysBaseMenuBtn'
@@ -1264,7 +1328,7 @@ definitions:
type: array
parentId:
description: 父菜单ID
- type: string
+ type: integer
path:
description: 路由path
type: string
@@ -1277,14 +1341,14 @@ definitions:
type: object
system.SysBaseMenuBtn:
properties:
+ ID:
+ description: 主键ID
+ type: integer
createdAt:
description: 创建时间
type: string
desc:
type: string
- id:
- description: 主键ID
- type: integer
name:
type: string
sysBaseMenuID:
@@ -1295,12 +1359,12 @@ definitions:
type: object
system.SysBaseMenuParameter:
properties:
+ ID:
+ description: 主键ID
+ type: integer
createdAt:
description: 创建时间
type: string
- id:
- description: 主键ID
- type: integer
key:
description: 地址栏携带参数的key
type: string
@@ -1318,15 +1382,15 @@ definitions:
type: object
system.SysDictionary:
properties:
+ ID:
+ description: 主键ID
+ type: integer
createdAt:
description: 创建时间
type: string
desc:
description: 描述
type: string
- id:
- description: 主键ID
- type: integer
name:
description: 字典名(中)
type: string
@@ -1346,12 +1410,15 @@ definitions:
type: object
system.SysDictionaryDetail:
properties:
+ ID:
+ description: 主键ID
+ type: integer
createdAt:
description: 创建时间
type: string
- id:
- description: 主键ID
- type: integer
+ extend:
+ description: 扩展值
+ type: string
label:
description: 展示值
type: string
@@ -1369,10 +1436,52 @@ definitions:
type: string
value:
description: 字典值
+ type: string
+ type: object
+ system.SysExportTemplate:
+ properties:
+ ID:
+ description: 主键ID
type: integer
+ conditions:
+ items:
+ $ref: '#/definitions/system.Condition'
+ type: array
+ createdAt:
+ description: 创建时间
+ type: string
+ dbName:
+ description: 数据库名称
+ type: string
+ joinTemplate:
+ items:
+ $ref: '#/definitions/system.JoinTemplate'
+ type: array
+ limit:
+ type: integer
+ name:
+ description: 模板名称
+ type: string
+ order:
+ type: string
+ tableName:
+ description: 表名称
+ type: string
+ templateID:
+ description: 模板标识
+ type: string
+ templateInfo:
+ description: 模板信息
+ type: string
+ updatedAt:
+ description: 更新时间
+ type: string
type: object
system.SysMenu:
properties:
+ ID:
+ description: 主键ID
+ type: integer
authoritys:
items:
$ref: '#/definitions/system.SysAuthority'
@@ -1394,15 +1503,12 @@ definitions:
hidden:
description: 是否在列表隐藏
type: boolean
- id:
- description: 主键ID
- type: integer
menuBtn:
items:
$ref: '#/definitions/system.SysBaseMenuBtn'
type: array
menuId:
- type: string
+ type: integer
meta:
allOf:
- $ref: '#/definitions/system.Meta'
@@ -1416,7 +1522,7 @@ definitions:
type: array
parentId:
description: 父菜单ID
- type: string
+ type: integer
path:
description: 路由path
type: string
@@ -1429,6 +1535,9 @@ definitions:
type: object
system.SysOperationRecord:
properties:
+ ID:
+ description: 主键ID
+ type: integer
agent:
description: 代理
type: string
@@ -1441,9 +1550,6 @@ definitions:
error_message:
description: 错误信息
type: string
- id:
- description: 主键ID
- type: integer
ip:
description: 请求ip
type: string
@@ -1473,9 +1579,9 @@ definitions:
type: object
system.SysUser:
properties:
- activeColor:
- description: 活跃颜色
- type: string
+ ID:
+ description: 主键ID
+ type: integer
authorities:
items:
$ref: '#/definitions/system.SysAuthority'
@@ -1500,9 +1606,6 @@ definitions:
headerImg:
description: 用户头像
type: string
- id:
- description: 主键ID
- type: integer
nickName:
description: 用户昵称
type: string
@@ -1529,9 +1632,9 @@ definitions:
type: object
info:
contact: {}
- description: This is a sample Server pets
- title: Swagger Example API
- version: 0.0.1
+ description: 使用gin+vue进行极速开发的全栈开发基础平台
+ title: Gin-Vue-Admin Swagger API接口文档
+ version: v2.7.0
paths:
/api/createApi:
post:
@@ -1617,6 +1720,27 @@ paths:
summary: 删除选中Api
tags:
- SysApi
+ /api/enterSyncApi:
+ post:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 确认同步API
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 确认同步API
+ tags:
+ - SysApi
/api/freshCasbin:
get:
consumes:
@@ -1687,6 +1811,27 @@ paths:
summary: 根据id获取api
tags:
- SysApi
+ /api/getApiGroups:
+ post:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 获取API分组
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 获取API分组
+ tags:
+ - SysApi
/api/getApiList:
post:
consumes:
@@ -1717,6 +1862,48 @@ paths:
summary: 分页获取API列表
tags:
- SysApi
+ /api/ignoreApi:
+ post:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 同步API
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 忽略API
+ tags:
+ - IgnoreApi
+ /api/syncApi:
+ get:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 同步API
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 同步API
+ tags:
+ - SysApi
/api/updateApi:
post:
consumes:
@@ -2000,6 +2187,29 @@ paths:
summary: 设置权限按钮
tags:
- AuthorityBtn
+ /autoCode/addFunc:
+ post:
+ consumes:
+ - application/json
+ parameters:
+ - description: 增加方法
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/request.AutoCode'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: '{"success":true,"data":{},"msg":"创建成功"}'
+ schema:
+ type: string
+ security:
+ - ApiKeyAuth: []
+ summary: 增加方法
+ tags:
+ - AddFunc
/autoCode/createPackage:
post:
consumes:
@@ -2010,7 +2220,7 @@ paths:
name: data
required: true
schema:
- $ref: '#/definitions/system.SysAutoCode'
+ $ref: '#/definitions/request.SysAutoCodePackageCreate'
produces:
- application/json
responses:
@@ -2030,38 +2240,7 @@ paths:
- ApiKeyAuth: []
summary: 创建package
tags:
- - AutoCode
- /autoCode/createPlug:
- post:
- consumes:
- - multipart/form-data
- parameters:
- - description: this is a test file
- in: formData
- name: plug
- required: true
- type: file
- produces:
- - application/json
- responses:
- "200":
- description: 安装插件成功
- schema:
- allOf:
- - $ref: '#/definitions/response.Response'
- - properties:
- data:
- items:
- type: object
- type: array
- msg:
- type: string
- type: object
- security:
- - ApiKeyAuth: []
- summary: 安装插件
- tags:
- - AutoCode
+ - AutoCodePackage
/autoCode/createTemp:
post:
consumes:
@@ -2072,7 +2251,7 @@ paths:
name: data
required: true
schema:
- $ref: '#/definitions/system.AutoCodeStruct'
+ $ref: '#/definitions/request.AutoCode'
produces:
- application/json
responses:
@@ -2084,7 +2263,7 @@ paths:
- ApiKeyAuth: []
summary: 自动代码模板
tags:
- - AutoCode
+ - AutoCodeTemplate
/autoCode/delPackage:
post:
consumes:
@@ -2095,7 +2274,7 @@ paths:
name: data
required: true
schema:
- $ref: '#/definitions/system.SysAutoCode'
+ $ref: '#/definitions/request.GetById'
produces:
- application/json
responses:
@@ -2246,7 +2425,7 @@ paths:
- ApiKeyAuth: []
summary: 获取package
tags:
- - AutoCode
+ - AutoCodePackage
/autoCode/getSysHistory:
post:
consumes:
@@ -2257,7 +2436,7 @@ paths:
name: data
required: true
schema:
- $ref: '#/definitions/request.SysAutoHistory'
+ $ref: '#/definitions/request.PageInfo'
produces:
- application/json
responses:
@@ -2301,6 +2480,61 @@ paths:
summary: 获取当前数据库所有表
tags:
- AutoCode
+ /autoCode/getTemplates:
+ get:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 创建package成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ data:
+ additionalProperties: true
+ type: object
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 获取package
+ tags:
+ - AutoCodePackage
+ /autoCode/installPlugin:
+ post:
+ consumes:
+ - multipart/form-data
+ parameters:
+ - description: this is a test file
+ in: formData
+ name: plug
+ required: true
+ type: file
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 安装插件成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ data:
+ items:
+ type: object
+ type: array
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 安装插件
+ tags:
+ - AutoCodePlugin
/autoCode/preview:
post:
consumes:
@@ -2311,7 +2545,7 @@ paths:
name: data
required: true
schema:
- $ref: '#/definitions/system.AutoCodeStruct'
+ $ref: '#/definitions/request.AutoCode'
produces:
- application/json
responses:
@@ -2331,7 +2565,37 @@ paths:
- ApiKeyAuth: []
summary: 预览创建后的代码
tags:
- - AutoCode
+ - AutoCodeTemplate
+ /autoCode/pubPlug:
+ get:
+ consumes:
+ - application/json
+ parameters:
+ - description: 插件名称
+ in: query
+ name: plugName
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 打包插件成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ data:
+ additionalProperties: true
+ type: object
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 打包插件
+ tags:
+ - AutoCodePlugin
/autoCode/rollback:
post:
consumes:
@@ -2342,7 +2606,7 @@ paths:
name: data
required: true
schema:
- $ref: '#/definitions/request.RollBack'
+ $ref: '#/definitions/request.SysAutoHistoryRollBack'
produces:
- application/json
responses:
@@ -2499,6 +2763,10 @@ paths:
consumes:
- application/json
parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
- description: 创建时间
in: query
name: createdAt
@@ -2511,10 +2779,6 @@ paths:
in: query
name: customerPhoneData
type: string
- - description: 主键ID
- in: query
- name: id
- type: integer
- description: 管理角色ID
in: query
name: sysUserAuthorityID
@@ -2839,6 +3103,262 @@ paths:
summary: 上传文件示例
tags:
- ExaFileUploadAndDownload
+ /info/createInfo:
+ post:
+ consumes:
+ - application/json
+ parameters:
+ - description: 创建公告
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/model.Info'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 创建成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 创建公告
+ tags:
+ - Info
+ /info/deleteInfo:
+ delete:
+ consumes:
+ - application/json
+ parameters:
+ - description: 删除公告
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/model.Info'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 删除成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 删除公告
+ tags:
+ - Info
+ /info/deleteInfoByIds:
+ delete:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 批量删除成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 批量删除公告
+ tags:
+ - Info
+ /info/findInfo:
+ get:
+ consumes:
+ - application/json
+ parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
+ - description: 内容
+ in: query
+ name: content
+ type: string
+ - description: 创建时间
+ in: query
+ name: createdAt
+ type: string
+ - description: 标题
+ in: query
+ name: title
+ type: string
+ - description: 更新时间
+ in: query
+ name: updatedAt
+ type: string
+ - description: 作者
+ in: query
+ name: userID
+ type: integer
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 查询成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/model.Info'
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 用id查询公告
+ tags:
+ - Info
+ /info/getInfoDataSource:
+ get:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 查询成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ data:
+ type: object
+ msg:
+ type: string
+ type: object
+ summary: 获取Info的数据源
+ tags:
+ - Info
+ /info/getInfoList:
+ get:
+ consumes:
+ - application/json
+ parameters:
+ - in: query
+ name: endCreatedAt
+ type: string
+ - description: 关键字
+ in: query
+ name: keyword
+ type: string
+ - description: 页码
+ in: query
+ name: page
+ type: integer
+ - description: 每页大小
+ in: query
+ name: pageSize
+ type: integer
+ - in: query
+ name: startCreatedAt
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 获取成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/response.PageResult'
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 分页获取公告列表
+ tags:
+ - Info
+ /info/getInfoPublic:
+ get:
+ consumes:
+ - application/json
+ parameters:
+ - in: query
+ name: endCreatedAt
+ type: string
+ - description: 关键字
+ in: query
+ name: keyword
+ type: string
+ - description: 页码
+ in: query
+ name: page
+ type: integer
+ - description: 每页大小
+ in: query
+ name: pageSize
+ type: integer
+ - in: query
+ name: startCreatedAt
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 获取成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ data:
+ type: object
+ msg:
+ type: string
+ type: object
+ summary: 不需要鉴权的公告接口
+ tags:
+ - Info
+ /info/updateInfo:
+ put:
+ consumes:
+ - application/json
+ parameters:
+ - description: 更新公告
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/model.Info'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 更新成功
+ schema:
+ allOf:
+ - $ref: '#/definitions/response.Response'
+ - properties:
+ msg:
+ type: string
+ type: object
+ security:
+ - ApiKeyAuth: []
+ summary: 更新公告
+ tags:
+ - Info
/init/checkdb:
post:
produces:
@@ -3224,6 +3744,10 @@ paths:
consumes:
- application/json
parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
- description: 创建时间
in: query
name: createdAt
@@ -3232,10 +3756,6 @@ paths:
in: query
name: desc
type: string
- - description: 主键ID
- in: query
- name: id
- type: integer
- description: 字典名(中)
in: query
name: name
@@ -3276,47 +3796,6 @@ paths:
get:
consumes:
- application/json
- parameters:
- - description: 创建时间
- in: query
- name: createdAt
- type: string
- - description: 描述
- in: query
- name: desc
- type: string
- - description: 主键ID
- in: query
- name: id
- type: integer
- - description: 关键字
- in: query
- name: keyword
- type: string
- - description: 字典名(中)
- in: query
- name: name
- type: string
- - description: 页码
- in: query
- name: page
- type: integer
- - description: 每页大小
- in: query
- name: pageSize
- type: integer
- - description: 状态
- in: query
- name: status
- type: boolean
- - description: 字典名(英)
- in: query
- name: type
- type: string
- - description: 更新时间
- in: query
- name: updatedAt
- type: string
produces:
- application/json
responses:
@@ -3425,14 +3904,18 @@ paths:
consumes:
- application/json
parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
- description: 创建时间
in: query
name: createdAt
type: string
- - description: 主键ID
+ - description: 扩展值
in: query
- name: id
- type: integer
+ name: extend
+ type: string
- description: 展示值
in: query
name: label
@@ -3456,7 +3939,7 @@ paths:
- description: 字典值
in: query
name: value
- type: integer
+ type: string
produces:
- application/json
responses:
@@ -3482,14 +3965,18 @@ paths:
consumes:
- application/json
parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
- description: 创建时间
in: query
name: createdAt
type: string
- - description: 主键ID
+ - description: 扩展值
in: query
- name: id
- type: integer
+ name: extend
+ type: string
- description: 关键字
in: query
name: keyword
@@ -3525,7 +4012,7 @@ paths:
- description: 字典值
in: query
name: value
- type: integer
+ type: string
produces:
- application/json
responses:
@@ -3573,6 +4060,250 @@ paths:
summary: 更新SysDictionaryDetail
tags:
- SysDictionaryDetail
+ /sysExportTemplate/createSysExportTemplate:
+ post:
+ consumes:
+ - application/json
+ parameters:
+ - description: 创建导出模板
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/system.SysExportTemplate'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: '{"success":true,"data":{},"msg":"创建成功"}'
+ schema:
+ type: string
+ security:
+ - ApiKeyAuth: []
+ summary: 创建导出模板
+ tags:
+ - SysExportTemplate
+ /sysExportTemplate/deleteSysExportTemplate:
+ delete:
+ consumes:
+ - application/json
+ parameters:
+ - description: 删除导出模板
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/system.SysExportTemplate'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: '{"success":true,"data":{},"msg":"删除成功"}'
+ schema:
+ type: string
+ security:
+ - ApiKeyAuth: []
+ summary: 删除导出模板
+ tags:
+ - SysExportTemplate
+ /sysExportTemplate/deleteSysExportTemplateByIds:
+ delete:
+ consumes:
+ - application/json
+ parameters:
+ - description: 批量删除导出模板
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/request.IdsReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: '{"success":true,"data":{},"msg":"批量删除成功"}'
+ schema:
+ type: string
+ security:
+ - ApiKeyAuth: []
+ summary: 批量删除导出模板
+ tags:
+ - SysExportTemplate
+ /sysExportTemplate/exportExcel:
+ get:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses: {}
+ security:
+ - ApiKeyAuth: []
+ summary: 导出表格模板
+ tags:
+ - SysExportTemplate
+ /sysExportTemplate/findSysExportTemplate:
+ get:
+ consumes:
+ - application/json
+ parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
+ - description: 创建时间
+ in: query
+ name: createdAt
+ type: string
+ - description: 数据库名称
+ in: query
+ name: dbName
+ type: string
+ - in: query
+ name: limit
+ type: integer
+ - description: 模板名称
+ in: query
+ name: name
+ type: string
+ - in: query
+ name: order
+ type: string
+ - description: 表名称
+ in: query
+ name: tableName
+ type: string
+ - description: 模板标识
+ in: query
+ name: templateID
+ type: string
+ - description: 模板信息
+ in: query
+ name: templateInfo
+ type: string
+ - description: 更新时间
+ in: query
+ name: updatedAt
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: '{"success":true,"data":{},"msg":"查询成功"}'
+ schema:
+ type: string
+ security:
+ - ApiKeyAuth: []
+ summary: 用id查询导出模板
+ tags:
+ - SysExportTemplate
+ /sysExportTemplate/getSysExportTemplateList:
+ get:
+ consumes:
+ - application/json
+ parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
+ - description: 创建时间
+ in: query
+ name: createdAt
+ type: string
+ - description: 数据库名称
+ in: query
+ name: dbName
+ type: string
+ - in: query
+ name: endCreatedAt
+ type: string
+ - description: 关键字
+ in: query
+ name: keyword
+ type: string
+ - in: query
+ name: limit
+ type: integer
+ - description: 模板名称
+ in: query
+ name: name
+ type: string
+ - in: query
+ name: order
+ type: string
+ - description: 页码
+ in: query
+ name: page
+ type: integer
+ - description: 每页大小
+ in: query
+ name: pageSize
+ type: integer
+ - in: query
+ name: startCreatedAt
+ type: string
+ - description: 表名称
+ in: query
+ name: tableName
+ type: string
+ - description: 模板标识
+ in: query
+ name: templateID
+ type: string
+ - description: 模板信息
+ in: query
+ name: templateInfo
+ type: string
+ - description: 更新时间
+ in: query
+ name: updatedAt
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: '{"success":true,"data":{},"msg":"获取成功"}'
+ schema:
+ type: string
+ security:
+ - ApiKeyAuth: []
+ summary: 分页获取导出模板列表
+ tags:
+ - SysExportTemplate
+ /sysExportTemplate/importExcel:
+ post:
+ consumes:
+ - application/json
+ produces:
+ - application/json
+ responses: {}
+ security:
+ - ApiKeyAuth: []
+ summary: 导入表格
+ tags:
+ - SysImportTemplate
+ /sysExportTemplate/updateSysExportTemplate:
+ put:
+ consumes:
+ - application/json
+ parameters:
+ - description: 更新导出模板
+ in: body
+ name: data
+ required: true
+ schema:
+ $ref: '#/definitions/system.SysExportTemplate'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: '{"success":true,"data":{},"msg":"更新成功"}'
+ schema:
+ type: string
+ security:
+ - ApiKeyAuth: []
+ summary: 更新导出模板
+ tags:
+ - SysExportTemplate
/sysOperationRecord/createSysOperationRecord:
post:
consumes:
@@ -3662,6 +4393,10 @@ paths:
consumes:
- application/json
parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
- description: 代理
in: query
name: agent
@@ -3678,10 +4413,6 @@ paths:
in: query
name: error_message
type: string
- - description: 主键ID
- in: query
- name: id
- type: integer
- description: 请求ip
in: query
name: ip
@@ -3739,6 +4470,10 @@ paths:
consumes:
- application/json
parameters:
+ - description: 主键ID
+ in: query
+ name: ID
+ type: integer
- description: 代理
in: query
name: agent
@@ -3755,10 +4490,6 @@ paths:
in: query
name: error_message
type: string
- - description: 主键ID
- in: query
- name: id
- type: integer
- description: 请求ip
in: query
name: ip
diff --git a/server/global/global.go b/server/global/global.go
index 9eee3dc5a..ebbaf3eb5 100644
--- a/server/global/global.go
+++ b/server/global/global.go
@@ -3,6 +3,9 @@ package global
import (
"sync"
+ "github.com/gin-gonic/gin"
+ "github.com/qiniu/qmgo"
+
"github.com/flipped-aurora/gin-vue-admin/server/utils/timer"
"github.com/flipped-aurora/gin-vue-admin/server/utils/translate"
"github.com/songzhibin97/gkit/cache/local_cache"
@@ -21,16 +24,17 @@ import (
var (
GVA_DB *gorm.DB
GVA_DBList map[string]*gorm.DB
- GVA_REDIS *redis.Client
+ GVA_REDIS redis.UniversalClient
+ GVA_MONGO *qmgo.QmgoClient
GVA_CONFIG config.Server
GVA_VP *viper.Viper
// GVA_LOG *oplogging.Logger
GVA_LOG *zap.Logger
GVA_Timer timer.Timer = timer.NewTimerTask()
GVA_Concurrency_Control = &singleflight.Group{}
-
- BlackCache local_cache.Cache
- lock sync.RWMutex
+ GVA_ROUTERS gin.RoutesInfo
+ BlackCache local_cache.Cache
+ lock sync.RWMutex
GVA_TRANSLATOR translate.Translator // added by mohamed hassan to support multilanguage
)
diff --git a/server/global/model.go b/server/global/model.go
index 2a497bd1e..9772eb312 100644
--- a/server/global/model.go
+++ b/server/global/model.go
@@ -7,7 +7,7 @@ import (
)
type GVA_MODEL struct {
- ID uint `gorm:"primarykey"` // 主键ID
+ ID uint `gorm:"primarykey" json:"ID"` // 主键ID
CreatedAt time.Time // 创建时间
UpdatedAt time.Time // 更新时间
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间
diff --git a/server/go.mod b/server/go.mod
index 03ee224e3..fdf5fc577 100644
--- a/server/go.mod
+++ b/server/go.mod
@@ -1,93 +1,108 @@
module github.com/flipped-aurora/gin-vue-admin/server
-go 1.18
+go 1.22
require (
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible
github.com/aws/aws-sdk-go v1.44.307
- github.com/casbin/casbin/v2 v2.71.1
+ github.com/casbin/casbin/v2 v2.87.1
github.com/casbin/gorm-adapter/v3 v3.18.0
github.com/flipped-aurora/ws v1.0.2
github.com/fsnotify/fsnotify v1.6.0
github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6
github.com/gin-gonic/gin v1.9.1
github.com/glebarez/sqlite v1.8.0
- github.com/go-sql-driver/mysql v1.7.1
+ github.com/go-sql-driver/mysql v1.8.1
+ github.com/goccy/go-json v0.10.2
github.com/gofrs/uuid/v5 v5.0.0
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/gookit/color v1.5.4
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.8+incompatible
github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84
- github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
- github.com/mojocn/base64Captcha v1.3.5
+ github.com/mholt/archiver/v4 v4.0.0-alpha.8
+ github.com/mojocn/base64Captcha v1.3.6
github.com/nicksnyder/go-i18n/v2 v2.2.0
github.com/otiai10/copy v1.7.0
github.com/pkg/errors v0.9.1
github.com/qiniu/api.v7/v7 v7.4.1
+ github.com/qiniu/qmgo v1.1.8
github.com/redis/go-redis/v9 v9.0.5
github.com/robfig/cron/v3 v3.0.1
- github.com/sashabaranov/go-openai v1.14.1
github.com/shirou/gopsutil/v3 v3.23.6
github.com/songzhibin97/gkit v1.2.11
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/swaggo/files v1.0.1
github.com/swaggo/gin-swagger v1.6.0
- github.com/swaggo/swag v1.16.1
+ github.com/swaggo/swag v1.16.2
github.com/tencentyun/cos-go-sdk-v5 v0.7.42
github.com/unrolled/secure v1.13.0
+ github.com/xuri/excelize/v2 v2.8.0
+ go.mongodb.org/mongo-driver v1.12.1
+ go.uber.org/automaxprocs v1.5.3
go.uber.org/zap v1.24.0
- golang.org/x/crypto v0.10.0
- golang.org/x/sync v0.3.0
- golang.org/x/text v0.11.0
- gorm.io/driver/mysql v1.5.1
- gorm.io/driver/postgres v1.5.2
+ golang.org/x/crypto v0.22.0
+ golang.org/x/sync v0.6.0
+ golang.org/x/text v0.14.0
+ gorm.io/datatypes v1.2.1
+ gorm.io/driver/mysql v1.5.6
+ gorm.io/driver/postgres v1.5.7
gorm.io/driver/sqlserver v1.5.1
- gorm.io/gorm v1.25.2
+ gorm.io/gen v0.3.26
+ gorm.io/gorm v1.25.10
nhooyr.io/websocket v1.8.7
)
require (
- github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
+ filippo.io/edwards25519 v1.1.0 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
+ github.com/andybalholm/brotli v1.0.4 // indirect
+ github.com/bodgit/plumbing v1.2.0 // indirect
+ github.com/bodgit/sevenzip v1.3.0 // indirect
+ github.com/bodgit/windows v1.0.0 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
+ github.com/casbin/govaluate v1.1.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/clbanning/mxj v1.8.4 // indirect
+ github.com/connesc/cipherio v0.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
+ github.com/dsnet/compress v0.0.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/glebarez/go-sqlite v1.21.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
- github.com/go-openapi/jsonpointer v0.19.6 // indirect
- github.com/go-openapi/jsonreference v0.20.2 // indirect
- github.com/go-openapi/spec v0.20.9 // indirect
- github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-openapi/jsonpointer v0.20.2 // indirect
+ github.com/go-openapi/jsonreference v0.20.3 // indirect
+ github.com/go-openapi/spec v0.20.12 // indirect
+ github.com/go-openapi/swag v0.22.5 // 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.14.0 // indirect
- github.com/goccy/go-json v0.10.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/snappy v0.0.4 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/uuid v1.3.0 // indirect
+ github.com/hashicorp/errwrap v1.1.0 // indirect
+ github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
- github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
- github.com/jackc/pgx/v5 v5.3.1 // indirect
+ github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
+ github.com/jackc/pgx/v5 v5.5.5 // indirect
+ github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
- github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/compress v1.13.6 // indirect
+ github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
+ github.com/klauspost/pgzip v1.2.5 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
- github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
@@ -96,36 +111,52 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
+ github.com/montanaflynn/stats v0.7.0 // indirect
github.com/mozillazg/go-httpheader v0.2.1 // indirect
+ github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
+ github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
- github.com/rogpeppe/go-internal v1.11.0 // indirect
+ github.com/richardlehane/mscfb v1.0.4 // indirect
+ github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
+ github.com/therootcompany/xz v1.0.1 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
+ github.com/ulikunitz/xz v0.5.10 // indirect
+ github.com/xdg-go/pbkdf2 v1.0.0 // indirect
+ github.com/xdg-go/scram v1.1.2 // indirect
+ github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
+ github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca // indirect
+ github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a // indirect
+ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
+ go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
golang.org/x/arch v0.3.0 // indirect
- golang.org/x/image v0.5.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/sys v0.10.0 // indirect
+ golang.org/x/image v0.15.0 // indirect
+ golang.org/x/mod v0.14.0 // indirect
+ golang.org/x/net v0.21.0 // indirect
+ golang.org/x/sys v0.19.0 // indirect
golang.org/x/time v0.1.0 // indirect
- golang.org/x/tools v0.9.1 // indirect
- google.golang.org/protobuf v1.30.0 // indirect
+ golang.org/x/tools v0.17.0 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- gorm.io/plugin/dbresolver v1.4.1 // indirect
+ gorm.io/hints v1.1.0 // indirect
+ gorm.io/plugin/dbresolver v1.5.0 // indirect
modernc.org/libc v1.24.1 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.6.0 // indirect
diff --git a/server/go.sum b/server/go.sum
index c69585f89..8ad870b30 100644
--- a/server/go.sum
+++ b/server/go.sum
@@ -36,6 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
+filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
+filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM=
@@ -44,25 +46,37 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU=
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
-github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw=
-github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible h1:KpbJFXwhVeuxNtBJ74MCGbIoaBok2uZvkD7QXp2+Wis=
github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
+github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
+github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/aws/aws-sdk-go v1.44.307 h1:2R0/EPgpZcFSUwZhYImq/srjaOrOfLv5MNRzrFyAM38=
github.com/aws/aws-sdk-go v1.44.307/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
+github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
+github.com/bodgit/plumbing v1.2.0 h1:gg4haxoKphLjml+tgnecR4yLBV5zo4HAZGCtAh3xCzM=
+github.com/bodgit/plumbing v1.2.0/go.mod h1:b9TeRi7Hvc6Y05rjm8VML3+47n4XTZPtQ/5ghqic2n8=
+github.com/bodgit/sevenzip v1.3.0 h1:1ljgELgtHqvgIp8W8kgeEGHIWP4ch3xGI8uOBZgLVKY=
+github.com/bodgit/sevenzip v1.3.0/go.mod h1:omwNcgZTEooWM8gA/IJ2Nk/+ZQ94+GsytRzOJJ8FBlM=
+github.com/bodgit/windows v1.0.0 h1:rLQ/XjsleZvx4fR1tB/UxQrK+SJ2OFHzfPjLWWOhDIA=
+github.com/bodgit/windows v1.0.0/go.mod h1:a6JLwrB4KrTR5hBpp8FI9/9W9jJfeQ2h4XDXU74ZCdM=
github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=
+github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w=
github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
+github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s=
github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
-github.com/casbin/casbin/v2 v2.71.1 h1:LRHyqM0S1LzM/K59PmfUIN0ZJfLgcOjL4OhOQI/FNXU=
-github.com/casbin/casbin/v2 v2.71.1/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg=
+github.com/casbin/casbin/v2 v2.87.1 h1:7H+ENAfYt3HmZJVw++tJsxx/ko7WEHsfNzpOdYTkpYo=
+github.com/casbin/casbin/v2 v2.87.1/go.mod h1:jX8uoN4veP85O/n2674r2qtfSXI6myvxW85f6TH50fw=
github.com/casbin/gorm-adapter/v3 v3.18.0 h1:0td7v030eK3H5ftXRHx1d5wVPbuYEJP2ObMSUHtA0Ek=
github.com/casbin/gorm-adapter/v3 v3.18.0/go.mod h1:ekufPNBgVIQvv9JffVGsg7KUv4DjnevTh6AQnBNkoK8=
+github.com/casbin/govaluate v1.1.0/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A=
+github.com/casbin/govaluate v1.1.1 h1:J1rFKIBhiC5xr0APd5HP6rDL+xt+BRoyq1pa4o2i/5c=
+github.com/casbin/govaluate v1.1.1/go.mod h1:G/UnbIjZk/0uMNaLwZZmFQrR72tYRZWQkO70si/iR7A=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -78,7 +92,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
-github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/connesc/cipherio v0.2.1 h1:FGtpTPMbKNNWByNrr9aEBtaJtXjqOzkIXNYJp6OEycw=
+github.com/connesc/cipherio v0.2.1/go.mod h1:ukY0MWJDFnJEbXMQtOcn2VmTpRfzcTz4OoVrWGGJZcA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -86,6 +101,9 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
+github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q=
+github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo=
+github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -97,6 +115,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/flipped-aurora/ws v1.0.2 h1:oEUz7sgrbPENvgli7Q4QpC0NIEbJucgR4yjcDMg/AjY=
github.com/flipped-aurora/ws v1.0.2/go.mod h1:RdyM2Fnvxx7f7A6WSmU1aAhDrQIAVW7LS/0LsAUE5mE=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
+github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 h1:6VSn3hB5U5GeA6kQw4TwWIWbOhtvR2hmbBJnTOtqTWc=
@@ -104,6 +123,7 @@ github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6/go.mod h1:YxOVT5+yH
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4=
+github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
@@ -118,21 +138,17 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
-github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
-github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
-github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
-github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
-github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
-github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8=
-github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA=
-github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
-github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
-github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
-github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
+github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q=
+github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs=
+github.com/go-openapi/jsonreference v0.20.3 h1:EjGcjTW8pD1mRis6+w/gmoBdqv5+RbE9B85D1NgDOVQ=
+github.com/go-openapi/jsonreference v0.20.3/go.mod h1:FviDZ46i9ivh810gqzFLl5NttD5q3tSlMLqLr6okedM=
+github.com/go-openapi/spec v0.20.12 h1:cgSLbrsmziAP2iais+Vz7kSazwZ8rsUZd6TUzdDgkVI=
+github.com/go-openapi/spec v0.20.12/go.mod h1:iSCgnBcwbMW9SfzJb8iYynXvcY6C/QFrI7otzF7xGM4=
+github.com/go-openapi/swag v0.22.5 h1:fVS63IE3M0lsuWRzuom3RLwUMVI2peDH01s6M70ugys=
+github.com/go-openapi/swag v0.22.5/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
@@ -140,12 +156,13 @@ github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
+github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
-github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
-github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
+github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
+github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
@@ -191,8 +208,11 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
+github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
+github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -204,7 +224,6 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -225,6 +244,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
+github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -239,6 +259,11 @@ github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
+github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
+github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
+github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
+github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -251,10 +276,12 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
-github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
-github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
-github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU=
-github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8=
+github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA=
+github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
+github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw=
+github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
+github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
+github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM=
github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo=
@@ -263,6 +290,7 @@ github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP
github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
+github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
@@ -270,8 +298,6 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
-github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
-github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84 h1:pS0A6cr4aHYZnYwC7Uw+rwgb39+nzkm2QhwZ+S6Gn5I=
github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
@@ -282,16 +308,21 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
-github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
+github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY=
+github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
+github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
+github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE=
+github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -300,25 +331,22 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
-github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8=
-github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
-github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4=
-github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA=
-github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ=
-github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw=
github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
+github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
-github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
-github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
-github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
+github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
+github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
+github.com/mholt/archiver/v4 v4.0.0-alpha.8 h1:tRGQuDVPh66WCOelqe6LIGh0gwmfwxUrSSDunscGsRM=
+github.com/mholt/archiver/v4 v4.0.0-alpha.8/go.mod h1:5f7FUYGXdJWUjESffJaYR4R60VhnHxb2X3T1teMyv5A=
github.com/microsoft/go-mssqldb v1.1.0 h1:jsV+tpvcPTbNNKW0o3kiCD69kOHICsfjZ2VcVu2lKYc=
github.com/microsoft/go-mssqldb v1.1.0/go.mod h1:LzkFdl4z2Ck+Hi+ycGOTbL56VEfgoyA2DvYejrNGbRk=
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
@@ -331,14 +359,19 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
-github.com/mojocn/base64Captcha v1.3.5 h1:Qeilr7Ta6eDtG4S+tQuZ5+hO+QHbiGAJdi4PfoagaA0=
-github.com/mojocn/base64Captcha v1.3.5/go.mod h1:/tTTXn4WTpX9CfrmipqRytCpJ27Uw3G6I7NcP2WwcmY=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
+github.com/mojocn/base64Captcha v1.3.6 h1:gZEKu1nsKpttuIAQgWHO+4Mhhls8cAKyiV2Ew03H+Tw=
+github.com/mojocn/base64Captcha v1.3.6/go.mod h1:i5CtHvm+oMbj1UzEPXaA8IH/xHFZ3DGY3Wh3dBpZ28E=
+github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
+github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU=
github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ=
github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60=
github.com/nicksnyder/go-i18n/v2 v2.2.0 h1:MNXbyPvd141JJqlU6gJKrczThxJy+kdCNivxZpBQFkw=
github.com/nicksnyder/go-i18n/v2 v2.2.0/go.mod h1:4OtLfzqyAxsscyCb//3gfqSvBc81gImX91LrZzczN1o=
-github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk=
+github.com/nwaples/rardecode/v2 v2.0.0-beta.2/go.mod h1:yntwv/HfMc/Hbvtq9I19D1n58te3h6KsqCf3GxyfBGY=
github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE=
github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
@@ -348,6 +381,8 @@ github.com/otiai10/mint v1.3.3 h1:7JgpsBaN0uMkyju4tbYHu0mnM55hNKVYLsXmwr15NQI=
github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=
github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4=
+github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0=
+github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -357,21 +392,29 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
+github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
+github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/qiniu/api.v7/v7 v7.4.1 h1:BnNUBimLk6nrA/mIwsww9yJRupmViSsb1ndLMC7a9OY=
github.com/qiniu/api.v7/v7 v7.4.1/go.mod h1:VE5oC5rkE1xul0u1S2N0b2Uxq9/6hZzhyqjgK25XDcM=
+github.com/qiniu/qmgo v1.1.8 h1:E64M+P59aqQpXKI24ClVtluYkLaJLkkeD2hTVhrdMks=
+github.com/qiniu/qmgo v1.1.8/go.mod h1:QvZkzWNEv0buWPx0kdZsSs6URhESVubacxFPlITmvB8=
github.com/redis/go-redis/v9 v9.0.5 h1:CuQcn5HIEeK7BgElubPP8CGtE0KakrnbBSTLjathl5o=
github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
+github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM=
+github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
+github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
+github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM=
+github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
-github.com/sashabaranov/go-openai v1.14.1 h1:jqfkdj8XHnBF84oi2aNtT8Ktp3EJ0MfuVjvcMkfI0LA=
-github.com/sashabaranov/go-openai v1.14.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
+github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
github.com/shirou/gopsutil/v3 v3.23.6 h1:5y46WPI9QBKBbK7EEccUPNXpJpNrvPuTD0O2zHEHT08=
github.com/shirou/gopsutil/v3 v3.23.6/go.mod h1:j7QX50DrXYggrpN30W0Mo+I4/8U2UUIQrnrhqUeWrAU=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
@@ -392,6 +435,7 @@ github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc=
github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
@@ -412,12 +456,15 @@ github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE=
github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg=
github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M=
github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo=
-github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg=
-github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto=
+github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04=
+github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0=
github.com/tencentyun/cos-go-sdk-v5 v0.7.42 h1:Up1704BJjI5orycXKjpVpvuOInt9GC5pqY4knyE9Uds=
github.com/tencentyun/cos-go-sdk-v5 v0.7.42/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao=
+github.com/therootcompany/xz v1.0.1 h1:CmOtsn1CbtmyYiusbfmhmkpAAETj0wBIH6kCYaX+xzw=
+github.com/therootcompany/xz v1.0.1/go.mod h1:3K3UH1yCKgBneZYhuQUvJ9HPD19UEXEI0BWbMn8qNMY=
+github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM=
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms=
@@ -428,10 +475,29 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
+github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
+github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
+github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/unrolled/secure v1.13.0 h1:sdr3Phw2+f8Px8HE5sd1EHdj1aV3yUwed/uZXChLFsk=
github.com/unrolled/secure v1.13.0/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40=
+github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
+github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
+github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
+github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
+github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
+github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
+github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
+github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
+github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca h1:uvPMDVyP7PXMMioYdyPH+0O+Ta/UO1WFfNYMO3Wz0eg=
+github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
+github.com/xuri/excelize/v2 v2.8.0 h1:Vd4Qy809fupgp1v7X+nCS/MioeQmYVVzi495UCTqB7U=
+github.com/xuri/excelize/v2 v2.8.0/go.mod h1:6iA2edBTKxKbZAa7X5bDhcCg51xdOn1Ar5sfoXRGrQg=
+github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a h1:Mw2VNrNNNjDtw68VsEj2+st+oCSn4Uz7vZw6TbhcV1o=
+github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
+github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
+github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -439,6 +505,9 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
+go.mongodb.org/mongo-driver v1.11.6/go.mod h1:G9TgswdsWjX4tmDA5zfs2+6AEPpYJwqblyjsfuh8oXY=
+go.mongodb.org/mongo-driver v1.12.1 h1:nLkghSU8fQNaK7oUmDhQFsnrtcoNy7Z6LVFKsEecqgE=
+go.mongodb.org/mongo-driver v1.12.1/go.mod h1:/rGBTebI3XYboVmgz+Wv3Bcbl3aD0QF9zl6kDDw18rQ=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@@ -449,7 +518,10 @@ go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
+go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
+go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
+go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
@@ -457,6 +529,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E
go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
+go4.org v0.0.0-20200411211856-f5505b9728dd h1:BNJlw5kRTzdmyfh5U8F93HA2OwkP7ZGwA51eJ/0wKOU=
+go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
@@ -467,12 +541,14 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
-golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
-golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
+golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
+golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
+golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -484,10 +560,11 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
-golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/image v0.5.0 h1:5JMiNunQeQw++mMOz48/ISeNu3Iweh/JaZU8ZLqHRrI=
-golang.org/x/image v0.5.0/go.mod h1:FVC7BI/5Ym8R25iw5OLsgshdUBbT1h5jZTpA+mvAdZ4=
+golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8=
+golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk=
+golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8=
+golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -511,7 +588,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
+golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
+golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -549,8 +627,10 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
-golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
+golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
+golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
+golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -570,10 +650,11 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
-golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
+golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
+golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -623,14 +704,16 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
-golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
+golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
+golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -639,12 +722,15 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
-golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
+golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -701,8 +787,8 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
-golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
+golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
+golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -795,12 +881,10 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
-google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
-google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
@@ -815,24 +899,35 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gorm.io/datatypes v1.2.1 h1:r+g0bk4LPCW2v4+Ls7aeNgGme7JYdNDQ2VtvlNUfBh0=
+gorm.io/datatypes v1.2.1/go.mod h1:hYK6OTb/1x+m96PgoZZq10UXJ6RvEBb9kRDQ2yyhzGs=
gorm.io/driver/mysql v1.4.3/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c=
-gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
-gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o=
-gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0=
-gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8=
+gorm.io/driver/mysql v1.5.6 h1:Ld4mkIickM+EliaQZQx3uOJDJHtrd70MxAUqWqlx3Y8=
+gorm.io/driver/mysql v1.5.6/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
+gorm.io/driver/postgres v1.5.7 h1:8ptbNJTDbEmhdr62uReG5BGkdQyeasu/FZHxI0IMGnM=
+gorm.io/driver/postgres v1.5.7/go.mod h1:3e019WlBaYI5o5LIdNV+LyxCMNtLOQETBXL2h4chKpA=
+gorm.io/driver/sqlite v1.1.6/go.mod h1:W8LmC/6UvVbHKah0+QOC7Ja66EaZXHwUTjgXY8YNWX8=
+gorm.io/driver/sqlite v1.4.3 h1:HBBcZSDnWi5BW3B3rwvVTc510KGkBkexlOg0QrmLUuU=
+gorm.io/driver/sqlite v1.4.3/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI=
gorm.io/driver/sqlserver v1.5.1 h1:wpyW/pR26U94uaujltiFGXY7fd2Jw5hC9PB1ZF/Y5s4=
gorm.io/driver/sqlserver v1.5.1/go.mod h1:AYHzzte2msKTmYBYsSIq8ZUsznLJwBdkB2wpI+kt0nM=
+gorm.io/gen v0.3.26 h1:sFf1j7vNStimPRRAtH4zz5NiHM+1dr6eA9aaRdplyhY=
+gorm.io/gen v0.3.26/go.mod h1:a5lq5y3w4g5LMxBcw0wnO6tYUCdNutWODq5LrIt75LE=
+gorm.io/gorm v1.21.15/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
+gorm.io/gorm v1.22.2/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
-gorm.io/gorm v1.24.3/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
-gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho=
gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
-gorm.io/plugin/dbresolver v1.4.1 h1:Ug4LcoPhrvqq71UhxtF346f+skTYoCa/nEsdjvHwEzk=
-gorm.io/plugin/dbresolver v1.4.1/go.mod h1:CTbCtMWhsjXSiJqiW2R8POvJ2cq18RVOl4WGyT5nhNc=
+gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
+gorm.io/gorm v1.25.10 h1:dQpO+33KalOA+aFYGlK+EfxcI5MbO7EP2yYygwh9h+s=
+gorm.io/gorm v1.25.10/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
+gorm.io/hints v1.1.0 h1:Lp4z3rxREufSdxn4qmkK3TLDltrM10FLTHiuqwDPvXw=
+gorm.io/hints v1.1.0/go.mod h1:lKQ0JjySsPBj3uslFzY3JhYDtqEwzm+G1hv8rWujB6Y=
+gorm.io/plugin/dbresolver v1.5.0 h1:XVHLxh775eP0CqVh3vcfJtYqja3uFl5Wr3cKlY8jgDY=
+gorm.io/plugin/dbresolver v1.5.0/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/server/initialize/ensure_tables.go b/server/initialize/ensure_tables.go
index 720505296..389c35ed2 100644
--- a/server/initialize/ensure_tables.go
+++ b/server/initialize/ensure_tables.go
@@ -47,8 +47,10 @@ func (e *ensureTables) MigrateTable(ctx context.Context) (context.Context, error
sysModel.SysBaseMenuParameter{},
sysModel.SysBaseMenuBtn{},
sysModel.SysAuthorityBtn{},
- sysModel.SysAutoCode{},
- sysModel.SysChatGptOption{},
+ sysModel.SysAutoCodePackage{},
+ sysModel.SysExportTemplate{},
+ sysModel.Condition{},
+ sysModel.JoinTemplate{},
adapter.CasbinRule{},
@@ -83,8 +85,11 @@ func (e *ensureTables) TableCreated(ctx context.Context) bool {
sysModel.SysBaseMenuParameter{},
sysModel.SysBaseMenuBtn{},
sysModel.SysAuthorityBtn{},
- sysModel.SysAutoCode{},
- sysModel.SysChatGptOption{},
+ sysModel.SysAutoCodePackage{},
+ sysModel.SysExportTemplate{},
+ sysModel.Condition{},
+ sysModel.JoinTemplate{},
+
adapter.CasbinRule{},
example.ExaFile{},
diff --git a/server/initialize/gorm.go b/server/initialize/gorm.go
index 3b9152131..ddd79b75c 100644
--- a/server/initialize/gorm.go
+++ b/server/initialize/gorm.go
@@ -11,8 +11,6 @@ import (
"gorm.io/gorm"
)
-// Gorm 初始化数据库并产生数据库全局变量
-// Author SliverHorn
func Gorm() *gorm.DB {
switch global.GVA_CONFIG.System.DbType {
case "mysql":
@@ -30,13 +28,12 @@ func Gorm() *gorm.DB {
}
}
-// RegisterTables 注册数据库表专用
-// Author SliverHorn
func RegisterTables() {
db := global.GVA_DB
err := db.AutoMigrate(
- // 系统模块表
+
system.SysApi{},
+ system.SysIgnoreApi{},
system.SysUser{},
system.SysBaseMenu{},
system.JwtBlacklist{},
@@ -48,8 +45,10 @@ func RegisterTables() {
system.SysBaseMenuParameter{},
system.SysBaseMenuBtn{},
system.SysAuthorityBtn{},
- system.SysAutoCode{},
- system.SysChatGptOption{},
+ system.SysAutoCodePackage{},
+ system.SysExportTemplate{},
+ system.Condition{},
+ system.JoinTemplate{},
example.ExaFile{},
example.ExaCustomer{},
@@ -60,5 +59,12 @@ func RegisterTables() {
global.GVA_LOG.Error("register table failed", zap.Error(err))
os.Exit(0)
}
+
+ err = bizModel()
+
+ if err != nil {
+ global.GVA_LOG.Error("register biz_table failed", zap.Error(err))
+ os.Exit(0)
+ }
global.GVA_LOG.Info("register table success")
}
diff --git a/server/initialize/gorm_biz.go b/server/initialize/gorm_biz.go
new file mode 100644
index 000000000..9316ccc88
--- /dev/null
+++ b/server/initialize/gorm_biz.go
@@ -0,0 +1,14 @@
+package initialize
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+)
+
+func bizModel() error {
+ db := global.GVA_DB
+ err := db.AutoMigrate()
+ if err != nil {
+ return err
+ }
+ return nil
+}
diff --git a/server/initialize/internal/gorm.go b/server/initialize/internal/gorm.go
index 22a9ce392..dcf388bea 100644
--- a/server/initialize/internal/gorm.go
+++ b/server/initialize/internal/gorm.go
@@ -1,20 +1,16 @@
package internal
import (
+ "github.com/flipped-aurora/gin-vue-admin/server/config"
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "gorm.io/gorm"
+ "gorm.io/gorm/logger"
"gorm.io/gorm/schema"
"log"
"os"
"time"
-
- "github.com/flipped-aurora/gin-vue-admin/server/global"
- "gorm.io/gorm"
- "gorm.io/gorm/logger"
)
-type DBBASE interface {
- GetLogMode() string
-}
-
var Gorm = new(_gorm)
type _gorm struct{}
@@ -22,41 +18,31 @@ type _gorm struct{}
// Config gorm 自定义配置
// Author [SliverHorn](https://github.com/SliverHorn)
func (g *_gorm) Config(prefix string, singular bool) *gorm.Config {
- config := &gorm.Config{
+ var general config.GeneralDB
+ switch global.GVA_CONFIG.System.DbType {
+ case "mysql":
+ general = global.GVA_CONFIG.Mysql.GeneralDB
+ case "pgsql":
+ general = global.GVA_CONFIG.Pgsql.GeneralDB
+ case "oracle":
+ general = global.GVA_CONFIG.Oracle.GeneralDB
+ case "sqlite":
+ general = global.GVA_CONFIG.Sqlite.GeneralDB
+ case "mssql":
+ general = global.GVA_CONFIG.Mssql.GeneralDB
+ default:
+ general = global.GVA_CONFIG.Mysql.GeneralDB
+ }
+ return &gorm.Config{
+ Logger: logger.New(NewWriter(general, log.New(os.Stdout, "\r\n", log.LstdFlags)), logger.Config{
+ SlowThreshold: 200 * time.Millisecond,
+ LogLevel: general.LogLevel(),
+ Colorful: true,
+ }),
NamingStrategy: schema.NamingStrategy{
TablePrefix: prefix,
SingularTable: singular,
},
DisableForeignKeyConstraintWhenMigrating: true,
}
- _default := logger.New(log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{
- SlowThreshold: 200 * time.Millisecond,
- LogLevel: logger.Warn,
- Colorful: true,
- })
- var logMode DBBASE
- switch global.GVA_CONFIG.System.DbType {
- case "mysql":
- logMode = &global.GVA_CONFIG.Mysql
- case "pgsql":
- logMode = &global.GVA_CONFIG.Pgsql
- case "oracle":
- logMode = &global.GVA_CONFIG.Oracle
- default:
- logMode = &global.GVA_CONFIG.Mysql
- }
-
- switch logMode.GetLogMode() {
- case "silent", "Silent":
- config.Logger = _default.LogMode(logger.Silent)
- case "error", "Error":
- config.Logger = _default.LogMode(logger.Error)
- case "warn", "Warn":
- config.Logger = _default.LogMode(logger.Warn)
- case "info", "Info":
- config.Logger = _default.LogMode(logger.Info)
- default:
- config.Logger = _default.LogMode(logger.Info)
- }
- return config
}
diff --git a/server/initialize/internal/gorm_logger_writer.go b/server/initialize/internal/gorm_logger_writer.go
new file mode 100644
index 000000000..955503d87
--- /dev/null
+++ b/server/initialize/internal/gorm_logger_writer.go
@@ -0,0 +1,37 @@
+package internal
+
+import (
+ "fmt"
+ "github.com/flipped-aurora/gin-vue-admin/server/config"
+ "go.uber.org/zap"
+ "gorm.io/gorm/logger"
+)
+
+type Writer struct {
+ config config.GeneralDB
+ writer logger.Writer
+}
+
+func NewWriter(config config.GeneralDB, writer logger.Writer) *Writer {
+ return &Writer{config: config, writer: writer}
+}
+
+// Printf 格式化打印日志
+func (c *Writer) Printf(message string, data ...any) {
+ if c.config.LogZap {
+ switch c.config.LogLevel() {
+ case logger.Silent:
+ zap.L().Debug(fmt.Sprintf(message, data...))
+ case logger.Error:
+ zap.L().Error(fmt.Sprintf(message, data...))
+ case logger.Warn:
+ zap.L().Warn(fmt.Sprintf(message, data...))
+ case logger.Info:
+ zap.L().Info(fmt.Sprintf(message, data...))
+ default:
+ zap.L().Info(fmt.Sprintf(message, data...))
+ }
+ return
+ }
+ c.writer.Printf(message, data...)
+}
diff --git a/server/initialize/internal/logger.go b/server/initialize/internal/logger.go
deleted file mode 100644
index f8d2f34ef..000000000
--- a/server/initialize/internal/logger.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package internal
-
-import (
- "fmt"
-
- "github.com/flipped-aurora/gin-vue-admin/server/global"
- "gorm.io/gorm/logger"
-)
-
-type writer struct {
- logger.Writer
-}
-
-// NewWriter writer 构造函数
-// Author [SliverHorn](https://github.com/SliverHorn)
-func NewWriter(w logger.Writer) *writer {
- return &writer{Writer: w}
-}
-
-// Printf 格式化打印日志
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (w *writer) Printf(message string, data ...interface{}) {
- var logZap bool
- switch global.GVA_CONFIG.System.DbType {
- case "mysql":
- logZap = global.GVA_CONFIG.Mysql.LogZap
- case "pgsql":
- logZap = global.GVA_CONFIG.Pgsql.LogZap
- }
- if logZap {
- global.GVA_LOG.Info(fmt.Sprintf(message+"\n", data...))
- } else {
- w.Writer.Printf(message, data...)
- }
-}
diff --git a/server/initialize/internal/mongo.go b/server/initialize/internal/mongo.go
new file mode 100644
index 000000000..c4992d712
--- /dev/null
+++ b/server/initialize/internal/mongo.go
@@ -0,0 +1,29 @@
+package internal
+
+import (
+ "context"
+ "fmt"
+ "github.com/qiniu/qmgo/options"
+ "go.mongodb.org/mongo-driver/event"
+ opt "go.mongodb.org/mongo-driver/mongo/options"
+ "go.uber.org/zap"
+)
+
+var Mongo = new(mongo)
+
+type mongo struct{}
+
+func (m *mongo) GetClientOptions() []options.ClientOptions {
+ cmdMonitor := &event.CommandMonitor{
+ Started: func(ctx context.Context, event *event.CommandStartedEvent) {
+ zap.L().Info(fmt.Sprintf("[MongoDB][RequestID:%d][database:%s] %s\n", event.RequestID, event.DatabaseName, event.Command), zap.String("business", "mongo"))
+ },
+ Succeeded: func(ctx context.Context, event *event.CommandSucceededEvent) {
+ zap.L().Info(fmt.Sprintf("[MongoDB][RequestID:%d] [%s] %s\n", event.RequestID, event.Duration.String(), event.Reply), zap.String("business", "mongo"))
+ },
+ Failed: func(ctx context.Context, event *event.CommandFailedEvent) {
+ zap.L().Error(fmt.Sprintf("[MongoDB][RequestID:%d] [%s] %s\n", event.RequestID, event.Duration.String(), event.Failure), zap.String("business", "mongo"))
+ },
+ }
+ return []options.ClientOptions{{ClientOptions: &opt.ClientOptions{Monitor: cmdMonitor}}}
+}
diff --git a/server/initialize/mongo.go b/server/initialize/mongo.go
new file mode 100644
index 000000000..d88afaa74
--- /dev/null
+++ b/server/initialize/mongo.go
@@ -0,0 +1,151 @@
+package initialize
+
+import (
+ "context"
+ "fmt"
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/initialize/internal"
+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
+ "github.com/pkg/errors"
+ "github.com/qiniu/qmgo"
+ "github.com/qiniu/qmgo/options"
+ "go.mongodb.org/mongo-driver/bson"
+ option "go.mongodb.org/mongo-driver/mongo/options"
+ "sort"
+ "strings"
+)
+
+var Mongo = new(mongo)
+
+type (
+ mongo struct{}
+ Index struct {
+ V any `bson:"v"`
+ Ns any `bson:"ns"`
+ Key []bson.E `bson:"key"`
+ Name string `bson:"name"`
+ }
+)
+
+func (m *mongo) Indexes(ctx context.Context) error {
+ // 表名:索引列表 列: "表名": [][]string{{"index1", "index2"}}
+ indexMap := map[string][][]string{}
+ for collection, indexes := range indexMap {
+ err := m.CreateIndexes(ctx, collection, indexes)
+ if err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func (m *mongo) Initialization() error {
+ var opts []options.ClientOptions
+ if global.GVA_CONFIG.Mongo.IsZap {
+ opts = internal.Mongo.GetClientOptions()
+ }
+ ctx := context.Background()
+ client, err := qmgo.Open(ctx, &qmgo.Config{
+ Uri: global.GVA_CONFIG.Mongo.Uri(),
+ Coll: global.GVA_CONFIG.Mongo.Coll,
+ Database: global.GVA_CONFIG.Mongo.Database,
+ MinPoolSize: &global.GVA_CONFIG.Mongo.MinPoolSize,
+ MaxPoolSize: &global.GVA_CONFIG.Mongo.MaxPoolSize,
+ SocketTimeoutMS: &global.GVA_CONFIG.Mongo.SocketTimeoutMs,
+ ConnectTimeoutMS: &global.GVA_CONFIG.Mongo.ConnectTimeoutMs,
+ Auth: &qmgo.Credential{
+ Username: global.GVA_CONFIG.Mongo.Username,
+ Password: global.GVA_CONFIG.Mongo.Password,
+ AuthSource: global.GVA_CONFIG.Mongo.AuthSource,
+ },
+ }, opts...)
+ if err != nil {
+ return errors.Wrap(err, "链接mongodb数据库失败!")
+ }
+ global.GVA_MONGO = client
+ err = m.Indexes(ctx)
+ if err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *mongo) CreateIndexes(ctx context.Context, name string, indexes [][]string) error {
+ collection, err := global.GVA_MONGO.Database.Collection(name).CloneCollection()
+ if err != nil {
+ return errors.Wrapf(err, "获取[%s]的表对象失败!", name)
+ }
+ list, err := collection.Indexes().List(ctx)
+ if err != nil {
+ return errors.Wrapf(err, "获取[%s]的索引对象失败!", name)
+ }
+ var entities []Index
+ err = list.All(ctx, &entities)
+ if err != nil {
+ return errors.Wrapf(err, "获取[%s]的索引列表失败!", name)
+ }
+ length := len(indexes)
+ indexMap1 := make(map[string][]string, length)
+ for i := 0; i < length; i++ {
+ sort.Strings(indexes[i]) // 对索引key进行排序, 在使用bson.M搜索时, bson会自动按照key的字母顺序进行排序
+ length1 := len(indexes[i])
+ keys := make([]string, 0, length1)
+ for j := 0; j < length1; j++ {
+ if indexes[i][i][0] == '-' {
+ keys = append(keys, indexes[i][j], "-1")
+ continue
+ }
+ keys = append(keys, indexes[i][j], "1")
+ }
+ key := strings.Join(keys, "_")
+ _, o1 := indexMap1[key]
+ if o1 {
+ return errors.Errorf("索引[%s]重复!", key)
+ }
+ indexMap1[key] = indexes[i]
+ }
+ length = len(entities)
+ indexMap2 := make(map[string]map[string]string, length)
+ for i := 0; i < length; i++ {
+ v1, o1 := indexMap2[entities[i].Name]
+ if !o1 {
+ keyLength := len(entities[i].Key)
+ v1 = make(map[string]string, keyLength)
+ for j := 0; j < keyLength; j++ {
+ v2, o2 := v1[entities[i].Key[j].Key]
+ if !o2 {
+ v1 = make(map[string]string)
+ }
+ v2 = entities[i].Key[j].Key
+ v1[entities[i].Key[j].Key] = v2
+ indexMap2[entities[i].Name] = v1
+ }
+ }
+ }
+ for k1, v1 := range indexMap1 {
+ _, o2 := indexMap2[k1]
+ if o2 {
+ continue
+ } // 索引存在
+ if len(fmt.Sprintf("%s.%s.$%s", collection.Name(), name, v1)) > 127 {
+ err = global.GVA_MONGO.Database.Collection(name).CreateOneIndex(ctx, options.IndexModel{
+ Key: v1,
+ IndexOptions: option.Index().SetName(utils.MD5V([]byte(k1))),
+ // IndexOptions: option.Index().SetName(utils.MD5V([]byte(k1))).SetExpireAfterSeconds(86400), // SetExpireAfterSeconds(86400) 设置索引过期时间, 86400 = 1天
+ })
+ if err != nil {
+ return errors.Wrapf(err, "创建索引[%s]失败!", k1)
+ }
+ return nil
+ }
+ err = global.GVA_MONGO.Database.Collection(name).CreateOneIndex(ctx, options.IndexModel{
+ Key: v1,
+ IndexOptions: option.Index().SetExpireAfterSeconds(86400),
+ // IndexOptions: option.Index().SetName(utils.MD5V([]byte(k1))).SetExpireAfterSeconds(86400), // SetExpireAfterSeconds(86400) 设置索引过期时间(秒), 86400 = 1天
+ })
+ if err != nil {
+ return errors.Wrapf(err, "创建索引[%s]失败!", k1)
+ }
+ }
+ return nil
+}
diff --git a/server/initialize/other.go b/server/initialize/other.go
index 5d23aeb7f..f272a812a 100644
--- a/server/initialize/other.go
+++ b/server/initialize/other.go
@@ -1,7 +1,10 @@
package initialize
import (
+ "bufio"
"github.com/songzhibin97/gkit/cache/local_cache"
+ "os"
+ "strings"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
@@ -20,4 +23,10 @@ func OtherInit() {
global.BlackCache = local_cache.NewCache(
local_cache.SetDefaultExpire(dr),
)
+ file, err := os.Open("go.mod")
+ if err == nil && global.GVA_CONFIG.AutoCode.Module == "" {
+ scanner := bufio.NewScanner(file)
+ scanner.Scan()
+ global.GVA_CONFIG.AutoCode.Module = strings.TrimPrefix(scanner.Text(), "module ")
+ }
}
diff --git a/server/initialize/plugin.go b/server/initialize/plugin.go
index 7155ffb07..16913b18f 100644
--- a/server/initialize/plugin.go
+++ b/server/initialize/plugin.go
@@ -1,36 +1,15 @@
package initialize
import (
- "fmt"
-
"github.com/flipped-aurora/gin-vue-admin/server/global"
- "github.com/flipped-aurora/gin-vue-admin/server/middleware"
- "github.com/flipped-aurora/gin-vue-admin/server/plugin/email"
- "github.com/flipped-aurora/gin-vue-admin/server/utils/plugin"
"github.com/gin-gonic/gin"
)
-func PluginInit(group *gin.RouterGroup, Plugin ...plugin.Plugin) {
- for i := range Plugin {
- PluginGroup := group.Group(Plugin[i].RouterPath())
- Plugin[i].Register(PluginGroup)
+func InstallPlugin(PrivateGroup *gin.RouterGroup, PublicRouter *gin.RouterGroup, engine *gin.Engine) {
+ if global.GVA_DB == nil {
+ global.GVA_LOG.Info("项目暂未初始化,无法安装插件,初始化后重启项目即可完成插件安装")
+ return
}
-}
-
-func InstallPlugin(Router *gin.Engine) {
- PublicGroup := Router.Group("")
- fmt.Println("无鉴权插件安装==》", PublicGroup)
- PrivateGroup := Router.Group("")
- fmt.Println("鉴权插件安装==》", PrivateGroup)
- PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
- // 添加跟角色挂钩权限的插件 示例 本地示例模式于在线仓库模式注意上方的import 可以自行切换 效果相同
- PluginInit(PrivateGroup, email.CreateEmailPlug(
- global.GVA_CONFIG.Email.To,
- global.GVA_CONFIG.Email.From,
- global.GVA_CONFIG.Email.Host,
- global.GVA_CONFIG.Email.Secret,
- global.GVA_CONFIG.Email.Nickname,
- global.GVA_CONFIG.Email.Port,
- global.GVA_CONFIG.Email.IsSSL,
- ))
+ bizPluginV1(PrivateGroup, PublicRouter)
+ bizPluginV2(engine)
}
diff --git a/server/initialize/plugin_biz_v1.go b/server/initialize/plugin_biz_v1.go
new file mode 100644
index 000000000..7366c65d9
--- /dev/null
+++ b/server/initialize/plugin_biz_v1.go
@@ -0,0 +1,34 @@
+package initialize
+
+import (
+ "fmt"
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/email"
+ "github.com/flipped-aurora/gin-vue-admin/server/utils/plugin"
+ "github.com/gin-gonic/gin"
+)
+
+func PluginInit(group *gin.RouterGroup, Plugin ...plugin.Plugin) {
+ for i := range Plugin {
+ fmt.Println(Plugin[i].RouterPath(), "注册开始!")
+ PluginGroup := group.Group(Plugin[i].RouterPath())
+ Plugin[i].Register(PluginGroup)
+ fmt.Println(Plugin[i].RouterPath(), "注册成功!")
+ }
+}
+
+func bizPluginV1(group ...*gin.RouterGroup) {
+ private := group[0]
+ public := group[1]
+ // 添加跟角色挂钩权限的插件 示例 本地示例模式于在线仓库模式注意上方的import 可以自行切换 效果相同
+ PluginInit(private, email.CreateEmailPlug(
+ global.GVA_CONFIG.Email.To,
+ global.GVA_CONFIG.Email.From,
+ global.GVA_CONFIG.Email.Host,
+ global.GVA_CONFIG.Email.Secret,
+ global.GVA_CONFIG.Email.Nickname,
+ global.GVA_CONFIG.Email.Port,
+ global.GVA_CONFIG.Email.IsSSL,
+ ))
+ holder(public, private)
+}
diff --git a/server/initialize/plugin_biz_v2.go b/server/initialize/plugin_biz_v2.go
new file mode 100644
index 000000000..9d13bbe02
--- /dev/null
+++ b/server/initialize/plugin_biz_v2.go
@@ -0,0 +1,16 @@
+package initialize
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement"
+ "github.com/flipped-aurora/gin-vue-admin/server/utils/plugin/v2"
+ "github.com/gin-gonic/gin"
+)
+
+func PluginInitV2(group *gin.Engine, plugins ...plugin.Plugin) {
+ for i := 0; i < len(plugins); i++ {
+ plugins[i].Register(group)
+ }
+}
+func bizPluginV2(engine *gin.Engine) {
+ PluginInitV2(engine, announcement.Plugin)
+}
diff --git a/server/initialize/redis.go b/server/initialize/redis.go
index 4e631ab65..41dfd76e0 100644
--- a/server/initialize/redis.go
+++ b/server/initialize/redis.go
@@ -11,14 +11,25 @@ import (
func Redis() {
redisCfg := global.GVA_CONFIG.Redis
- client := redis.NewClient(&redis.Options{
- Addr: redisCfg.Addr,
- Password: redisCfg.Password, // no password set
- DB: redisCfg.DB, // use default DB
- })
+ var client redis.UniversalClient
+ // 使用集群模式
+ if redisCfg.UseCluster {
+ client = redis.NewClusterClient(&redis.ClusterOptions{
+ Addrs: redisCfg.ClusterAddrs,
+ Password: redisCfg.Password,
+ })
+ } else {
+ // 使用单例模式
+ client = redis.NewClient(&redis.Options{
+ Addr: redisCfg.Addr,
+ Password: redisCfg.Password,
+ DB: redisCfg.DB,
+ })
+ }
pong, err := client.Ping(context.Background()).Result()
if err != nil {
global.GVA_LOG.Error("redis connect ping failed, err:", zap.Error(err))
+ panic(err)
} else {
global.GVA_LOG.Info("redis connect ping response:", zap.String("pong", pong))
global.GVA_REDIS = client
diff --git a/server/initialize/router.go b/server/initialize/router.go
index 138bb134e..c93950279 100644
--- a/server/initialize/router.go
+++ b/server/initialize/router.go
@@ -1,22 +1,45 @@
package initialize
import (
- swaggerFiles "github.com/swaggo/files"
"net/http"
+ "os"
"github.com/flipped-aurora/gin-vue-admin/server/docs"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
"github.com/flipped-aurora/gin-vue-admin/server/router"
"github.com/gin-gonic/gin"
+ swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
)
+type justFilesFilesystem struct {
+ fs http.FileSystem
+}
+
+func (fs justFilesFilesystem) Open(name string) (http.File, error) {
+ f, err := fs.fs.Open(name)
+ if err != nil {
+ return nil, err
+ }
+
+ stat, err := f.Stat()
+ if stat.IsDir() {
+ return nil, os.ErrPermission
+ }
+
+ return f, nil
+}
+
// 初始化总路由
func Routers() *gin.Engine {
- Router := gin.Default()
- InstallPlugin(Router) // 安装插件
+ Router := gin.New()
+ Router.Use(gin.Recovery())
+ if gin.Mode() == gin.DebugMode {
+ Router.Use(gin.Logger())
+ }
+
systemRouter := router.RouterGroupApp.System
exampleRouter := router.RouterGroupApp.Example
// 如果想要不使用nginx代理前端网页,可以修改 web/.env.production 下的
@@ -27,8 +50,7 @@ func Routers() *gin.Engine {
// Router.Static("/assets", "./dist/assets") // dist里面的静态资源
// Router.StaticFile("/", "./dist/index.html") // 前端网页入口页面
- Router.StaticFS(global.GVA_CONFIG.Local.StorePath, http.Dir(global.GVA_CONFIG.Local.StorePath)) // 为用户头像和文件提供静态地址
- // Router.Use(middleware.LoadTls()) // 如果需要使用https 请打开此中间件 然后前往 core/server.go 将启动模式 更变为 Router.RunTLS("端口","你的cre/pem文件","你的key文件")
+ Router.StaticFS(global.GVA_CONFIG.Local.StorePath, justFilesFilesystem{http.Dir(global.GVA_CONFIG.Local.StorePath)}) // Router.Use(middleware.LoadTls()) // 如果需要使用https 请打开此中间件 然后前往 core/server.go 将启动模式 更变为 Router.RunTLS("端口","你的cre/pem文件","你的key文件")
// 跨域,如需跨域可以打开下面的注释
// Router.Use(middleware.Cors()) // 直接放行全部跨域请求
// Router.Use(middleware.CorsByRules()) // 按照配置的规则放行跨域请求
@@ -43,6 +65,10 @@ func Routers() *gin.Engine {
// 方便统一添加路由组前缀 多服务器上线使用
PublicGroup := Router.Group(global.GVA_CONFIG.System.RouterPrefix)
+ PrivateGroup := Router.Group(global.GVA_CONFIG.System.RouterPrefix)
+
+ PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
+
{
// 健康监测
PublicGroup.GET("/health", func(c *gin.Context) {
@@ -53,29 +79,35 @@ func Routers() *gin.Engine {
systemRouter.InitBaseRouter(PublicGroup) // 注册基础功能路由 不做鉴权
systemRouter.InitInitRouter(PublicGroup) // 自动初始化相关
}
- PrivateGroup := Router.Group(global.GVA_CONFIG.System.RouterPrefix)
- PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
- {
- systemRouter.InitApiRouter(PrivateGroup, PublicGroup) // 注册功能api路由
- systemRouter.InitJwtRouter(PrivateGroup) // jwt相关路由
- systemRouter.InitUserRouter(PrivateGroup) // 注册用户路由
- systemRouter.InitMenuRouter(PrivateGroup) // 注册menu路由
- systemRouter.InitSystemRouter(PrivateGroup) // system相关路由
- systemRouter.InitCasbinRouter(PrivateGroup) // 权限相关路由
- systemRouter.InitAutoCodeRouter(PrivateGroup) // 创建自动化代码
- systemRouter.InitAuthorityRouter(PrivateGroup) // 注册角色路由
- systemRouter.InitSysDictionaryRouter(PrivateGroup) // 字典管理
- systemRouter.InitAutoCodeHistoryRouter(PrivateGroup) // 自动化代码历史
- systemRouter.InitSysOperationRecordRouter(PrivateGroup) // 操作记录
- systemRouter.InitSysDictionaryDetailRouter(PrivateGroup) // 字典详情管理
- systemRouter.InitAuthorityBtnRouterRouter(PrivateGroup) // 字典详情管理
- systemRouter.InitChatGptRouter(PrivateGroup) // chatGpt接口
+ {
+ systemRouter.InitApiRouter(PrivateGroup, PublicGroup) // 注册功能api路由
+ systemRouter.InitJwtRouter(PrivateGroup) // jwt相关路由
+ systemRouter.InitUserRouter(PrivateGroup) // 注册用户路由
+ systemRouter.InitMenuRouter(PrivateGroup) // 注册menu路由
+ systemRouter.InitSystemRouter(PrivateGroup) // system相关路由
+ systemRouter.InitCasbinRouter(PrivateGroup) // 权限相关路由
+ systemRouter.InitAutoCodeRouter(PrivateGroup, PublicGroup) // 创建自动化代码
+ systemRouter.InitAuthorityRouter(PrivateGroup) // 注册角色路由
+ systemRouter.InitSysDictionaryRouter(PrivateGroup) // 字典管理
+ systemRouter.InitAutoCodeHistoryRouter(PrivateGroup) // 自动化代码历史
+ systemRouter.InitSysOperationRecordRouter(PrivateGroup) // 操作记录
+ systemRouter.InitSysDictionaryDetailRouter(PrivateGroup) // 字典详情管理
+ systemRouter.InitAuthorityBtnRouterRouter(PrivateGroup) // 按钮权限管理
+ systemRouter.InitSysExportTemplateRouter(PrivateGroup) // 导出模板
exampleRouter.InitCustomerRouter(PrivateGroup) // 客户路由
exampleRouter.InitFileUploadAndDownloadRouter(PrivateGroup) // 文件上传下载功能路由
}
+ //插件路由安装
+ InstallPlugin(PrivateGroup, PublicGroup, Router)
+
+ // 注册业务路由
+ initBizRouter(PrivateGroup, PublicGroup)
+
+ global.GVA_ROUTERS = Router.Routes()
+
global.GVA_LOG.Info("router register success")
return Router
}
diff --git a/server/initialize/router_biz.go b/server/initialize/router_biz.go
new file mode 100644
index 000000000..279127d3a
--- /dev/null
+++ b/server/initialize/router_biz.go
@@ -0,0 +1,19 @@
+package initialize
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/router"
+ "github.com/gin-gonic/gin"
+)
+
+// 占位方法,保证文件可以正确加载,避免go空变量检测报错,请勿删除。
+func holder(routers ...*gin.RouterGroup) {
+ _ = routers
+ _ = router.RouterGroupApp
+}
+
+func initBizRouter(routers ...*gin.RouterGroup) {
+ privateGroup := routers[0]
+ publicGroup := routers[1]
+
+ holder(publicGroup, privateGroup)
+}
diff --git a/server/initialize/timer.go b/server/initialize/timer.go
index 024f3feae..ab5a7a5a4 100644
--- a/server/initialize/timer.go
+++ b/server/initialize/timer.go
@@ -2,32 +2,36 @@ package initialize
import (
"fmt"
+ "github.com/flipped-aurora/gin-vue-admin/server/task"
"github.com/robfig/cron/v3"
- "github.com/flipped-aurora/gin-vue-admin/server/config"
"github.com/flipped-aurora/gin-vue-admin/server/global"
- "github.com/flipped-aurora/gin-vue-admin/server/utils"
)
func Timer() {
- if global.GVA_CONFIG.Timer.Start {
- for i := range global.GVA_CONFIG.Timer.Detail {
- go func(detail config.Detail) {
- var option []cron.Option
- if global.GVA_CONFIG.Timer.WithSeconds {
- option = append(option, cron.WithSeconds())
- }
- _, err := global.GVA_Timer.AddTaskByFunc("ClearDB", global.GVA_CONFIG.Timer.Spec, func() {
- err := utils.ClearTable(global.GVA_DB, detail.TableName, detail.CompareField, detail.Interval)
- if err != nil {
- fmt.Println("timer error:", err)
- }
- }, option...)
- if err != nil {
- fmt.Println("add timer error:", err)
- }
- }(global.GVA_CONFIG.Timer.Detail[i])
+ go func() {
+ var option []cron.Option
+ option = append(option, cron.WithSeconds())
+ // 清理DB定时任务
+ _, err := global.GVA_Timer.AddTaskByFunc("ClearDB", "@daily", func() {
+ err := task.ClearTable(global.GVA_DB) // 定时任务方法定在task文件包中
+ if err != nil {
+ fmt.Println("timer error:", err)
+ }
+ }, "定时清理数据库【日志,黑名单】内容", option...)
+ if err != nil {
+ fmt.Println("add timer error:", err)
}
- }
+
+ // 其他定时任务定在这里 参考上方使用方法
+
+ //_, err := global.GVA_Timer.AddTaskByFunc("定时任务标识", "corn表达式", func() {
+ // 具体执行内容...
+ // ......
+ //}, option...)
+ //if err != nil {
+ // fmt.Println("add timer error:", err)
+ //}
+ }()
}
diff --git a/server/main.go b/server/main.go
index 77ce1214d..f07f01063 100644
--- a/server/main.go
+++ b/server/main.go
@@ -1,11 +1,13 @@
package main
import (
+ _ "go.uber.org/automaxprocs"
+ "go.uber.org/zap"
+
"github.com/flipped-aurora/gin-vue-admin/server/core"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/initialize"
"github.com/flipped-aurora/gin-vue-admin/server/utils/translate"
- "go.uber.org/zap"
)
//go:generate go env -w GO111MODULE=on
@@ -13,9 +15,9 @@ import (
//go:generate go mod tidy
//go:generate go mod download
-// @title Swagger Example API
-// @version 0.0.1
-// @description This is a sample Server pets
+// @title Gin-Vue-Admin Swagger API接口文档
+// @version v2.7.0
+// @description 使用gin+vue进行极速开发的全栈开发基础平台
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name x-token
diff --git a/server/middleware/casbin_rbac.go b/server/middleware/casbin_rbac.go
index 7994db1ef..a1ca4c2b7 100644
--- a/server/middleware/casbin_rbac.go
+++ b/server/middleware/casbin_rbac.go
@@ -16,22 +16,20 @@ var casbinService = service.ServiceGroupApp.SystemServiceGroup.CasbinService
// CasbinHandler 拦截器
func CasbinHandler() gin.HandlerFunc {
return func(c *gin.Context) {
- if global.GVA_CONFIG.System.Env != "develop" {
- waitUse, _ := utils.GetClaims(c)
- //获取请求的PATH
- path := c.Request.URL.Path
- obj := strings.TrimPrefix(path, global.GVA_CONFIG.System.RouterPrefix)
- // 获取请求方法
- act := c.Request.Method
- // 获取用户的角色
- sub := strconv.Itoa(int(waitUse.AuthorityId))
- e := casbinService.Casbin() // 判断策略中是否存在
- success, _ := e.Enforce(sub, obj, act)
- if !success {
- response.FailWithDetailed(gin.H{}, "权限不足", c)
- c.Abort()
- return
- }
+ waitUse, _ := utils.GetClaims(c)
+ //获取请求的PATH
+ path := c.Request.URL.Path
+ obj := strings.TrimPrefix(path, global.GVA_CONFIG.System.RouterPrefix)
+ // 获取请求方法
+ act := c.Request.Method
+ // 获取用户的角色
+ sub := strconv.Itoa(int(waitUse.AuthorityId))
+ e := casbinService.Casbin() // 判断策略中是否存在
+ success, _ := e.Enforce(sub, obj, act)
+ if !success {
+ response.FailWithDetailed(gin.H{}, "权限不足", c)
+ c.Abort()
+ return
}
c.Next()
}
diff --git a/server/middleware/jwt.go b/server/middleware/jwt.go
index c67cc28b1..aa7ca37bb 100644
--- a/server/middleware/jwt.go
+++ b/server/middleware/jwt.go
@@ -2,19 +2,18 @@ package middleware
import (
"errors"
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/golang-jwt/jwt/v4"
+ "go.uber.org/zap"
"strconv"
"time"
- "github.com/flipped-aurora/gin-vue-admin/server/utils"
-
- "github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
- "github.com/flipped-aurora/gin-vue-admin/server/model/system"
"github.com/flipped-aurora/gin-vue-admin/server/service"
"github.com/gin-gonic/gin"
- "go.uber.org/zap"
)
var jwtService = service.ServiceGroupApp.SystemServiceGroup.JwtService
@@ -22,14 +21,15 @@ var jwtService = service.ServiceGroupApp.SystemServiceGroup.JwtService
func JWTAuth() gin.HandlerFunc {
return func(c *gin.Context) {
// 我们这里jwt鉴权取头部信息 x-token 登录时回返回token信息 这里前端需要把token存储到cookie或者本地localStorage中 不过需要跟后端协商过期时间 可以约定刷新令牌或者重新登录
- token := c.Request.Header.Get("x-token")
+ token := utils.GetToken(c)
if token == "" {
- response.FailWithDetailed(gin.H{"reload": true}, "未登录或非法访问", c)
+ response.NoAuth("未登录或非法访问", c)
c.Abort()
return
}
if jwtService.IsBlacklist(token) {
- response.FailWithDetailed(gin.H{"reload": true}, "您的帐户异地登陆或令牌失效", c)
+ response.NoAuth("您的帐户异地登陆或令牌失效", c)
+ utils.ClearToken(c)
c.Abort()
return
}
@@ -38,11 +38,13 @@ func JWTAuth() gin.HandlerFunc {
claims, err := j.ParseToken(token)
if err != nil {
if errors.Is(err, utils.TokenExpired) {
- response.FailWithDetailed(gin.H{"reload": true}, "授权已过期", c)
+ response.NoAuth("授权已过期", c)
+ utils.ClearToken(c)
c.Abort()
return
}
- response.FailWithDetailed(gin.H{"reload": true}, err.Error(), c)
+ response.NoAuth(err.Error(), c)
+ utils.ClearToken(c)
c.Abort()
return
}
@@ -55,6 +57,7 @@ func JWTAuth() gin.HandlerFunc {
// response.FailWithDetailed(gin.H{"reload": true}, err.Error(), c)
// c.Abort()
//}
+ c.Set("claims", claims)
if claims.ExpiresAt.Unix()-time.Now().Unix() < claims.BufferTime {
dr, _ := utils.ParseDuration(global.GVA_CONFIG.JWT.ExpiresTime)
claims.ExpiresAt = jwt.NewNumericDate(time.Now().Add(dr))
@@ -62,6 +65,7 @@ func JWTAuth() gin.HandlerFunc {
newClaims, _ := j.ParseToken(newToken)
c.Header("new-token", newToken)
c.Header("new-expires-at", strconv.FormatInt(newClaims.ExpiresAt.Unix(), 10))
+ utils.SetToken(c, newToken, int(dr.Seconds()))
if global.GVA_CONFIG.System.UseMultipoint {
RedisJwtToken, err := jwtService.GetRedisJWT(newClaims.Username)
if err != nil {
@@ -73,7 +77,13 @@ func JWTAuth() gin.HandlerFunc {
_ = jwtService.SetRedisJWT(newToken, newClaims.Username)
}
}
- c.Set("claims", claims)
c.Next()
+
+ if newToken, exists := c.Get("new-token"); exists {
+ c.Header("new-token", newToken.(string))
+ }
+ if newExpiresAt, exists := c.Get("new-expires-at"); exists {
+ c.Header("new-expires-at", newExpiresAt.(string))
+ }
}
}
diff --git a/server/middleware/operation.go b/server/middleware/operation.go
index 495d68ed4..f34cf68ee 100644
--- a/server/middleware/operation.go
+++ b/server/middleware/operation.go
@@ -23,10 +23,11 @@ import (
var operationRecordService = service.ServiceGroupApp.SystemServiceGroup.OperationRecordService
var respPool sync.Pool
+var bufferSize = 1024
func init() {
respPool.New = func() interface{} {
- return make([]byte, 1024)
+ return make([]byte, bufferSize)
}
}
@@ -56,7 +57,7 @@ func OperationRecord() gin.HandlerFunc {
body, _ = json.Marshal(&m)
}
claims, _ := utils.GetClaims(c)
- if claims.BaseClaims.ID != 0 {
+ if claims != nil && claims.BaseClaims.ID != 0 {
userId = int(claims.BaseClaims.ID)
} else {
id, err := strconv.Atoi(c.Request.Header.Get("x-user-id"))
@@ -70,18 +71,18 @@ func OperationRecord() gin.HandlerFunc {
Method: c.Request.Method,
Path: c.Request.URL.Path,
Agent: c.Request.UserAgent(),
- Body: string(body),
+ Body: "",
UserID: userId,
}
// 上传文件时候 中间件日志进行裁断操作
if strings.Contains(c.GetHeader("Content-Type"), "multipart/form-data") {
- if len(record.Body) > 1024 {
- // 截断
- newBody := respPool.Get().([]byte)
- copy(newBody, record.Body)
- record.Body = string(newBody)
- defer respPool.Put(newBody[:0])
+ record.Body = "[文件]"
+ } else {
+ if len(body) > bufferSize {
+ record.Body = "[超出记录长度]"
+ } else {
+ record.Body = string(body)
}
}
@@ -109,12 +110,9 @@ func OperationRecord() gin.HandlerFunc {
strings.Contains(c.Writer.Header().Get("Content-Type"), "application/download") ||
strings.Contains(c.Writer.Header().Get("Content-Disposition"), "attachment") ||
strings.Contains(c.Writer.Header().Get("Content-Transfer-Encoding"), "binary") {
- if len(record.Resp) > 1024 {
+ if len(record.Resp) > bufferSize {
// 截断
- newBody := respPool.Get().([]byte)
- copy(newBody, record.Resp)
- record.Resp = string(newBody)
- defer respPool.Put(newBody[:0])
+ record.Body = "超出记录长度"
}
}
diff --git a/server/model/common/clearDB.go b/server/model/common/clearDB.go
new file mode 100644
index 000000000..e7fc75795
--- /dev/null
+++ b/server/model/common/clearDB.go
@@ -0,0 +1,7 @@
+package common
+
+type ClearDB struct {
+ TableName string
+ CompareField string
+ Interval string
+}
diff --git a/server/model/common/request/common.go b/server/model/common/request/common.go
index 78374e063..c729f3db2 100644
--- a/server/model/common/request/common.go
+++ b/server/model/common/request/common.go
@@ -1,10 +1,30 @@
package request
+import (
+ "gorm.io/gorm"
+)
+
// PageInfo Paging common input parameter structure
type PageInfo struct {
Page int `json:"page" form:"page"` // 页码
PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
- Keyword string `json:"keyword" form:"keyword"` //关键字
+ Keyword string `json:"keyword" form:"keyword"` // 关键字
+}
+
+func (r *PageInfo) Paginate() func(db *gorm.DB) *gorm.DB {
+ return func(db *gorm.DB) *gorm.DB {
+ if r.Page <= 0 {
+ r.Page = 1
+ }
+ switch {
+ case r.PageSize > 100:
+ r.PageSize = 100
+ case r.PageSize <= 0:
+ r.PageSize = 10
+ }
+ offset := (r.Page - 1) * r.PageSize
+ return db.Offset(offset).Limit(r.PageSize)
+ }
}
// GetById Find by id structure
diff --git a/server/model/common/response/response.go b/server/model/common/response/response.go
index 5284026aa..9529e7f9c 100644
--- a/server/model/common/response/response.go
+++ b/server/model/common/response/response.go
@@ -3,6 +3,7 @@ package response
import (
"net/http"
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/gin-gonic/gin"
)
@@ -28,7 +29,7 @@ func Result(code int, data interface{}, msg string, c *gin.Context) {
}
func Ok(c *gin.Context) {
- Result(SUCCESS, map[string]interface{}{}, "操作成功", c)
+ Result(SUCCESS, map[string]interface{}{}, global.Translate("model.common.response.operationSuccess"), c)
}
func OkWithMessage(message string, c *gin.Context) {
@@ -36,7 +37,7 @@ func OkWithMessage(message string, c *gin.Context) {
}
func OkWithData(data interface{}, c *gin.Context) {
- Result(SUCCESS, data, "查询成功", c)
+ Result(SUCCESS, data, global.Translate("model.common.response.success"), c)
}
func OkWithDetailed(data interface{}, message string, c *gin.Context) {
@@ -44,13 +45,21 @@ func OkWithDetailed(data interface{}, message string, c *gin.Context) {
}
func Fail(c *gin.Context) {
- Result(ERROR, map[string]interface{}{}, "操作失败", c)
+ Result(ERROR, map[string]interface{}{}, global.Translate("model.common.response.operationFail"), c)
}
func FailWithMessage(message string, c *gin.Context) {
Result(ERROR, map[string]interface{}{}, message, c)
}
+func NoAuth(message string, c *gin.Context) {
+ c.JSON(http.StatusUnauthorized, Response{
+ 7,
+ nil,
+ message,
+ })
+}
+
func FailWithDetailed(data interface{}, message string, c *gin.Context) {
Result(ERROR, data, message, c)
}
diff --git a/server/model/system/request/sys_auto_code.go b/server/model/system/request/sys_auto_code.go
new file mode 100644
index 000000000..088986dfe
--- /dev/null
+++ b/server/model/system/request/sys_auto_code.go
@@ -0,0 +1,241 @@
+package request
+
+import (
+ "encoding/json"
+ "fmt"
+ model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+ "github.com/pkg/errors"
+ "go/token"
+ "strings"
+)
+
+type AutoCode struct {
+ Package string `json:"package"`
+ PackageT string `json:"-"`
+ TableName string `json:"tableName" example:"表名"` // 表名
+ BusinessDB string `json:"businessDB" example:"业务数据库"` // 业务数据库
+ StructName string `json:"structName" example:"Struct名称"` // Struct名称
+ PackageName string `json:"packageName" example:"文件名称"` // 文件名称
+ Description string `json:"description" example:"Struct中文名称"` // Struct中文名称
+ Abbreviation string `json:"abbreviation" example:"Struct简称"` // Struct简称
+ HumpPackageName string `json:"humpPackageName" example:"go文件名称"` // go文件名称
+ GvaModel bool `json:"gvaModel" example:"false"` // 是否使用gva默认Model
+ AutoMigrate bool `json:"autoMigrate" example:"false"` // 是否自动迁移表结构
+ AutoCreateResource bool `json:"autoCreateResource" example:"false"` // 是否自动创建资源标识
+ AutoCreateApiToSql bool `json:"autoCreateApiToSql" example:"false"` // 是否自动创建api
+ AutoCreateMenuToSql bool `json:"autoCreateMenuToSql" example:"false"` // 是否自动创建menu
+ Fields []*AutoCodeField `json:"fields"`
+ DictTypes []string `json:"-"`
+ FrontFields []*AutoCodeField `json:"-"`
+ PrimaryField *AutoCodeField `json:"primaryField"`
+ DataSourceMap map[string]*DataSource `json:"-"`
+ HasPic bool `json:"-"`
+ HasFile bool `json:"-"`
+ HasTimer bool `json:"-"`
+ NeedSort bool `json:"-"`
+ NeedJSON bool `json:"-"`
+ HasRichText bool `json:"-"`
+ HasDataSource bool `json:"-"`
+ HasSearchTimer bool `json:"-"`
+}
+
+type DataSource struct {
+ Table string `json:"table"`
+ Label string `json:"label"`
+ Value string `json:"value"`
+ Association int `json:"association"` // 关联关系 1 一对一 2 一对多
+}
+
+func (r *AutoCode) Apis() []model.SysApi {
+ return []model.SysApi{
+ {
+ Path: "/" + r.Abbreviation + "/" + "create" + r.StructName,
+ Description: "新增" + r.Description,
+ ApiGroup: r.Description,
+ Method: "POST",
+ },
+ {
+ Path: "/" + r.Abbreviation + "/" + "delete" + r.StructName,
+ Description: "删除" + r.Description,
+ ApiGroup: r.Description,
+ Method: "DELETE",
+ },
+ {
+ Path: "/" + r.Abbreviation + "/" + "delete" + r.StructName + "ByIds",
+ Description: "批量删除" + r.Description,
+ ApiGroup: r.Description,
+ Method: "DELETE",
+ },
+ {
+ Path: "/" + r.Abbreviation + "/" + "update" + r.StructName,
+ Description: "更新" + r.Description,
+ ApiGroup: r.Description,
+ Method: "PUT",
+ },
+ {
+ Path: "/" + r.Abbreviation + "/" + "find" + r.StructName,
+ Description: "根据ID获取" + r.Description,
+ ApiGroup: r.Description,
+ Method: "GET",
+ },
+ {
+ Path: "/" + r.Abbreviation + "/" + "get" + r.StructName + "List",
+ Description: "获取" + r.Description + "列表",
+ ApiGroup: r.Description,
+ Method: "GET",
+ },
+ }
+}
+
+func (r *AutoCode) Menu(template string) model.SysBaseMenu {
+ component := fmt.Sprintf("view/%s/%s/%s.vue", r.Package, r.PackageName, r.PackageName)
+ if template != "package" {
+ component = fmt.Sprintf("plugin/%s/view/%s.vue", r.Package, r.PackageName)
+ }
+ return model.SysBaseMenu{
+ ParentId: 0,
+ Path: r.Abbreviation,
+ Name: r.Abbreviation,
+ Component: component,
+ Meta: model.Meta{
+ Title: r.Description,
+ },
+ }
+}
+
+// Pretreatment 预处理
+// Author [SliverHorn](https://github.com/SliverHorn)
+func (r *AutoCode) Pretreatment() error {
+ if token.IsKeyword(r.Abbreviation) {
+ r.Abbreviation = r.Abbreviation + "_"
+ } // go 关键字处理
+ if strings.HasSuffix(r.HumpPackageName, "test") {
+ r.HumpPackageName = r.HumpPackageName + "_"
+ } // test
+ length := len(r.Fields)
+ dict := make(map[string]string, length)
+ r.FrontFields = make([]*AutoCodeField, 0, length)
+ r.DataSourceMap = make(map[string]*DataSource, length)
+ for i := 0; i < length; i++ {
+ if r.Fields[i].DictType != "" {
+ dict[r.Fields[i].DictType] = ""
+ }
+ if r.Fields[i].Sort {
+ r.NeedSort = true
+ }
+ if r.Fields[i].Front {
+ r.FrontFields = append(r.FrontFields, r.Fields[i])
+ }
+ switch r.Fields[i].FieldType {
+ case "file":
+ r.HasFile = true
+ r.NeedJSON = true
+ case "json":
+ r.NeedJSON = true
+ case "array":
+ r.NeedJSON = true
+ case "video":
+ r.HasPic = true
+ case "richtext":
+ r.HasRichText = true
+ case "picture":
+ r.HasPic = true
+ case "pictures":
+ r.HasPic = true
+ r.NeedJSON = true
+ case "time.Time":
+ r.HasTimer = true
+ if r.Fields[i].FieldSearchType != "" {
+ r.HasSearchTimer = true
+ }
+ }
+ if r.Fields[i].DataSource != nil {
+ if r.Fields[i].DataSource.Table != "" && r.Fields[i].DataSource.Label != "" && r.Fields[i].DataSource.Value != "" {
+ r.HasDataSource = true
+ r.Fields[i].CheckDataSource = true
+ r.DataSourceMap[r.Fields[i].FieldJson] = r.Fields[i].DataSource
+ }
+ }
+ if !r.GvaModel && r.PrimaryField == nil && r.Fields[i].PrimaryKey {
+ r.PrimaryField = r.Fields[i]
+ } // 自定义主键
+ }
+ {
+ for key := range dict {
+ r.DictTypes = append(r.DictTypes, key)
+ }
+ } // DictTypes => 字典
+ {
+ if r.GvaModel {
+ r.PrimaryField = &AutoCodeField{
+ FieldName: "ID",
+ FieldType: "uint",
+ FieldDesc: "ID",
+ FieldJson: "ID",
+ DataTypeLong: "20",
+ Comment: "主键ID",
+ ColumnName: "id",
+ }
+ }
+ } // GvaModel
+ if r.Package == "" {
+ return errors.New("Package为空!")
+ } // 增加判断:Package不为空
+ packages := []rune(r.Package)
+ if len(packages) > 0 {
+ if packages[0] >= 97 && packages[0] <= 122 {
+ packages[0] = packages[0] - 32
+ }
+ r.PackageT = string(packages)
+ } // PackageT 是 Package 的首字母大写
+ return nil
+}
+
+func (r *AutoCode) History() SysAutoHistoryCreate {
+ bytes, _ := json.Marshal(r)
+ return SysAutoHistoryCreate{
+ Table: r.TableName,
+ Package: r.Package,
+ Request: string(bytes),
+ StructName: r.StructName,
+ BusinessDB: r.BusinessDB,
+ Description: r.Description,
+ }
+}
+
+type AutoCodeField struct {
+ FieldName string `json:"fieldName"` // Field名
+ FieldDesc string `json:"fieldDesc"` // 中文名
+ FieldType string `json:"fieldType"` // Field数据类型
+ FieldJson string `json:"fieldJson"` // FieldJson
+ DataTypeLong string `json:"dataTypeLong"` // 数据库字段长度
+ Comment string `json:"comment"` // 数据库字段描述
+ ColumnName string `json:"columnName"` // 数据库字段
+ FieldSearchType string `json:"fieldSearchType"` // 搜索条件
+ FieldSearchHide bool `json:"fieldSearchHide"` // 是否隐藏查询条件
+ DictType string `json:"dictType"` // 字典
+ Front bool `json:"front"` // 是否前端可见
+ Require bool `json:"require"` // 是否必填
+ DefaultValue string `json:"defaultValue"` // 是否必填
+ ErrorText string `json:"errorText"` // 校验失败文字
+ Clearable bool `json:"clearable"` // 是否可清空
+ Sort bool `json:"sort"` // 是否增加排序
+ PrimaryKey bool `json:"primaryKey"` // 是否主键
+ DataSource *DataSource `json:"dataSource"` // 数据源
+ CheckDataSource bool `json:"checkDataSource"` // 是否检查数据源
+ FieldIndexType string `json:"fieldIndexType"` // 索引类型
+}
+
+type AutoFunc struct {
+ Package string `json:"package"`
+ FuncName string `json:"funcName"` // 方法名称
+ Router string `json:"router"` // 路由名称
+ BusinessDB string `json:"businessDB"` // 业务库
+ StructName string `json:"structName"` // Struct名称
+ PackageName string `json:"packageName"` // 文件名称
+ Description string `json:"description"` // Struct中文名称
+ Abbreviation string `json:"abbreviation"` // Struct简称
+ HumpPackageName string `json:"humpPackageName"` // go文件名称
+ Method string `json:"method"` // 方法
+ IsPlugin bool `json:"isPlugin"` // 是否插件
+}
diff --git a/server/model/system/request/sys_auto_code_package.go b/server/model/system/request/sys_auto_code_package.go
new file mode 100644
index 000000000..8494cb178
--- /dev/null
+++ b/server/model/system/request/sys_auto_code_package.go
@@ -0,0 +1,27 @@
+package request
+
+import (
+ model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+)
+
+type SysAutoCodePackageCreate struct {
+ Desc string `json:"desc" example:"描述"`
+ Label string `json:"label" example:"展示名"`
+ Template string `json:"template" example:"模版"`
+ PackageName string `json:"packageName" example:"包名"`
+}
+
+func (r *SysAutoCodePackageCreate) AutoCode() AutoCode {
+ return AutoCode{
+ Package: r.PackageName,
+ }
+}
+
+func (r *SysAutoCodePackageCreate) Create() model.SysAutoCodePackage {
+ return model.SysAutoCodePackage{
+ Desc: r.Desc,
+ Label: r.Label,
+ Template: r.Template,
+ PackageName: r.PackageName,
+ }
+}
diff --git a/server/model/system/request/sys_auto_history.go b/server/model/system/request/sys_auto_history.go
index 48c95e607..e6f4c3308 100644
--- a/server/model/system/request/sys_auto_history.go
+++ b/server/model/system/request/sys_auto_history.go
@@ -1,13 +1,54 @@
package request
-import "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+import (
+ common "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+ model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+)
-type SysAutoHistory struct {
- request.PageInfo
+type SysAutoHistoryCreate struct {
+ Table string // 表名
+ Package string // 模块名/插件名
+ Request string // 前端传入的结构化信息
+ StructName string // 结构体名称
+ BusinessDB string // 业务库
+ Description string // Struct中文名称
+ Injections map[string]string // 注入路径
+ Templates map[string]string // 模板信息
+ ApiIDs []uint // api表注册内容
+ MenuID uint // 菜单ID
}
-// GetById Find by id structure
-type RollBack struct {
- ID int `json:"id" form:"id"` // 主键ID
+func (r *SysAutoHistoryCreate) Create() model.SysAutoCodeHistory {
+ entity := model.SysAutoCodeHistory{
+ Package: r.Package,
+ Request: r.Request,
+ Table: r.Table,
+ StructName: r.StructName,
+ BusinessDB: r.BusinessDB,
+ Description: r.Description,
+ Injections: r.Injections,
+ Templates: r.Templates,
+ ApiIDs: r.ApiIDs,
+ MenuID: r.MenuID,
+ }
+ if entity.Table == "" {
+ entity.Table = r.StructName
+ }
+ return entity
+}
+
+type SysAutoHistoryRollBack struct {
+ common.GetById
+ DeleteApi bool `json:"deleteApi" form:"deleteApi"` // 是否删除接口
+ DeleteMenu bool `json:"deleteMenu" form:"deleteMenu"` // 是否删除菜单
DeleteTable bool `json:"deleteTable" form:"deleteTable"` // 是否删除表
}
+
+func (r *SysAutoHistoryRollBack) ApiIds(entity model.SysAutoCodeHistory) common.IdsReq {
+ length := len(entity.ApiIDs)
+ ids := make([]int, 0)
+ for i := 0; i < length; i++ {
+ ids = append(ids, int(entity.ApiIDs[i]))
+ }
+ return common.IdsReq{Ids: ids}
+}
diff --git a/server/model/system/request/sys_chatgpt.go b/server/model/system/request/sys_chatgpt.go
deleted file mode 100644
index af7f472bd..000000000
--- a/server/model/system/request/sys_chatgpt.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package request
-
-import (
- "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
- "github.com/flipped-aurora/gin-vue-admin/server/model/system"
-)
-
-type ChatGptRequest struct {
- system.ChatGpt
- request.PageInfo
-}
diff --git a/server/model/system/request/sys_dictionary.go b/server/model/system/request/sys_dictionary.go
deleted file mode 100644
index 170ed60db..000000000
--- a/server/model/system/request/sys_dictionary.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package request
-
-import (
- "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
- "github.com/flipped-aurora/gin-vue-admin/server/model/system"
-)
-
-type SysDictionarySearch struct {
- system.SysDictionary
- request.PageInfo
-}
diff --git a/server/model/system/request/sys_export_template.go b/server/model/system/request/sys_export_template.go
new file mode 100644
index 000000000..1010bf6b9
--- /dev/null
+++ b/server/model/system/request/sys_export_template.go
@@ -0,0 +1,14 @@
+package request
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+ "time"
+)
+
+type SysExportTemplateSearch struct {
+ system.SysExportTemplate
+ StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
+ EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
+ request.PageInfo
+}
diff --git a/server/model/system/request/sys_init.go b/server/model/system/request/sys_init.go
index 70034d365..cc9f254a5 100644
--- a/server/model/system/request/sys_init.go
+++ b/server/model/system/request/sys_init.go
@@ -2,19 +2,21 @@ package request
import (
"fmt"
- "github.com/flipped-aurora/gin-vue-admin/server/config"
"os"
+
+ "github.com/flipped-aurora/gin-vue-admin/server/config"
)
type InitDB struct {
- DBType string `json:"dbType"` // 数据库类型
- Host string `json:"host"` // 服务器地址
- Port string `json:"port"` // 数据库连接端口
- UserName string `json:"userName"` // 数据库用户名
- Password string `json:"password"` // 数据库密码
- DBName string `json:"dbName" binding:"required"` // 数据库名
- DBPath string `json:"dbPath"` // sqlite数据库文件路径
- Language string `json:"language",omitempty` // DB initial langauge // added by mohamed hassan to support multilanguage
+ AdminPassword string `json:"adminPassword" binding:"required"`
+ DBType string `json:"dbType"` // 数据库类型
+ Host string `json:"host"` // 服务器地址
+ Port string `json:"port"` // 数据库连接端口
+ UserName string `json:"userName"` // 数据库用户名
+ Password string `json:"password"` // 数据库密码
+ DBName string `json:"dbName" binding:"required"` // 数据库名
+ DBPath string `json:"dbPath"` // sqlite数据库文件路径
+ Language string `json:"language",omitempty` // DB initial langauge // added by mohamed hassan to support multilanguage
}
// MysqlEmptyDsn msyql 空数据库 建库链接
@@ -48,6 +50,10 @@ func (i *InitDB) SqliteEmptyDsn() string {
return i.DBPath + separator + i.DBName + ".db"
}
+func (i *InitDB) MssqlEmptyDsn() string {
+ return "sqlserver://" + i.UserName + ":" + i.Password + "@" + i.Host + ":" + i.Port + "?database=" + i.DBName + "&encrypt=disable"
+}
+
// ToMysqlConfig 转换 config.Mysql
// Author [SliverHorn](https://github.com/SliverHorn)
func (i *InitDB) ToMysqlConfig() config.Mysql {
@@ -101,3 +107,19 @@ func (i *InitDB) ToSqliteConfig() config.Sqlite {
},
}
}
+
+func (i *InitDB) ToMssqlConfig() config.Mssql {
+ return config.Mssql{
+ GeneralDB: config.GeneralDB{
+ Path: i.DBPath,
+ Port: i.Port,
+ Dbname: i.DBName,
+ Username: i.UserName,
+ Password: i.Password,
+ MaxIdleConns: 10,
+ MaxOpenConns: 100,
+ LogMode: "error",
+ Config: "",
+ },
+ }
+}
diff --git a/server/model/system/request/sys_menu.go b/server/model/system/request/sys_menu.go
index de39db8f1..2f5c7c46e 100644
--- a/server/model/system/request/sys_menu.go
+++ b/server/model/system/request/sys_menu.go
@@ -14,7 +14,7 @@ type AddMenuAuthorityInfo struct {
func DefaultMenu() []system.SysBaseMenu {
return []system.SysBaseMenu{{
GVA_MODEL: global.GVA_MODEL{ID: 1},
- ParentId: "0",
+ ParentId: 0,
Path: "dashboard",
Name: "dashboard",
Component: "view/dashboard/index.vue",
diff --git a/server/model/system/response/sys_api.go b/server/model/system/response/sys_api.go
index 09dc72f8b..20e382b9a 100644
--- a/server/model/system/response/sys_api.go
+++ b/server/model/system/response/sys_api.go
@@ -1,6 +1,8 @@
package response
-import "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+)
type SysAPIResponse struct {
Api system.SysApi `json:"api"`
@@ -9,3 +11,8 @@ type SysAPIResponse struct {
type SysAPIListResponse struct {
Apis []system.SysApi `json:"apis"`
}
+
+type SysSyncApis struct {
+ NewApis []system.SysApi `json:"newApis"`
+ DeleteApis []system.SysApi `json:"deleteApis"`
+}
diff --git a/server/model/system/response/sys_auto_code.go b/server/model/system/response/sys_auto_code.go
index 1e4400534..9e99bde3a 100644
--- a/server/model/system/response/sys_auto_code.go
+++ b/server/model/system/response/sys_auto_code.go
@@ -13,4 +13,5 @@ type Column struct {
ColumnName string `json:"columnName" gorm:"column:column_name"`
DataTypeLong string `json:"dataTypeLong" gorm:"column:data_type_long"`
ColumnComment string `json:"columnComment" gorm:"column:column_comment"`
+ PrimaryKey bool `json:"primaryKey" gorm:"column:primary_key"`
}
diff --git a/server/model/system/response/sys_auto_code_history.go b/server/model/system/response/sys_auto_code_history.go
deleted file mode 100644
index 071844c34..000000000
--- a/server/model/system/response/sys_auto_code_history.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package response
-
-import "time"
-
-type AutoCodeHistory struct {
- ID uint `json:"ID" gorm:"column:id"`
- CreatedAt time.Time `json:"CreatedAt" gorm:"column:created_at"`
- UpdatedAt time.Time `json:"UpdatedAt" gorm:"column:updated_at"`
- BusinessDB string `json:"businessDB" gorm:"column:business_db"`
- TableName string `json:"tableName" gorm:"column:table_name"`
- StructName string `json:"structName" gorm:"column:struct_name"`
- StructCNName string `json:"structCNName" gorm:"column:struct_cn_name"`
- Flag int `json:"flag" gorm:"column:flag"`
-}
diff --git a/server/model/system/response/sys_chatgpt.go b/server/model/system/response/sys_chatgpt.go
deleted file mode 100644
index 693a92a5a..000000000
--- a/server/model/system/response/sys_chatgpt.go
+++ /dev/null
@@ -1,4 +0,0 @@
-package response
-
-type ChatGptResponse struct {
-}
diff --git a/server/model/system/sys_api.go b/server/model/system/sys_api.go
index 2b6ab36ce..853ddb087 100644
--- a/server/model/system/sys_api.go
+++ b/server/model/system/sys_api.go
@@ -15,3 +15,14 @@ type SysApi struct {
func (SysApi) TableName() string {
return "sys_apis"
}
+
+type SysIgnoreApi struct {
+ global.GVA_MODEL
+ Path string `json:"path" gorm:"comment:api路径"` // api路径
+ Method string `json:"method" gorm:"default:POST;comment:方法"` // 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE
+ Flag bool `json:"flag" gorm:"-"` // 是否忽略
+}
+
+func (SysIgnoreApi) TableName() string {
+ return "sys_ignore_apis"
+}
diff --git a/server/model/system/sys_authority_menu.go b/server/model/system/sys_authority_menu.go
index ae39063ac..4467a7e10 100644
--- a/server/model/system/sys_authority_menu.go
+++ b/server/model/system/sys_authority_menu.go
@@ -2,7 +2,7 @@ package system
type SysMenu struct {
SysBaseMenu
- MenuId string `json:"menuId" gorm:"comment:菜单ID"`
+ MenuId uint `json:"menuId" gorm:"comment:菜单ID"`
AuthorityId uint `json:"-" gorm:"comment:角色ID"`
Children []SysMenu `json:"children" gorm:"-"`
Parameters []SysBaseMenuParameter `json:"parameters" gorm:"foreignKey:SysBaseMenuID;references:MenuId"`
diff --git a/server/model/system/sys_auto_code.go b/server/model/system/sys_auto_code.go
deleted file mode 100644
index 1e94dd787..000000000
--- a/server/model/system/sys_auto_code.go
+++ /dev/null
@@ -1,119 +0,0 @@
-package system
-
-import (
- "errors"
- "go/token"
- "strings"
-
- "github.com/flipped-aurora/gin-vue-admin/server/global"
-)
-
-// AutoCodeStruct 初始版本自动化代码工具
-type AutoCodeStruct struct {
- StructName string `json:"structName"` // Struct名称
- TableName string `json:"tableName"` // 表名
- PackageName string `json:"packageName"` // 文件名称
- HumpPackageName string `json:"humpPackageName"` // go文件名称
- Abbreviation string `json:"abbreviation"` // Struct简称
- Description string `json:"description"` // Struct中文名称
- AutoCreateApiToSql bool `json:"autoCreateApiToSql"` // 是否自动创建api
- AutoCreateResource bool `json:"autoCreateResource"` // 是否自动创建资源标识
- AutoMoveFile bool `json:"autoMoveFile"` // 是否自动移动文件
- BusinessDB string `json:"businessDB"` // 业务数据库
- Fields []*Field `json:"fields,omitempty"`
- HasTimer bool
- DictTypes []string `json:"-"`
- Package string `json:"package"`
- PackageT string `json:"-"`
- NeedValid bool `json:"-"`
- NeedSort bool `json:"-"`
- HasPic bool `json:"-"`
- HasRichText bool `json:"-"`
- HasFile bool `json:"-"`
- NeedJSON bool `json:"-"`
-}
-
-func (a *AutoCodeStruct) Pretreatment() {
- a.KeyWord()
- a.SuffixTest()
-}
-
-// KeyWord 是go关键字的处理加上 _ ,防止编译报错
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (a *AutoCodeStruct) KeyWord() {
- if token.IsKeyword(a.Abbreviation) {
- a.Abbreviation = a.Abbreviation + "_"
- }
-}
-
-// SuffixTest 处理_test 后缀
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (a *AutoCodeStruct) SuffixTest() {
- if strings.HasSuffix(a.HumpPackageName, "test") {
- a.HumpPackageName = a.HumpPackageName + "_"
- }
-}
-
-type Field struct {
- FieldName string `json:"fieldName"` // Field名
- FieldDesc string `json:"fieldDesc"` // 中文名
- FieldType string `json:"fieldType"` // Field数据类型
- FieldJson string `json:"fieldJson"` // FieldJson
- DataTypeLong string `json:"dataTypeLong"` // 数据库字段长度
- Comment string `json:"comment"` // 数据库字段描述
- ColumnName string `json:"columnName"` // 数据库字段
- FieldSearchType string `json:"fieldSearchType"` // 搜索条件
- DictType string `json:"dictType"` // 字典
- Require bool `json:"require"` // 是否必填
- ErrorText string `json:"errorText"` // 校验失败文字
- Clearable bool `json:"clearable"` // 是否可清空
- Sort bool `json:"sort"` // 是否增加排序
-}
-
-var ErrAutoMove error = errors.New("创建代码成功并移动文件成功")
-
-type SysAutoCode struct {
- global.GVA_MODEL
- PackageName string `json:"packageName" gorm:"comment:包名"`
- Label string `json:"label" gorm:"comment:展示名"`
- Desc string `json:"desc" gorm:"comment:描述"`
-}
-
-type AutoPlugReq struct {
- PlugName string `json:"plugName"` // 必然大写开头
- Snake string `json:"snake"` // 后端自动转为 snake
- RouterGroup string `json:"routerGroup"`
- HasGlobal bool `json:"hasGlobal"`
- HasRequest bool `json:"hasRequest"`
- HasResponse bool `json:"hasResponse"`
- NeedModel bool `json:"needModel"`
- Global []AutoPlugInfo `json:"global,omitempty"`
- Request []AutoPlugInfo `json:"request,omitempty"`
- Response []AutoPlugInfo `json:"response,omitempty"`
-}
-
-func (a *AutoPlugReq) CheckList() {
- a.Global = bind(a.Global)
- a.Request = bind(a.Request)
- a.Response = bind(a.Response)
-
-}
-func bind(req []AutoPlugInfo) []AutoPlugInfo {
- var r []AutoPlugInfo
- for _, info := range req {
- if info.Effective() {
- r = append(r, info)
- }
- }
- return r
-}
-
-type AutoPlugInfo struct {
- Key string `json:"key"`
- Type string `json:"type"`
- Desc string `json:"desc"`
-}
-
-func (a AutoPlugInfo) Effective() bool {
- return a.Key != "" && a.Type != "" && a.Desc != ""
-}
diff --git a/server/model/system/sys_auto_code_history.go b/server/model/system/sys_auto_code_history.go
new file mode 100644
index 000000000..a912fe8ff
--- /dev/null
+++ b/server/model/system/sys_auto_code_history.go
@@ -0,0 +1,66 @@
+package system
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "gorm.io/gorm"
+ "os"
+ "path"
+ "path/filepath"
+ "strings"
+)
+
+// SysAutoCodeHistory 自动迁移代码记录,用于回滚,重放使用
+type SysAutoCodeHistory struct {
+ global.GVA_MODEL
+ Table string `json:"tableName" gorm:"column:table_name;comment:表名"`
+ Package string `json:"package" gorm:"column:package;comment:模块名/插件名"`
+ Request string `json:"request" gorm:"type:text;column:request;comment:前端传入的结构化信息"`
+ StructName string `json:"structName" gorm:"column:struct_name;comment:结构体名称"`
+ BusinessDB string `json:"businessDb" gorm:"column:business_db;comment:业务库"`
+ Description string `json:"description" gorm:"column:description;comment:Struct中文名称"`
+ Templates map[string]string `json:"template" gorm:"serializer:json;type:text;column:templates;comment:模板信息"`
+ Injections map[string]string `json:"injections" gorm:"serializer:json;type:text;column:Injections;comment:注入路径"`
+ Flag int `json:"flag" gorm:"column:flag;comment:[0:创建,1:回滚]"`
+ ApiIDs []uint `json:"apiIDs" gorm:"serializer:json;column:api_ids;comment:api表注册内容"`
+ MenuID uint `json:"menuId" gorm:"column:menu_id;comment:菜单ID"`
+ AutoCodePackage SysAutoCodePackage `json:"autoCodePackage" gorm:"foreignKey:ID;references:PackageID"`
+ PackageID uint `json:"packageID" gorm:"column:package_id;comment:包ID"`
+}
+
+func (s *SysAutoCodeHistory) BeforeCreate(db *gorm.DB) error {
+ templates := make(map[string]string, len(s.Templates))
+ for key, value := range s.Templates {
+ server := filepath.Join(global.GVA_CONFIG.AutoCode.Root, global.GVA_CONFIG.AutoCode.Server)
+ {
+ hasServer := strings.Index(key, server)
+ if hasServer != -1 {
+ key = strings.TrimPrefix(key, server)
+ keys := strings.Split(key, string(os.PathSeparator))
+ key = path.Join(keys...)
+ }
+ } // key
+ web := filepath.Join(global.GVA_CONFIG.AutoCode.Root, global.GVA_CONFIG.AutoCode.WebRoot())
+ hasWeb := strings.Index(value, web)
+ if hasWeb != -1 {
+ value = strings.TrimPrefix(value, web)
+ values := strings.Split(value, string(os.PathSeparator))
+ value = path.Join(values...)
+ templates[key] = value
+ continue
+ }
+ hasServer := strings.Index(value, server)
+ if hasServer != -1 {
+ value = strings.TrimPrefix(value, server)
+ values := strings.Split(value, string(os.PathSeparator))
+ value = path.Join(values...)
+ templates[key] = value
+ continue
+ }
+ }
+ s.Templates = templates
+ return nil
+}
+
+func (s *SysAutoCodeHistory) TableName() string {
+ return "sys_auto_code_histories"
+}
diff --git a/server/model/system/sys_auto_code_package.go b/server/model/system/sys_auto_code_package.go
new file mode 100644
index 000000000..e87e88538
--- /dev/null
+++ b/server/model/system/sys_auto_code_package.go
@@ -0,0 +1,17 @@
+package system
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+)
+
+type SysAutoCodePackage struct {
+ global.GVA_MODEL
+ Desc string `json:"desc" gorm:"comment:描述"`
+ Label string `json:"label" gorm:"comment:展示名"`
+ Template string `json:"template" gorm:"comment:模版"`
+ PackageName string `json:"packageName" gorm:"comment:包名"`
+}
+
+func (s *SysAutoCodePackage) TableName() string {
+ return "sys_auto_code_packages"
+}
diff --git a/server/model/system/sys_autocode_history.go b/server/model/system/sys_autocode_history.go
deleted file mode 100644
index 07cac3bdc..000000000
--- a/server/model/system/sys_autocode_history.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package system
-
-import (
- "strconv"
- "strings"
-
- "github.com/flipped-aurora/gin-vue-admin/server/global"
- "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
-)
-
-// SysAutoCodeHistory 自动迁移代码记录,用于回滚,重放使用
-type SysAutoCodeHistory struct {
- global.GVA_MODEL
- Package string `json:"package"`
- BusinessDB string `json:"businessDB"`
- TableName string `json:"tableName"`
- RequestMeta string `gorm:"type:text" json:"requestMeta,omitempty"` // 前端传入的结构化信息
- AutoCodePath string `gorm:"type:text" json:"autoCodePath,omitempty"` // 其他meta信息 path;path
- InjectionMeta string `gorm:"type:text" json:"injectionMeta,omitempty"` // 注入的内容 RouterPath@functionName@RouterString;
- StructName string `json:"structName"`
- StructCNName string `json:"structCNName"`
- ApiIDs string `json:"apiIDs,omitempty"` // api表注册内容
- Flag int `json:"flag"` // 表示对应状态 0 代表创建, 1 代表回滚 ...
-}
-
-// ToRequestIds ApiIDs 转换 request.IdsReq
-// Author [SliverHorn](https://github.com/SliverHorn)
-func (m *SysAutoCodeHistory) ToRequestIds() request.IdsReq {
- if m.ApiIDs == "" {
- return request.IdsReq{}
- }
- slice := strings.Split(m.ApiIDs, ";")
- ids := make([]int, 0, len(slice))
- length := len(slice)
- for i := 0; i < length; i++ {
- id, _ := strconv.ParseInt(slice[i], 10, 32)
- ids = append(ids, int(id))
- }
- return request.IdsReq{Ids: ids}
-}
diff --git a/server/model/system/sys_base_menu.go b/server/model/system/sys_base_menu.go
index 0a2fdf27e..41cf37631 100644
--- a/server/model/system/sys_base_menu.go
+++ b/server/model/system/sys_base_menu.go
@@ -6,34 +6,34 @@ import (
type SysBaseMenu struct {
global.GVA_MODEL
- MenuLevel uint `json:"-"`
- ParentId string `json:"parentId" gorm:"comment:父菜单ID"` // 父菜单ID
- Path string `json:"path" gorm:"comment:路由path"` // 路由path
- Name string `json:"name" gorm:"comment:路由name"` // 路由name
- Hidden bool `json:"hidden" gorm:"comment:是否在列表隐藏"` // 是否在列表隐藏
- Component string `json:"component" gorm:"comment:对应前端文件路径"` // 对应前端文件路径
- Sort int `json:"sort" gorm:"comment:排序标记"` // 排序标记
- Meta `json:"meta" gorm:"embedded;comment:附加属性"` // 附加属性
- SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"`
- Children []SysBaseMenu `json:"children" gorm:"-"`
- Parameters []SysBaseMenuParameter `json:"parameters"`
- MenuBtn []SysBaseMenuBtn `json:"menuBtn"`
+ MenuLevel uint `json:"-"`
+ ParentId uint `json:"parentId" gorm:"comment:父菜单ID"` // 父菜单ID
+ Path string `json:"path" gorm:"comment:路由path"` // 路由path
+ Name string `json:"name" gorm:"comment:路由name"` // 路由name
+ Hidden bool `json:"hidden" gorm:"comment:是否在列表隐藏"` // 是否在列表隐藏
+ Component string `json:"component" gorm:"comment:对应前端文件路径"` // 对应前端文件路径
+ Sort int `json:"sort" gorm:"comment:排序标记"` // 排序标记
+ Meta `json:"meta" gorm:"embedded;comment:附加属性"` // 附加属性
+ SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"`
+ Children []SysBaseMenu `json:"children" gorm:"-"`
+ Parameters []SysBaseMenuParameter `json:"parameters"`
+ MenuBtn []SysBaseMenuBtn `json:"menuBtn"`
}
type Meta struct {
ActiveName string `json:"activeName" gorm:"comment:高亮菜单"`
- KeepAlive bool `json:"keepAlive" gorm:"comment:是否缓存"` // 是否缓存
+ KeepAlive bool `json:"keepAlive" gorm:"comment:是否缓存"` // 是否缓存
DefaultMenu bool `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"` // 是否是基础路由(开发中)
- Title string `json:"title" gorm:"comment:菜单名"` // 菜单名
- Icon string `json:"icon" gorm:"comment:菜单图标"` // 菜单图标
- CloseTab bool `json:"closeTab" gorm:"comment:自动关闭tab"` // 自动关闭tab
+ Title string `json:"title" gorm:"comment:菜单名"` // 菜单名
+ Icon string `json:"icon" gorm:"comment:菜单图标"` // 菜单图标
+ CloseTab bool `json:"closeTab" gorm:"comment:自动关闭tab"` // 自动关闭tab
}
type SysBaseMenuParameter struct {
global.GVA_MODEL
SysBaseMenuID uint
Type string `json:"type" gorm:"comment:地址栏携带参数为params还是query"` // 地址栏携带参数为params还是query
- Key string `json:"key" gorm:"comment:地址栏携带参数的key"` // 地址栏携带参数的key
+ Key string `json:"key" gorm:"comment:地址栏携带参数的key"` // 地址栏携带参数的key
Value string `json:"value" gorm:"comment:地址栏携带参数的值"` // 地址栏携带参数的值
}
diff --git a/server/model/system/sys_chatgpt.go b/server/model/system/sys_chatgpt.go
deleted file mode 100644
index 97e83aeec..000000000
--- a/server/model/system/sys_chatgpt.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package system
-
-type ChatGpt struct {
- DBName string `json:"dbname,omitempty"`
- Chat string `json:"chat,omitempty"`
- ChatID string `json:"chatID,omitempty"`
-}
-
-type SysChatGptOption struct {
- SK string `json:"sk"`
-}
-
-type ChatField struct {
- TABLE_NAME string
- COLUMN_NAME string
- COLUMN_COMMENT string
-}
-
-type ChatFieldNoTable struct {
- COLUMN_NAME string
- COLUMN_COMMENT string
-}
diff --git a/server/model/system/sys_dictionary_detail.go b/server/model/system/sys_dictionary_detail.go
index 443f10718..4084136c2 100644
--- a/server/model/system/sys_dictionary_detail.go
+++ b/server/model/system/sys_dictionary_detail.go
@@ -9,7 +9,7 @@ import (
type SysDictionaryDetail struct {
global.GVA_MODEL
Label string `json:"label" form:"label" gorm:"column:label;comment:展示值"` // 展示值
- Value int `json:"value" form:"value" gorm:"column:value;comment:字典值"` // 字典值
+ Value string `json:"value" form:"value" gorm:"column:value;comment:字典值"` // 字典值
Extend string `json:"extend" form:"extend" gorm:"column:extend;comment:扩展值"` // 扩展值
Status *bool `json:"status" form:"status" gorm:"column:status;comment:启用状态"` // 启用状态
Sort int `json:"sort" form:"sort" gorm:"column:sort;comment:排序标记"` // 排序标记
diff --git a/server/model/system/sys_export_template.go b/server/model/system/sys_export_template.go
new file mode 100644
index 000000000..aef24617d
--- /dev/null
+++ b/server/model/system/sys_export_template.go
@@ -0,0 +1,44 @@
+// 自动生成模板SysExportTemplate
+package system
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+)
+
+// 导出模板 结构体 SysExportTemplate
+type SysExportTemplate struct {
+ global.GVA_MODEL
+ DBName string `json:"dbName" form:"dbName" gorm:"column:db_name;comment:数据库名称;"` //数据库名称
+ Name string `json:"name" form:"name" gorm:"column:name;comment:模板名称;"` //模板名称
+ TableName string `json:"tableName" form:"tableName" gorm:"column:table_name;comment:表名称;"` //表名称
+ TemplateID string `json:"templateID" form:"templateID" gorm:"column:template_id;comment:模板标识;"` //模板标识
+ TemplateInfo string `json:"templateInfo" form:"templateInfo" gorm:"column:template_info;type:text;"` //模板信息
+ Limit *int `json:"limit" form:"limit" gorm:"column:limit;comment:导出限制"`
+ Order string `json:"order" form:"order" gorm:"column:order;comment:排序"`
+ Conditions []Condition `json:"conditions" form:"conditions" gorm:"foreignKey:TemplateID;references:TemplateID;comment:条件"`
+ JoinTemplate []JoinTemplate `json:"joinTemplate" form:"joinTemplate" gorm:"foreignKey:TemplateID;references:TemplateID;comment:关联"`
+}
+
+type JoinTemplate struct {
+ global.GVA_MODEL
+ TemplateID string `json:"templateID" form:"templateID" gorm:"column:template_id;comment:模板标识"`
+ JOINS string `json:"joins" form:"joins" gorm:"column:joins;comment:关联"`
+ Table string `json:"table" form:"table" gorm:"column:table;comment:关联表"`
+ ON string `json:"on" form:"on" gorm:"column:on;comment:关联条件"`
+}
+
+func (JoinTemplate) TableName() string {
+ return "sys_export_template_join"
+}
+
+type Condition struct {
+ global.GVA_MODEL
+ TemplateID string `json:"templateID" form:"templateID" gorm:"column:template_id;comment:模板标识"`
+ From string `json:"from" form:"from" gorm:"column:from;comment:条件取的key"`
+ Column string `json:"column" form:"column" gorm:"column:column;comment:作为查询条件的字段"`
+ Operator string `json:"operator" form:"operator" gorm:"column:operator;comment:操作符"`
+}
+
+func (Condition) TableName() string {
+ return "sys_export_template_condition"
+}
diff --git a/server/model/system/sys_operation_record.go b/server/model/system/sys_operation_record.go
index bd316bb4e..3d201d30d 100644
--- a/server/model/system/sys_operation_record.go
+++ b/server/model/system/sys_operation_record.go
@@ -15,7 +15,7 @@ type SysOperationRecord struct {
Path string `json:"path" form:"path" gorm:"column:path;comment:请求路径"` // 请求路径
Status int `json:"status" form:"status" gorm:"column:status;comment:请求状态"` // 请求状态
Latency time.Duration `json:"latency" form:"latency" gorm:"column:latency;comment:延迟" swaggertype:"string"` // 延迟
- Agent string `json:"agent" form:"agent" gorm:"column:agent;comment:代理"` // 代理
+ Agent string `json:"agent" form:"agent" gorm:"type:text;column:agent;comment:代理"` // 代理
ErrorMessage string `json:"error_message" form:"error_message" gorm:"column:error_message;comment:错误信息"` // 错误信息
Body string `json:"body" form:"body" gorm:"type:text;column:body;comment:请求Body"` // 请求Body
Resp string `json:"resp" form:"resp" gorm:"type:text;column:resp;comment:响应Body"` // 响应Body
diff --git a/server/model/system/sys_user.go b/server/model/system/sys_user.go
index e9857203b..9a6892abc 100644
--- a/server/model/system/sys_user.go
+++ b/server/model/system/sys_user.go
@@ -5,6 +5,17 @@ import (
"github.com/gofrs/uuid/v5"
)
+type Login interface {
+ GetUsername() string
+ GetNickname() string
+ GetUUID() uuid.UUID
+ GetUserId() uint
+ GetAuthorityId() uint
+ GetUserInfo() any
+}
+
+var _ Login = new(SysUser)
+
type SysUser struct {
global.GVA_MODEL
UUID uuid.UUID `json:"uuid" gorm:"index;comment:用户UUID"` // 用户UUID
@@ -14,7 +25,6 @@ type SysUser struct {
SideMode string `json:"sideMode" gorm:"default:dark;comment:用户侧边主题"` // 用户侧边主题
HeaderImg string `json:"headerImg" gorm:"default:https://qmplusimg.henrongyi.top/gva_header.jpg;comment:用户头像"` // 用户头像
BaseColor string `json:"baseColor" gorm:"default:#fff;comment:基础颜色"` // 基础颜色
- ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"` // 活跃颜色
AuthorityId uint `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID
Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"`
Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;"`
@@ -26,3 +36,27 @@ type SysUser struct {
func (SysUser) TableName() string {
return "sys_users"
}
+
+func (s *SysUser) GetUsername() string {
+ return s.Username
+}
+
+func (s *SysUser) GetNickname() string {
+ return s.NickName
+}
+
+func (s *SysUser) GetUUID() uuid.UUID {
+ return s.UUID
+}
+
+func (s *SysUser) GetUserId() uint {
+ return s.ID
+}
+
+func (s *SysUser) GetAuthorityId() uint {
+ return s.AuthorityId
+}
+
+func (s *SysUser) GetUserInfo() any {
+ return *s
+}
diff --git a/server/plugin/announcement/api/enter.go b/server/plugin/announcement/api/enter.go
new file mode 100644
index 000000000..7fee6fc2b
--- /dev/null
+++ b/server/plugin/announcement/api/enter.go
@@ -0,0 +1,10 @@
+package api
+
+import "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/service"
+
+var (
+ Api = new(api)
+ serviceInfo = service.Service.Info
+)
+
+type api struct{ Info info }
diff --git a/server/plugin/announcement/api/info.go b/server/plugin/announcement/api/info.go
new file mode 100644
index 000000000..dd0faa350
--- /dev/null
+++ b/server/plugin/announcement/api/info.go
@@ -0,0 +1,183 @@
+package api
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/model"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/model/request"
+ "github.com/gin-gonic/gin"
+ "go.uber.org/zap"
+)
+
+var Info = new(info)
+
+type info struct{}
+
+// CreateInfo 创建公告
+// @Tags Info
+// @Summary 创建公告
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.Info true "创建公告"
+// @Success 200 {object} response.Response{msg=string} "创建成功"
+// @Router /info/createInfo [post]
+func (a *info) CreateInfo(c *gin.Context) {
+ var info model.Info
+ err := c.ShouldBindJSON(&info)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = serviceInfo.CreateInfo(&info)
+ if err != nil {
+ global.GVA_LOG.Error("创建失败!", zap.Error(err))
+ response.FailWithMessage("创建失败", c)
+ return
+ }
+ response.OkWithMessage("创建成功", c)
+}
+
+// DeleteInfo 删除公告
+// @Tags Info
+// @Summary 删除公告
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.Info true "删除公告"
+// @Success 200 {object} response.Response{msg=string} "删除成功"
+// @Router /info/deleteInfo [delete]
+func (a *info) DeleteInfo(c *gin.Context) {
+ ID := c.Query("ID")
+ err := serviceInfo.DeleteInfo(ID)
+ if err != nil {
+ global.GVA_LOG.Error("删除失败!", zap.Error(err))
+ response.FailWithMessage("删除失败", c)
+ return
+ }
+ response.OkWithMessage("删除成功", c)
+}
+
+// DeleteInfoByIds 批量删除公告
+// @Tags Info
+// @Summary 批量删除公告
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{msg=string} "批量删除成功"
+// @Router /info/deleteInfoByIds [delete]
+func (a *info) DeleteInfoByIds(c *gin.Context) {
+ IDs := c.QueryArray("IDs[]")
+ if err := serviceInfo.DeleteInfoByIds(IDs); err != nil {
+ global.GVA_LOG.Error("批量删除失败!", zap.Error(err))
+ response.FailWithMessage("批量删除失败", c)
+ return
+ }
+ response.OkWithMessage("批量删除成功", c)
+}
+
+// UpdateInfo 更新公告
+// @Tags Info
+// @Summary 更新公告
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body model.Info true "更新公告"
+// @Success 200 {object} response.Response{msg=string} "更新成功"
+// @Router /info/updateInfo [put]
+func (a *info) UpdateInfo(c *gin.Context) {
+ var info model.Info
+ err := c.ShouldBindJSON(&info)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ err = serviceInfo.UpdateInfo(info)
+ if err != nil {
+ global.GVA_LOG.Error("更新失败!", zap.Error(err))
+ response.FailWithMessage("更新失败", c)
+ return
+ }
+ response.OkWithMessage("更新成功", c)
+}
+
+// FindInfo 用id查询公告
+// @Tags Info
+// @Summary 用id查询公告
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query model.Info true "用id查询公告"
+// @Success 200 {object} response.Response{data=model.Info,msg=string} "查询成功"
+// @Router /info/findInfo [get]
+func (a *info) FindInfo(c *gin.Context) {
+ ID := c.Query("ID")
+ reinfo, err := serviceInfo.GetInfo(ID)
+ if err != nil {
+ global.GVA_LOG.Error("查询失败!", zap.Error(err))
+ response.FailWithMessage("查询失败", c)
+ return
+ }
+ response.OkWithData(reinfo, c)
+}
+
+// GetInfoList 分页获取公告列表
+// @Tags Info
+// @Summary 分页获取公告列表
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query request.InfoSearch true "分页获取公告列表"
+// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "获取成功"
+// @Router /info/getInfoList [get]
+func (a *info) GetInfoList(c *gin.Context) {
+ var pageInfo request.InfoSearch
+ err := c.ShouldBindQuery(&pageInfo)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ list, total, err := serviceInfo.GetInfoInfoList(pageInfo)
+ if err != nil {
+ global.GVA_LOG.Error("获取失败!", zap.Error(err))
+ response.FailWithMessage("获取失败", c)
+ return
+ }
+ response.OkWithDetailed(response.PageResult{
+ List: list,
+ Total: total,
+ Page: pageInfo.Page,
+ PageSize: pageInfo.PageSize,
+ }, "获取成功", c)
+}
+
+// GetInfoDataSource 获取Info的数据源
+// @Tags Info
+// @Summary 获取Info的数据源
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{data=object,msg=string} "查询成功"
+// @Router /info/getInfoDataSource [get]
+func (a *info) GetInfoDataSource(c *gin.Context) {
+ // 此接口为获取数据源定义的数据
+ dataSource, err := serviceInfo.GetInfoDataSource()
+ if err != nil {
+ global.GVA_LOG.Error("查询失败!", zap.Error(err))
+ response.FailWithMessage("查询失败", c)
+ return
+ }
+ response.OkWithData(dataSource, c)
+}
+
+// GetInfoPublic 不需要鉴权的公告接口
+// @Tags Info
+// @Summary 不需要鉴权的公告接口
+// @accept application/json
+// @Produce application/json
+// @Param data query request.InfoSearch true "分页获取公告列表"
+// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
+// @Router /info/getInfoPublic [get]
+func (a *info) GetInfoPublic(c *gin.Context) {
+ // 此接口不需要鉴权 示例为返回了一个固定的消息接口,一般本接口用于C端服务,需要自己实现业务逻辑
+ response.OkWithDetailed(gin.H{"info": "不需要鉴权的公告接口信息"}, "获取成功", c)
+}
diff --git a/server/plugin/announcement/config/config.go b/server/plugin/announcement/config/config.go
new file mode 100644
index 000000000..809bc990f
--- /dev/null
+++ b/server/plugin/announcement/config/config.go
@@ -0,0 +1,4 @@
+package config
+
+type Config struct {
+}
diff --git a/server/plugin/announcement/gen/gen.go b/server/plugin/announcement/gen/gen.go
new file mode 100644
index 000000000..240749ff1
--- /dev/null
+++ b/server/plugin/announcement/gen/gen.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "gorm.io/gen"
+ "path/filepath" //go:generate go mod tidy
+ //go:generate go mod download
+ //go:generate go run gen.go
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/model"
+)
+
+func main() {
+ g := gen.NewGenerator(gen.Config{OutPath: filepath.Join("..", "..", "..", "announcement", "blender", "model", "dao"), Mode: gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface})
+ g.ApplyBasic(
+ new(model.Info),
+ )
+ g.Execute()
+}
diff --git a/server/plugin/announcement/initialize/api.go b/server/plugin/announcement/initialize/api.go
new file mode 100644
index 000000000..6d0fed1d0
--- /dev/null
+++ b/server/plugin/announcement/initialize/api.go
@@ -0,0 +1,49 @@
+package initialize
+
+import (
+ "context"
+ model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/plugin-tool/utils"
+)
+
+func Api(ctx context.Context) {
+ entities := []model.SysApi{
+ {
+ Path: "/info/createInfo",
+ Description: "新建公告",
+ ApiGroup: "公告",
+ Method: "POST",
+ },
+ {
+ Path: "/info/deleteInfo",
+ Description: "删除公告",
+ ApiGroup: "公告",
+ Method: "DELETE",
+ },
+ {
+ Path: "/info/deleteInfoByIds",
+ Description: "批量删除公告",
+ ApiGroup: "公告",
+ Method: "DELETE",
+ },
+ {
+ Path: "/info/updateInfo",
+ Description: "更新公告",
+ ApiGroup: "公告",
+ Method: "PUT",
+ },
+ {
+ Path: "/info/findInfo",
+ Description: "根据ID获取公告",
+ ApiGroup: "公告",
+ Method: "GET",
+ },
+ {
+ Path: "/info/getInfoList",
+ Description: "获取公告列表",
+ ApiGroup: "公告",
+ Method: "GET",
+ },
+ }
+ utils.RegisterApis(entities...)
+}
diff --git a/server/plugin/announcement/initialize/gorm.go b/server/plugin/announcement/initialize/gorm.go
new file mode 100644
index 000000000..3a88ff25a
--- /dev/null
+++ b/server/plugin/announcement/initialize/gorm.go
@@ -0,0 +1,20 @@
+package initialize
+
+import (
+ "context"
+ "fmt"
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/model"
+ "github.com/pkg/errors"
+ "go.uber.org/zap"
+)
+
+func Gorm(ctx context.Context) {
+ err := global.GVA_DB.WithContext(ctx).AutoMigrate(
+ new(model.Info),
+ )
+ if err != nil {
+ err = errors.Wrap(err, "注册表失败!")
+ zap.L().Error(fmt.Sprintf("%+v", err))
+ }
+}
diff --git a/server/plugin/announcement/initialize/menu.go b/server/plugin/announcement/initialize/menu.go
new file mode 100644
index 000000000..40aff2b50
--- /dev/null
+++ b/server/plugin/announcement/initialize/menu.go
@@ -0,0 +1,22 @@
+package initialize
+
+import (
+ "context"
+ model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/plugin-tool/utils"
+)
+
+func Menu(ctx context.Context) {
+ entities := []model.SysBaseMenu{
+ {
+ ParentId: 24,
+ Path: "anInfo",
+ Name: "anInfo",
+ Hidden: false,
+ Component: "plugin/announcement/view/info.vue",
+ Sort: 5,
+ Meta: model.Meta{Title: "公告管理", Icon: "box"},
+ },
+ }
+ utils.RegisterMenus(entities...)
+}
diff --git a/server/plugin/announcement/initialize/router.go b/server/plugin/announcement/initialize/router.go
new file mode 100644
index 000000000..e2c4f1787
--- /dev/null
+++ b/server/plugin/announcement/initialize/router.go
@@ -0,0 +1,15 @@
+package initialize
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/middleware"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/router"
+ "github.com/gin-gonic/gin"
+)
+
+func Router(engine *gin.Engine) {
+ public := engine.Group(global.GVA_CONFIG.System.RouterPrefix).Group("")
+ private := engine.Group(global.GVA_CONFIG.System.RouterPrefix).Group("")
+ private.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
+ router.Router.Info.Init(public, private)
+}
diff --git a/server/plugin/announcement/initialize/viper.go b/server/plugin/announcement/initialize/viper.go
new file mode 100644
index 000000000..68cfff685
--- /dev/null
+++ b/server/plugin/announcement/initialize/viper.go
@@ -0,0 +1,17 @@
+package initialize
+
+import (
+ "fmt"
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/plugin"
+ "github.com/pkg/errors"
+ "go.uber.org/zap"
+)
+
+func Viper() {
+ err := global.GVA_VP.UnmarshalKey("announcement", &plugin.Config)
+ if err != nil {
+ err = errors.Wrap(err, "初始化配置文件失败!")
+ zap.L().Error(fmt.Sprintf("%+v", err))
+ }
+}
diff --git a/server/plugin/announcement/model/info.go b/server/plugin/announcement/model/info.go
new file mode 100644
index 000000000..fcaa11f59
--- /dev/null
+++ b/server/plugin/announcement/model/info.go
@@ -0,0 +1,20 @@
+package model
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "gorm.io/datatypes"
+)
+
+// Info 公告 结构体
+type Info struct {
+ global.GVA_MODEL
+ Title string `json:"title" form:"title" gorm:"column:title;comment:公告标题;"` //标题
+ Content string `json:"content" form:"content" gorm:"column:content;comment:公告内容;type:text;"` //内容
+ UserID *int `json:"userID" form:"userID" gorm:"column:user_id;comment:发布者;"` //作者
+ Attachments datatypes.JSON `json:"attachments" form:"attachments" gorm:"column:attachments;comment:相关附件;"swaggertype:"array,object"` //附件
+}
+
+// TableName 公告 Info自定义表名 gva_announcements_info
+func (Info) TableName() string {
+ return "gva_announcements_info"
+}
diff --git a/server/plugin/announcement/model/request/info.go b/server/plugin/announcement/model/request/info.go
new file mode 100644
index 000000000..35be3e032
--- /dev/null
+++ b/server/plugin/announcement/model/request/info.go
@@ -0,0 +1,12 @@
+package request
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+ "time"
+)
+
+type InfoSearch struct {
+ StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
+ EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
+ request.PageInfo
+}
diff --git a/server/plugin/announcement/plugin.go b/server/plugin/announcement/plugin.go
new file mode 100644
index 000000000..a20edb894
--- /dev/null
+++ b/server/plugin/announcement/plugin.go
@@ -0,0 +1,26 @@
+package announcement
+
+import (
+ "context"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/initialize"
+ interfaces "github.com/flipped-aurora/gin-vue-admin/server/utils/plugin/v2"
+ "github.com/gin-gonic/gin"
+)
+
+var _ interfaces.Plugin = (*plugin)(nil)
+
+var Plugin = new(plugin)
+
+type plugin struct{}
+
+func (p *plugin) Register(group *gin.Engine) {
+ ctx := context.Background()
+ // 如果需要配置文件,请到config.Config中填充配置结构,且到下方发放中填入其在config.yaml中的key
+ // initialize.Viper()
+ // 安装插件时候自动注册的api数据请到下方法.Api方法中实现
+ initialize.Api(ctx)
+ // 安装插件时候自动注册的api数据请到下方法.Menu方法中实现
+ initialize.Menu(ctx)
+ initialize.Gorm(ctx)
+ initialize.Router(group)
+}
diff --git a/server/plugin/announcement/plugin/plugin.go b/server/plugin/announcement/plugin/plugin.go
new file mode 100644
index 000000000..405823980
--- /dev/null
+++ b/server/plugin/announcement/plugin/plugin.go
@@ -0,0 +1,5 @@
+package plugin
+
+import "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/config"
+
+var Config config.Config
diff --git a/server/plugin/announcement/router/enter.go b/server/plugin/announcement/router/enter.go
new file mode 100644
index 000000000..543e0ffb2
--- /dev/null
+++ b/server/plugin/announcement/router/enter.go
@@ -0,0 +1,10 @@
+package router
+
+import "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/api"
+
+var (
+ Router = new(router)
+ apiInfo = api.Api.Info
+)
+
+type router struct{ Info info }
diff --git a/server/plugin/announcement/router/info.go b/server/plugin/announcement/router/info.go
new file mode 100644
index 000000000..8de316b35
--- /dev/null
+++ b/server/plugin/announcement/router/info.go
@@ -0,0 +1,31 @@
+package router
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/middleware"
+ "github.com/gin-gonic/gin"
+)
+
+var Info = new(info)
+
+type info struct{}
+
+// Init 初始化 公告 路由信息
+func (r *info) Init(public *gin.RouterGroup, private *gin.RouterGroup) {
+ {
+ group := private.Group("info").Use(middleware.OperationRecord())
+ group.POST("createInfo", apiInfo.CreateInfo) // 新建公告
+ group.DELETE("deleteInfo", apiInfo.DeleteInfo) // 删除公告
+ group.DELETE("deleteInfoByIds", apiInfo.DeleteInfoByIds) // 批量删除公告
+ group.PUT("updateInfo", apiInfo.UpdateInfo) // 更新公告
+ }
+ {
+ group := private.Group("info")
+ group.GET("findInfo", apiInfo.FindInfo) // 根据ID获取公告
+ group.GET("getInfoList", apiInfo.GetInfoList) // 获取公告列表
+ }
+ {
+ group := public.Group("info")
+ group.GET("getInfoDataSource", apiInfo.GetInfoDataSource) // 获取公告数据源
+ group.GET("getInfoPublic", apiInfo.GetInfoPublic) // 获取公告列表
+ }
+}
diff --git a/server/plugin/announcement/service/enter.go b/server/plugin/announcement/service/enter.go
new file mode 100644
index 000000000..988fbcd76
--- /dev/null
+++ b/server/plugin/announcement/service/enter.go
@@ -0,0 +1,5 @@
+package service
+
+var Service = new(service)
+
+type service struct{ Info info }
diff --git a/server/plugin/announcement/service/info.go b/server/plugin/announcement/service/info.go
new file mode 100644
index 000000000..b52155393
--- /dev/null
+++ b/server/plugin/announcement/service/info.go
@@ -0,0 +1,78 @@
+package service
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/model"
+ "github.com/flipped-aurora/gin-vue-admin/server/plugin/announcement/model/request"
+)
+
+var Info = new(info)
+
+type info struct{}
+
+// CreateInfo 创建公告记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (s *info) CreateInfo(info *model.Info) (err error) {
+ err = global.GVA_DB.Create(info).Error
+ return err
+}
+
+// DeleteInfo 删除公告记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (s *info) DeleteInfo(ID string) (err error) {
+ err = global.GVA_DB.Delete(&model.Info{}, "id = ?", ID).Error
+ return err
+}
+
+// DeleteInfoByIds 批量删除公告记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (s *info) DeleteInfoByIds(IDs []string) (err error) {
+ err = global.GVA_DB.Delete(&[]model.Info{}, "id in ?", IDs).Error
+ return err
+}
+
+// UpdateInfo 更新公告记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (s *info) UpdateInfo(info model.Info) (err error) {
+ err = global.GVA_DB.Model(&model.Info{}).Where("id = ?", info.ID).Updates(&info).Error
+ return err
+}
+
+// GetInfo 根据ID获取公告记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (s *info) GetInfo(ID string) (info model.Info, err error) {
+ err = global.GVA_DB.Where("id = ?", ID).First(&info).Error
+ return
+}
+
+// GetInfoInfoList 分页获取公告记录
+// Author [piexlmax](https://github.com/piexlmax)
+func (s *info) GetInfoInfoList(info request.InfoSearch) (list []model.Info, total int64, err error) {
+ limit := info.PageSize
+ offset := info.PageSize * (info.Page - 1)
+ // 创建db
+ db := global.GVA_DB.Model(&model.Info{})
+ var infos []model.Info
+ // 如果有条件搜索 下方会自动创建搜索语句
+ if info.StartCreatedAt != nil && info.EndCreatedAt != nil {
+ db = db.Where("created_at BETWEEN ? AND ?", info.StartCreatedAt, info.EndCreatedAt)
+ }
+ err = db.Count(&total).Error
+ if err != nil {
+ return
+ }
+
+ if limit != 0 {
+ db = db.Limit(limit).Offset(offset)
+ }
+ err = db.Find(&infos).Error
+ return infos, total, err
+}
+func (s *info) GetInfoDataSource() (res map[string][]map[string]any, err error) {
+ res = make(map[string][]map[string]any)
+
+ userID := make([]map[string]any, 0)
+ global.GVA_DB.Table("sys_users").Select("nick_name as label,id as value").Scan(&userID)
+ res["userID"] = userID
+ return
+}
diff --git a/server/plugin/plugin-tool/utils/check.go b/server/plugin/plugin-tool/utils/check.go
index 937aa8ed3..4ea21921e 100644
--- a/server/plugin/plugin-tool/utils/check.go
+++ b/server/plugin/plugin-tool/utils/check.go
@@ -2,9 +2,9 @@ package utils
import (
"fmt"
+
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
- "strconv"
)
func RegisterApis(apis ...system.SysApi) {
@@ -15,7 +15,6 @@ func RegisterApis(apis ...system.SysApi) {
}
global.GVA_DB.Find(&[]system.SysApi{}, "path in (?)", apiPaths).Count(&count)
if count > 0 {
- fmt.Println("插件已安装或存在同名路由")
return
}
err := global.GVA_DB.Create(&apis).Error
@@ -34,16 +33,14 @@ func RegisterMenus(menus ...system.SysBaseMenu) {
}
global.GVA_DB.Find(&[]system.SysBaseMenu{}, "name in (?)", menuNames).Count(&count)
if count > 0 {
- fmt.Println("插件已安装或存在同名菜单")
return
}
- parentMenu.ParentId = "0"
err := global.GVA_DB.Create(&parentMenu).Error
if err != nil {
fmt.Println(err)
}
for i := range otherMenus {
- pid := strconv.Itoa(int(parentMenu.ID))
+ pid := parentMenu.ID
otherMenus[i].ParentId = pid
}
err = global.GVA_DB.Create(&otherMenus).Error
diff --git a/server/resource/autocode_template/server/model.go.tpl b/server/resource/autocode_template/server/model.go.tpl
deleted file mode 100644
index abd68bf5f..000000000
--- a/server/resource/autocode_template/server/model.go.tpl
+++ /dev/null
@@ -1,40 +0,0 @@
-// 自动生成模板{{.StructName}}
-package {{.Package}}
-
-import (
- "github.com/flipped-aurora/gin-vue-admin/server/global"
- {{ if .HasTimer }}"time"{{ end }}
- {{ if .NeedJSON }}"gorm.io/datatypes"{{ end }}
-)
-
-// {{.Description}} 结构体 {{.StructName}}
-type {{.StructName}} struct {
- global.GVA_MODEL {{- range .Fields}}
- {{- if eq .FieldType "enum" }}
- {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};type:enum({{.DataTypeLong}});comment:{{.Comment}};"`
- {{- else if eq .FieldType "picture" }}
- {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"`
- {{- else if eq .FieldType "file" }}
- {{.FieldName}} datatypes.JSON `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"`
- {{- else if eq .FieldType "pictures" }}
- {{.FieldName}} datatypes.JSON `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"`
- {{- else if eq .FieldType "richtext" }}
- {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}type:text;"`
- {{- else if ne .FieldType "string" }}
- {{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"`
- {{- else }}
- {{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}"`
- {{- end }} {{ if .FieldDesc }}//{{.FieldDesc}} {{ end }} {{- end }}
- {{- if .AutoCreateResource }}
- CreatedBy uint `gorm:"column:created_by;comment:创建者"`
- UpdatedBy uint `gorm:"column:updated_by;comment:更新者"`
- DeletedBy uint `gorm:"column:deleted_by;comment:删除者"`
- {{- end}}
-}
-
-{{ if .TableName }}
-// TableName {{.Description}} {{.StructName}}自定义表名 {{.TableName}}
-func ({{.StructName}}) TableName() string {
- return "{{.TableName}}"
-}
-{{ end }}
diff --git a/server/resource/autocode_template/server/request.go.tpl b/server/resource/autocode_template/server/request.go.tpl
deleted file mode 100644
index c9e09309d..000000000
--- a/server/resource/autocode_template/server/request.go.tpl
+++ /dev/null
@@ -1,24 +0,0 @@
-package request
-
-import (
- "github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}"
- "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
- "time"
-)
-
-type {{.StructName}}Search struct{
- {{.Package}}.{{.StructName}}
- StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
- EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
- {{- range .Fields}}
- {{- if eq .FieldSearchType "BETWEEN" "NOT BETWEEN"}}
- Start{{.FieldName}} *{{.FieldType}} `json:"start{{.FieldName}}" form:"start{{.FieldName}}"`
- End{{.FieldName}} *{{.FieldType}} `json:"end{{.FieldName}}" form:"end{{.FieldName}}"`
- {{- end }}
- {{- end }}
- request.PageInfo
- {{- if .NeedSort}}
- Sort string `json:"sort" form:"sort"`
- Order string `json:"order" form:"order"`
- {{- end}}
-}
diff --git a/server/resource/autocode_template/subcontract/api_enter.go.tpl b/server/resource/autocode_template/subcontract/api_enter.go.tpl
deleted file mode 100644
index d94193b8e..000000000
--- a/server/resource/autocode_template/subcontract/api_enter.go.tpl
+++ /dev/null
@@ -1,4 +0,0 @@
-package {{ .PackageName }}
-
-type ApiGroup struct {
-}
diff --git a/server/resource/autocode_template/subcontract/data.go b/server/resource/autocode_template/subcontract/data.go
deleted file mode 100644
index cb445a5e1..000000000
--- a/server/resource/autocode_template/subcontract/data.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package subcontract
-
-import (
- _ "embed"
-)
-
-//go:embed api_enter.go.tpl
-var API []byte
-
-//go:embed router_enter.go.tpl
-var Router []byte
-
-//go:embed service_enter.go.tpl
-var Server []byte
diff --git a/server/resource/autocode_template/subcontract/router_enter.go.tpl b/server/resource/autocode_template/subcontract/router_enter.go.tpl
deleted file mode 100644
index 24dec196f..000000000
--- a/server/resource/autocode_template/subcontract/router_enter.go.tpl
+++ /dev/null
@@ -1,4 +0,0 @@
-package {{ .PackageName }}
-
-type RouterGroup struct {
-}
diff --git a/server/resource/autocode_template/subcontract/service_enter.go.tpl b/server/resource/autocode_template/subcontract/service_enter.go.tpl
deleted file mode 100644
index c8d82a4de..000000000
--- a/server/resource/autocode_template/subcontract/service_enter.go.tpl
+++ /dev/null
@@ -1,6 +0,0 @@
-package {{ .PackageName }}
-
-
-type ServiceGroup struct {
-}
-
diff --git a/server/resource/function/api.go.tpl b/server/resource/function/api.go.tpl
new file mode 100644
index 000000000..c788a9fa1
--- /dev/null
+++ b/server/resource/function/api.go.tpl
@@ -0,0 +1,41 @@
+{{if .IsPlugin}}
+// {{.FuncName}} 等待开发的的{{.Description}}接口
+// @Tags {{.StructName}}
+// @Summary 等待开发的的{{.Description}}接口
+// @accept application/json
+// @Produce application/json
+// @Param data query request.{{.StructName}}Search true "分页获取{{.Description}}列表"
+// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
+// @Router /{{.Abbreviation}}/{{.Router}} [{{.Method}}]
+func (a *{{.Abbreviation}}) {{.FuncName}}(c *gin.Context) {
+ // 请添加自己的业务逻辑
+ err := service{{ .StructName }}.{{.FuncName}}()
+ if err != nil {
+ global.GVA_LOG.Error("失败!", zap.Error(err))
+ response.FailWithMessage("失败", c)
+ return
+ }
+ response.OkWithData("返回数据",c)
+}
+
+{{- else -}}
+
+// {{.FuncName}} 等待开发的的{{.Description}}接口
+// @Tags {{.StructName}}
+// @Summary 等待开发的的{{.Description}}接口
+// @accept application/json
+// @Produce application/json
+// @Param data query {{.Package}}Req.{{.StructName}}Search true "成功"
+// @Success 200 {object} response.Response{data=object,msg=string} "成功"
+// @Router /{{.Abbreviation}}/{{.Router}} [{{.Method}}]
+func ({{.Abbreviation}}Api *{{.StructName}}Api){{.FuncName}}(c *gin.Context) {
+ // 请添加自己的业务逻辑
+ err := {{.Abbreviation}}Service.{{.FuncName}}()
+ if err != nil {
+ global.GVA_LOG.Error("失败!", zap.Error(err))
+ response.FailWithMessage("失败", c)
+ return
+ }
+ response.OkWithData("返回数据",c)
+}
+{{end}}
\ No newline at end of file
diff --git a/server/resource/function/server.go.tpl b/server/resource/function/server.go.tpl
new file mode 100644
index 000000000..da3f4fe22
--- /dev/null
+++ b/server/resource/function/server.go.tpl
@@ -0,0 +1,25 @@
+{{- $db := "" }}
+{{- if eq .BusinessDB "" }}
+ {{- $db = "global.GVA_DB" }}
+{{- else}}
+ {{- $db = printf "global.MustGetGlobalDBByDBName(\"%s\")" .BusinessDB }}
+{{- end}}
+{{if .IsPlugin}}
+
+// {{.FuncName}} 请实现方法
+// Author [yourname](https://github.com/yourname)
+func (s *{{.Abbreviation}}) {{.FuncName}}() (err error) {
+ db := {{$db}}.Model(&model.{{.StructName}}{})
+ return db.Error
+}
+
+{{- else -}}
+
+// {{.FuncName}} 请实现方法
+// Author [yourname](https://github.com/yourname)
+func ({{.Abbreviation}}Service *{{.StructName}}Service){{.FuncName}}() (err error) {
+ // 请在这里实现自己的业务逻辑
+ db := {{$db}}.Model(&{{.Package}}.{{.StructName}}{})
+ return db.Error
+}
+{{end}}
\ No newline at end of file
diff --git a/server/resource/lang/en.json b/server/resource/lang/en.json
index 20348e2ac..da12daf4b 100644
--- a/server/resource/lang/en.json
+++ b/server/resource/lang/en.json
@@ -70,7 +70,9 @@
"previewFailErr": "Preview failed",
"previewSuccess": "Previewed successfully",
"autoCreateFail": "Automatic creation failed! Please clear the junk data yourself!",
- "queryTablesFail": "Failed to query tables"
+ "queryTablesFail": "Failed to query tables",
+ "largeModelCreationFail" : "Large model generation failed!",
+ "largeModelCreationFailErr" : "Large model generation failed"
},
"sys_initdb": {
"paramVerifyFail": "Parameter verification failed!",
@@ -103,6 +105,7 @@
"changePassword": "Change password (recommended)",
"changeRoleAPIPermission": "Change role api permissions",
"codeGen": "Code Generator",
+ "templateConfiguration" : "Template Configuration",
"codeGenHistory": "Code generator log",
"copyRole": "Copy Role",
"createAPI": "Create API",
@@ -143,12 +146,27 @@
"updateAPI": "Update APIs",
"updateMenu": "Update Menu",
"updateRole": "Update Role",
- "userRegistration": "User registration"
+ "userRegistration": "User registration",
+ "configurationTemplates" : "Configuration template",
+ "getTemplateFile" : "Get the template file",
+ "getAllTemplates" : "Get all templates",
+ "deleteTemplate" : "Delete template",
+ "buttonAuthority" : "Button Authority",
+ "tableTemplate" : "Table Templates",
+ "announcement" : "Announcement",
+ "newAnnouncement" : "New Announcement",
+ "deleteAnnouncement" : "Delete Announcement",
+ "batchDeleteAnnouncement" : "Batch Delete Announcement",
+ "updateAnnouncement" : "Update Announcement",
+ "getAnnouncementByID" : "Get Announcements By ID",
+ "getAnnouncementList" : "Get Announcement List",
+ "" : ""
},
"authority": {
"normalUserSubRole": "Normal User Sub-Role",
"normalUsers": "Normal Users",
- "testRole": "Test Role"
+ "testRole": "Test Role",
+ "permissionRefreshFailed" : "Created successfully, permission refresh failed."
},
"dictionary": {
"boolType": "Boolean Type",
@@ -200,5 +218,14 @@
"welcomeTo" : "Welcome to",
"currentVersion" : "Current version"
}
+ },
+ "model" : {
+ "common" : {
+ "response" : {
+ "success" : "Success",
+ "operationSuccess" : "The operation was successful.",
+ "operationFail" : "The operation fail."
+ }
+ }
}
}
diff --git a/server/resource/lang/zh.json b/server/resource/lang/zh.json
index a53bd52ab..8c3a7e232 100644
--- a/server/resource/lang/zh.json
+++ b/server/resource/lang/zh.json
@@ -70,7 +70,9 @@
"previewFailErr": "预览失败",
"previewSuccess": "预览成功",
"autoCreateFail": "自动化创建失败!请自行清空垃圾数据!",
- "queryTablesFail": "查询table失败"
+ "queryTablesFail": "查询table失败",
+ "largeModelCreationFail" : "大模型生成失败!",
+ "largeModelCreationFailErr" : "大模型生成失败"
},
"sys_initdb": {
"paramVerifyFail": "参数校验不通过!",
@@ -103,6 +105,7 @@
"changePassword": "修改密码(建议选择)",
"changeRoleAPIPermission": "更改角色api权限",
"codeGen": "代码生成器",
+ "templateConfiguration" : "模板配置",
"codeGenHistory": "代码生成器历史",
"copyRole": "拷贝角色",
"createAPI": "创建api",
@@ -143,12 +146,27 @@
"updateAPI": "更新Api",
"updateMenu": "更新菜单",
"updateRole": "更新角色信息",
- "userRegistration": "用户注册"
+ "userRegistration": "用户注册",
+ "configurationTemplates" : "配置模板",
+ "getTemplateFile" : "获取模板文件",
+ "getAllTemplates" : "获取所有模板",
+ "deleteTemplate" : "删除模板",
+ "buttonAuthority" : "按钮权限",
+ "tableTemplate" : "表格模板",
+ "announcement" : "公告",
+ "newAnnouncement" : "新建公告",
+ "deleteAnnouncement" : "删除公告",
+ "batchDeleteAnnouncement" : "批量删除公告",
+ "updateAnnouncement" : "更新公告",
+ "getAnnouncementByID" : "根据ID获取公告",
+ "getAnnouncementList" : "获取公告列表",
+ "" : ""
},
"authority": {
"normalUserSubRole": "普通用户子角色",
"normalUsers": "普通用户",
- "testRole": "测试角色"
+ "testRole": "测试角色",
+ "permissionRefreshFailed" : "创建成功,权限刷新失败。"
},
"dictionary": {
"boolType": "数据库bool类型",
@@ -200,5 +218,14 @@
"welcomeTo" : "欢迎使用",
"currentVersion" : "当前版本"
}
+ },
+ "model" : {
+ "common" : {
+ "response" : {
+ "success" : "成功",
+ "operationSuccess" : "操作成功",
+ "operationFail" : "操作失败"
+ }
+ }
}
}
diff --git a/server/resource/autocode_template/readme.txt.tpl b/server/resource/package/readme.txt.tpl
similarity index 100%
rename from server/resource/autocode_template/readme.txt.tpl
rename to server/resource/package/readme.txt.tpl
diff --git a/server/resource/autocode_template/server/api.go.tpl b/server/resource/package/server/api/api.go.tpl
similarity index 55%
rename from server/resource/autocode_template/server/api.go.tpl
rename to server/resource/package/server/api/api.go.tpl
index 9c62f1ef1..7f2ce0c31 100644
--- a/server/resource/autocode_template/server/api.go.tpl
+++ b/server/resource/package/server/api/api.go.tpl
@@ -2,25 +2,17 @@ package {{.Package}}
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
- "github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}"
- "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
- {{.Package}}Req "github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
- "github.com/flipped-aurora/gin-vue-admin/server/service"
+ "github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}"
+ {{.Package}}Req "github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}/request"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
- {{- if .NeedValid }}
- "github.com/flipped-aurora/gin-vue-admin/server/utils"
- {{- else if .AutoCreateResource}}
+ {{- if .AutoCreateResource}}
"github.com/flipped-aurora/gin-vue-admin/server/utils"
{{- end }}
)
-type {{.StructName}}Api struct {
-}
-
-var {{.Abbreviation}}Service = service.ServiceGroupApp.{{.PackageT}}ServiceGroup.{{.StructName}}Service
-
+type {{.StructName}}Api struct {}
// Create{{.StructName}} 创建{{.Description}}
// @Tags {{.StructName}}
@@ -29,7 +21,7 @@ var {{.Abbreviation}}Service = service.ServiceGroupApp.{{.PackageT}}ServiceGroup
// @accept application/json
// @Produce application/json
// @Param data body {{.Package}}.{{.StructName}} true "创建{{.Description}}"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":global.Translate("general.getDataSuccess")}"
+// @Success 200 {object} response.Response{msg=string} "创建成功"
// @Router /{{.Abbreviation}}/create{{.StructName}} [post]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Create{{.StructName}}(c *gin.Context) {
var {{.Abbreviation}} {{.Package}}.{{.StructName}}
@@ -41,25 +33,13 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Create{{.StructName}}(c *gin.Con
{{- if .AutoCreateResource }}
{{.Abbreviation}}.CreatedBy = utils.GetUserID(c)
{{- end }}
- {{- if .NeedValid }}
- verify := utils.Rules{
- {{- range $index,$element := .Fields }}
- {{- if $element.Require }}
- "{{$element.FieldName}}":{utils.NotEmpty()},
- {{- end }}
- {{- end }}
- }
- if err := utils.Verify({{.Abbreviation}}, verify); err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- {{- end }}
- if err := {{.Abbreviation}}Service.Create{{.StructName}}({{.Abbreviation}}); err != nil {
+ err = {{.Abbreviation}}Service.Create{{.StructName}}(&{{.Abbreviation}})
+ if err != nil {
global.GVA_LOG.Error(global.Translate("general.creationFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.creationFailErr"), c)
- } else {
- response.OkWithMessage(global.Translate("general.createSuccss"), c)
+ return
}
+ response.OkWithMessage(global.Translate("general.createSuccss"), c)
}
// Delete{{.StructName}} 删除{{.Description}}
@@ -69,24 +49,20 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Create{{.StructName}}(c *gin.Con
// @accept application/json
// @Produce application/json
// @Param data body {{.Package}}.{{.StructName}} true "删除{{.Description}}"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
+// @Success 200 {object} response.Response{msg=string} "删除成功"
// @Router /{{.Abbreviation}}/delete{{.StructName}} [delete]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Delete{{.StructName}}(c *gin.Context) {
- var {{.Abbreviation}} {{.Package}}.{{.StructName}}
- err := c.ShouldBindJSON(&{{.Abbreviation}})
- if err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
+ {{.PrimaryField.FieldJson}} := c.Query("{{.PrimaryField.FieldJson}}")
{{- if .AutoCreateResource }}
- {{.Abbreviation}}.DeletedBy = utils.GetUserID(c)
+ userID := utils.GetUserID(c)
{{- end }}
- if err := {{.Abbreviation}}Service.Delete{{.StructName}}({{.Abbreviation}}); err != nil {
+ err := {{.Abbreviation}}Service.Delete{{.StructName}}({{.PrimaryField.FieldJson}} {{- if .AutoCreateResource -}},userID{{- end -}})
+ if err != nil {
global.GVA_LOG.Error(global.Translate("general.deleteFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.deletFailErr"), c)
- } else {
- response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
+ return
}
+ response.OkWithMessage(global.Translate("general.deleteSuccess"), c)
}
// Delete{{.StructName}}ByIds 批量删除{{.Description}}
@@ -95,25 +71,20 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Delete{{.StructName}}(c *gin.Con
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
-// @Param data body request.IdsReq true "批量删除{{.Description}}"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
+// @Success 200 {object} response.Response{msg=string} "批量删除成功"
// @Router /{{.Abbreviation}}/delete{{.StructName}}ByIds [delete]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Delete{{.StructName}}ByIds(c *gin.Context) {
- var IDS request.IdsReq
- err := c.ShouldBindJSON(&IDS)
+ {{.PrimaryField.FieldJson}}s := c.QueryArray("{{.PrimaryField.FieldJson}}s[]")
+ {{- if .AutoCreateResource }}
+ userID := utils.GetUserID(c)
+ {{- end }}
+ err := {{.Abbreviation}}Service.Delete{{.StructName}}ByIds({{.PrimaryField.FieldJson}}s{{- if .AutoCreateResource }},userID{{- end }})
if err != nil {
- response.FailWithMessage(err.Error(), c)
+ global.GVA_LOG.Error(global.Translate("sys_operation_record.batchDeleteFail"), zap.Error(err))
+ response.FailWithMessage("sys_operation_record.batchDeleteFailErr"), c)
return
}
- {{- if .AutoCreateResource }}
- deletedBy := utils.GetUserID(c)
- {{- end }}
- if err := {{.Abbreviation}}Service.Delete{{.StructName}}ByIds(IDS{{- if .AutoCreateResource }},deletedBy{{- end }}); err != nil {
- global.GVA_LOG.Error(global.Translate("sys_operation_record.batchDeleteFail"), zap.Error(err))
- response.FailWithMessage(global.Translate("sys_operation_record.batchDeleteFailErr"), c)
- } else {
- response.OkWithMessage(global.Translate("sys_operation_record.batchDeleteSuccess"), c)
- }
+ response.OkWithMessage(global.Translate("sys_operation_record.batchDeleteSuccess"), c)
}
// Update{{.StructName}} 更新{{.Description}}
@@ -123,7 +94,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Delete{{.StructName}}ByIds(c *gi
// @accept application/json
// @Produce application/json
// @Param data body {{.Package}}.{{.StructName}} true "更新{{.Description}}"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
+// @Success 200 {object} response.Response{msg=string} "更新成功"
// @Router /{{.Abbreviation}}/update{{.StructName}} [put]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Context) {
var {{.Abbreviation}} {{.Package}}.{{.StructName}}
@@ -135,25 +106,13 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Con
{{- if .AutoCreateResource }}
{{.Abbreviation}}.UpdatedBy = utils.GetUserID(c)
{{- end }}
- {{- if .NeedValid }}
- verify := utils.Rules{
- {{- range $index,$element := .Fields }}
- {{- if $element.Require }}
- "{{$element.FieldName}}":{utils.NotEmpty()},
- {{- end }}
- {{- end }}
- }
- if err := utils.Verify({{.Abbreviation}}, verify); err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- {{- end }}
- if err := {{.Abbreviation}}Service.Update{{.StructName}}({{.Abbreviation}}); err != nil {
+ err = {{.Abbreviation}}Service.Update{{.StructName}}({{.Abbreviation}})
+ if err != nil {
global.GVA_LOG.Error(global.Translate("general.updateFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.updateFailErr"), c)
- } else {
- response.OkWithMessage(global.Translate("general.updateSuccess"), c)
+ return
}
+ response.OkWithMessage("general.updateSuccess"), c)
}
// Find{{.StructName}} 用id查询{{.Description}}
@@ -163,21 +122,17 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Con
// @accept application/json
// @Produce application/json
// @Param data query {{.Package}}.{{.StructName}} true "用id查询{{.Description}}"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Success 200 {object} response.Response{data={{.Package}}.{{.StructName}},msg=string} "查询成功"
// @Router /{{.Abbreviation}}/find{{.StructName}} [get]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Context) {
- var {{.Abbreviation}} {{.Package}}.{{.StructName}}
- err := c.ShouldBindQuery(&{{.Abbreviation}})
+ {{.PrimaryField.FieldJson}} := c.Query("{{.PrimaryField.FieldJson}}")
+ re{{.Abbreviation}}, err := {{.Abbreviation}}Service.Get{{.StructName}}({{.PrimaryField.FieldJson}})
if err != nil {
- response.FailWithMessage(err.Error(), c)
- return
- }
- if re{{.Abbreviation}}, err := {{.Abbreviation}}Service.Get{{.StructName}}({{.Abbreviation}}.ID); err != nil {
global.GVA_LOG.Error(global.Translate("general.queryFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.queryFailErr"), c)
- } else {
- response.OkWithData(gin.H{"re{{.Abbreviation}}": re{{.Abbreviation}}}, c)
+ return
}
+ response.OkWithData(re{{.Abbreviation}}, c)
}
// Get{{.StructName}}List 分页获取{{.Description}}列表
@@ -187,7 +142,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Conte
// @accept application/json
// @Produce application/json
// @Param data query {{.Package}}Req.{{.StructName}}Search true "分页获取{{.Description}}列表"
-// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
+// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "获取成功"
// @Router /{{.Abbreviation}}/get{{.StructName}}List [get]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Context) {
var pageInfo {{.Package}}Req.{{.StructName}}Search
@@ -196,15 +151,52 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Co
response.FailWithMessage(err.Error(), c)
return
}
- if list, total, err := {{.Abbreviation}}Service.Get{{.StructName}}InfoList(pageInfo); err != nil {
+ list, total, err := {{.Abbreviation}}Service.Get{{.StructName}}InfoList(pageInfo)
+ if err != nil {
global.GVA_LOG.Error(global.Translate("general.getDataFail"), zap.Error(err))
response.FailWithMessage(global.Translate("general.getDataFailErr"), c)
- } else {
- response.OkWithDetailed(response.PageResult{
- List: list,
- Total: total,
- Page: pageInfo.Page,
- PageSize: pageInfo.PageSize,
- }, global.Translate("general.getDataSuccess"), c)
+ return
}
+ response.OkWithDetailed(response.PageResult{
+ List: list,
+ Total: total,
+ Page: pageInfo.Page,
+ PageSize: pageInfo.PageSize,
+ }, global.Translate("general.getDataSuccess"), c)
+}
+
+{{- if .HasDataSource }}
+// Get{{.StructName}}DataSource 获取{{.StructName}}的数据源
+// @Tags {{.StructName}}
+// @Summary 获取{{.StructName}}的数据源
+// @accept application/json
+// @Produce application/json
+// @Success 200 {object} response.Response{data=object,msg=string} "查询成功"
+// @Router /{{.Abbreviation}}/get{{.StructName}}DataSource [get]
+func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}DataSource(c *gin.Context) {
+ // 此接口为获取数据源定义的数据
+ dataSource, err := {{.Abbreviation}}Service.Get{{.StructName}}DataSource()
+ if err != nil {
+ global.GVA_LOG.Error(global.Translate("general.queryFail"), zap.Error(err))
+ response.FailWithMessage(global.Translate("general.queryFailErr"), c)
+ return
+ }
+ response.OkWithData(dataSource, c)
+}
+{{- end }}
+
+// Get{{.StructName}}Public 不需要鉴权的{{.Description}}接口
+// @Tags {{.StructName}}
+// @Summary 不需要鉴权的{{.Description}}接口
+// @accept application/json
+// @Produce application/json
+// @Param data query {{.Package}}Req.{{.StructName}}Search true "分页获取{{.Description}}列表"
+// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
+// @Router /{{.Abbreviation}}/get{{.StructName}}Public [get]
+func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}Public(c *gin.Context) {
+ // 此接口不需要鉴权
+ // 示例为返回了一个固定的消息接口,一般本接口用于C端服务,需要自己实现业务逻辑
+ response.OkWithDetailed(gin.H{
+ "info": "不需要鉴权的{{.Description}}接口信息",
+ }, "获取成功", c)
}
diff --git a/server/resource/package/server/api/enter.go.tpl b/server/resource/package/server/api/enter.go.tpl
new file mode 100644
index 000000000..778b3146e
--- /dev/null
+++ b/server/resource/package/server/api/enter.go.tpl
@@ -0,0 +1,4 @@
+package {{ .Package }}
+
+type ApiGroup struct {
+}
\ No newline at end of file
diff --git a/server/resource/package/server/model/model.go.tpl b/server/resource/package/server/model/model.go.tpl
new file mode 100644
index 000000000..07ca69725
--- /dev/null
+++ b/server/resource/package/server/model/model.go.tpl
@@ -0,0 +1,56 @@
+// 自动生成模板{{.StructName}}
+package {{.Package}}
+
+import (
+ {{- if .GvaModel }}
+ "github.com/flipped-aurora/gin-vue-admin/server/global"
+ {{- end }}
+ {{- if or .HasTimer }}
+ "time"
+ {{- end }}
+ {{- if .NeedJSON }}
+ "gorm.io/datatypes"
+ {{- end }}
+)
+
+// {{.Description}} 结构体 {{.StructName}}
+type {{.StructName}} struct {
+{{- if .GvaModel }}
+ global.GVA_MODEL
+{{- end }}
+{{- range .Fields}}
+ {{- if eq .FieldType "enum" }}
+ {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};type:enum({{.DataTypeLong}});comment:{{.Comment}};" {{- if .Require }} binding:"required"{{- end -}}`
+ {{- else if eq .FieldType "picture" }}
+ {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}" {{- if .Require }} binding:"required"{{- end -}}`
+ {{- else if eq .FieldType "video" }}
+ {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}" {{- if .Require }} binding:"required"{{- end -}}`
+ {{- else if eq .FieldType "file" }}
+ {{.FieldName}} datatypes.JSON `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}" {{- if .Require }} binding:"required"{{- end -}} swaggertype:"array,object"`
+ {{- else if eq .FieldType "pictures" }}
+ {{.FieldName}} datatypes.JSON `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}" {{- if .Require }} binding:"required"{{- end -}} swaggertype:"array,object"`
+ {{- else if eq .FieldType "richtext" }}
+ {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}type:text;" {{- if .Require }} binding:"required"{{- end -}}`
+ {{- else if eq .FieldType "json" }}
+ {{.FieldName}} datatypes.JSON `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}type:text;" {{- if .Require }} binding:"required"{{- end -}} swaggertype:"object"`
+ {{- else if eq .FieldType "array" }}
+ {{.FieldName}} datatypes.JSON `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}type:text;" {{- if .Require }} binding:"required"{{- end -}} swaggertype:"array,object"`
+ {{- else if ne .FieldType "string" }}
+ {{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}" {{- if .Require }} binding:"required"{{- end -}}`
+ {{- else }}
+ {{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"{{- if ne .FieldIndexType "" -}}{{ .FieldIndexType }};{{- end -}}{{- if .PrimaryKey -}}primarykey;{{- end -}}{{- if .DefaultValue -}}default:{{ .DefaultValue }};{{- end -}}column:{{.ColumnName}};comment:{{.Comment}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}" {{- if .Require }} binding:"required"{{- end -}}`
+ {{- end }} {{ if .FieldDesc }}//{{.FieldDesc}} {{ end }}
+{{- end }}
+ {{- if .AutoCreateResource }}
+ CreatedBy uint `gorm:"column:created_by;comment:创建者"`
+ UpdatedBy uint `gorm:"column:updated_by;comment:更新者"`
+ DeletedBy uint `gorm:"column:deleted_by;comment:删除者"`
+ {{- end }}
+}
+
+{{ if .TableName }}
+// TableName {{.Description}} {{.StructName}}自定义表名 {{.TableName}}
+func ({{.StructName}}) TableName() string {
+ return "{{.TableName}}"
+}
+{{ end }}
diff --git a/server/resource/package/server/model/request/request.go.tpl b/server/resource/package/server/model/request/request.go.tpl
new file mode 100644
index 000000000..db43825ee
--- /dev/null
+++ b/server/resource/package/server/model/request/request.go.tpl
@@ -0,0 +1,40 @@
+package request
+
+import (
+ "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
+ {{ if or .HasSearchTimer .GvaModel}}"time"{{ end }}
+)
+
+type {{.StructName}}Search struct{
+{{- if .GvaModel }}
+ StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
+ EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
+{{- end }}
+{{- range .Fields}}
+ {{- if ne .FieldSearchType ""}}
+ {{- if eq .FieldSearchType "BETWEEN" "NOT BETWEEN"}}
+ Start{{.FieldName}} *{{.FieldType}} `json:"start{{.FieldName}}" form:"start{{.FieldName}}"`
+ End{{.FieldName}} *{{.FieldType}} `json:"end{{.FieldName}}" form:"end{{.FieldName}}"`
+ {{- else }}
+ {{- if eq .FieldType "enum" }}
+ {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}"`
+ {{- else if eq .FieldType "picture" }}
+ {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" `
+ {{- else if eq .FieldType "video" }}
+ {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" `
+ {{- else if eq .FieldType "richtext" }}
+ {{.FieldName}} string `json:"{{.FieldJson}}" form:"{{.FieldJson}}" `
+ {{- else if ne .FieldType "string" }}
+ {{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" `
+ {{- else }}
+ {{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" `
+ {{- end }}
+ {{- end }}
+ {{- end}}
+{{- end }}
+ request.PageInfo
+ {{- if .NeedSort}}
+ Sort string `json:"sort" form:"sort"`
+ Order string `json:"order" form:"order"`
+ {{- end}}
+}
diff --git a/server/resource/package/server/router/enter.go.tpl b/server/resource/package/server/router/enter.go.tpl
new file mode 100644
index 000000000..178aecf3b
--- /dev/null
+++ b/server/resource/package/server/router/enter.go.tpl
@@ -0,0 +1,4 @@
+package {{ .Package }}
+
+type RouterGroup struct {
+}
\ No newline at end of file
diff --git a/server/resource/autocode_template/server/router.go.tpl b/server/resource/package/server/router/router.go.tpl
similarity index 70%
rename from server/resource/autocode_template/server/router.go.tpl
rename to server/resource/package/server/router/router.go.tpl
index dc706305d..aa5e9005f 100644
--- a/server/resource/autocode_template/server/router.go.tpl
+++ b/server/resource/package/server/router/router.go.tpl
@@ -1,19 +1,17 @@
package {{.Package}}
import (
- "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
"github.com/flipped-aurora/gin-vue-admin/server/middleware"
"github.com/gin-gonic/gin"
)
-type {{.StructName}}Router struct {
-}
+type {{.StructName}}Router struct {}
// Init{{.StructName}}Router 初始化 {{.Description}} 路由信息
-func (s *{{.StructName}}Router) Init{{.StructName}}Router(Router *gin.RouterGroup) {
+func (s *{{.StructName}}Router) Init{{.StructName}}Router(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
{{.Abbreviation}}Router := Router.Group("{{.Abbreviation}}").Use(middleware.OperationRecord())
{{.Abbreviation}}RouterWithoutRecord := Router.Group("{{.Abbreviation}}")
- var {{.Abbreviation}}Api = v1.ApiGroupApp.{{.PackageT}}ApiGroup.{{.StructName}}Api
+ {{.Abbreviation}}RouterWithoutAuth := PublicRouter.Group("{{.Abbreviation}}")
{
{{.Abbreviation}}Router.POST("create{{.StructName}}", {{.Abbreviation}}Api.Create{{.StructName}}) // 新建{{.Description}}
{{.Abbreviation}}Router.DELETE("delete{{.StructName}}", {{.Abbreviation}}Api.Delete{{.StructName}}) // 删除{{.Description}}
@@ -24,4 +22,10 @@ func (s *{{.StructName}}Router) Init{{.StructName}}Router(Router *gin.RouterGrou
{{.Abbreviation}}RouterWithoutRecord.GET("find{{.StructName}}", {{.Abbreviation}}Api.Find{{.StructName}}) // 根据ID获取{{.Description}}
{{.Abbreviation}}RouterWithoutRecord.GET("get{{.StructName}}List", {{.Abbreviation}}Api.Get{{.StructName}}List) // 获取{{.Description}}列表
}
+ {
+ {{- if .HasDataSource}}
+ {{.Abbreviation}}RouterWithoutAuth.GET("get{{.StructName}}DataSource", {{.Abbreviation}}Api.Get{{.StructName}}DataSource) // 获取{{.Description}}数据源
+ {{- end}}
+ {{.Abbreviation}}RouterWithoutAuth.GET("get{{.StructName}}Public", {{.Abbreviation}}Api.Get{{.StructName}}Public) // 获取{{.Description}}列表
+ }
}
diff --git a/server/resource/package/server/service/enter.go.tpl b/server/resource/package/server/service/enter.go.tpl
new file mode 100644
index 000000000..adf1db02e
--- /dev/null
+++ b/server/resource/package/server/service/enter.go.tpl
@@ -0,0 +1,4 @@
+package {{ .Package }}
+
+type ServiceGroup struct {
+}
\ No newline at end of file
diff --git a/server/resource/autocode_template/server/service.go.tpl b/server/resource/package/server/service/service.go.tpl
similarity index 67%
rename from server/resource/autocode_template/server/service.go.tpl
rename to server/resource/package/server/service/service.go.tpl
index 1a28e37e7..625f9756e 100644
--- a/server/resource/autocode_template/server/service.go.tpl
+++ b/server/resource/package/server/service/service.go.tpl
@@ -3,15 +3,13 @@ package {{.Package}}
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}"
- "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
{{.Package}}Req "github.com/flipped-aurora/gin-vue-admin/server/model/{{.Package}}/request"
{{- if .AutoCreateResource }}
"gorm.io/gorm"
{{- end}}
)
-type {{.StructName}}Service struct {
-}
+type {{.StructName}}Service struct {}
{{- $db := "" }}
{{- if eq .BusinessDB "" }}
@@ -29,38 +27,38 @@ func ({{.Abbreviation}}Service *{{.StructName}}Service) Create{{.StructName}}({{
// Delete{{.StructName}} 删除{{.Description}}记录
// Author [piexlmax](https://github.com/piexlmax)
-func ({{.Abbreviation}}Service *{{.StructName}}Service)Delete{{.StructName}}({{.Abbreviation}} {{.Package}}.{{.StructName}}) (err error) {
+func ({{.Abbreviation}}Service *{{.StructName}}Service)Delete{{.StructName}}({{.PrimaryField.FieldJson}} string{{- if .AutoCreateResource -}},userID uint{{- end -}}) (err error) {
{{- if .AutoCreateResource }}
err = {{$db}}.Transaction(func(tx *gorm.DB) error {
- if err := tx.Model(&{{.Package}}.{{.StructName}}{}).Where("id = ?", {{.Abbreviation}}.ID).Update("deleted_by", {{.Abbreviation}}.DeletedBy).Error; err != nil {
+ if err := tx.Model(&{{.Package}}.{{.StructName}}{}).Where("{{.PrimaryField.ColumnName}} = ?", {{.PrimaryField.FieldJson}}).Update("deleted_by", userID).Error; err != nil {
return err
}
- if err = tx.Delete(&{{.Abbreviation}}).Error; err != nil {
+ if err = tx.Delete(&{{.Package}}.{{.StructName}}{},"{{.PrimaryField.ColumnName}} = ?",{{.PrimaryField.FieldJson}}).Error; err != nil {
return err
}
return nil
})
{{- else }}
- err = {{$db}}.Delete(&{{.Abbreviation}}).Error
+ err = {{$db}}.Delete(&{{.Package}}.{{.StructName}}{},"{{.PrimaryField.ColumnName}} = ?",{{.PrimaryField.FieldJson}}).Error
{{- end }}
return err
}
// Delete{{.StructName}}ByIds 批量删除{{.Description}}记录
// Author [piexlmax](https://github.com/piexlmax)
-func ({{.Abbreviation}}Service *{{.StructName}}Service)Delete{{.StructName}}ByIds(ids request.IdsReq{{- if .AutoCreateResource }},deleted_by uint{{- end}}) (err error) {
+func ({{.Abbreviation}}Service *{{.StructName}}Service)Delete{{.StructName}}ByIds({{.PrimaryField.FieldJson}}s []string {{- if .AutoCreateResource }},deleted_by uint{{- end}}) (err error) {
{{- if .AutoCreateResource }}
err = {{$db}}.Transaction(func(tx *gorm.DB) error {
- if err := tx.Model(&{{.Package}}.{{.StructName}}{}).Where("id in ?", ids.Ids).Update("deleted_by", deleted_by).Error; err != nil {
+ if err := tx.Model(&{{.Package}}.{{.StructName}}{}).Where("{{.PrimaryField.ColumnName}} in ?", {{.PrimaryField.FieldJson}}s).Update("deleted_by", deleted_by).Error; err != nil {
return err
}
- if err := tx.Where("id in ?", ids.Ids).Delete(&{{.Package}}.{{.StructName}}{}).Error; err != nil {
+ if err := tx.Where("{{.PrimaryField.ColumnName}} in ?", {{.PrimaryField.FieldJson}}s).Delete(&{{.Package}}.{{.StructName}}{}).Error; err != nil {
return err
}
return nil
})
{{- else}}
- err = {{$db}}.Delete(&[]{{.Package}}.{{.StructName}}{},"id in ?",ids.Ids).Error
+ err = {{$db}}.Delete(&[]{{.Package}}.{{.StructName}}{},"{{.PrimaryField.ColumnName}} in ?",{{.PrimaryField.FieldJson}}s).Error
{{- end}}
return err
}
@@ -68,14 +66,14 @@ func ({{.Abbreviation}}Service *{{.StructName}}Service)Delete{{.StructName}}ById
// Update{{.StructName}} 更新{{.Description}}记录
// Author [piexlmax](https://github.com/piexlmax)
func ({{.Abbreviation}}Service *{{.StructName}}Service)Update{{.StructName}}({{.Abbreviation}} {{.Package}}.{{.StructName}}) (err error) {
- err = {{$db}}.Save(&{{.Abbreviation}}).Error
+ err = {{$db}}.Model(&{{.Package}}.{{.StructName}}{}).Where("{{.PrimaryField.ColumnName}} = ?",{{.Abbreviation}}.{{.PrimaryField.FieldName}}).Updates(&{{.Abbreviation}}).Error
return err
}
-// Get{{.StructName}} 根据id获取{{.Description}}记录
+// Get{{.StructName}} 根据{{.PrimaryField.FieldJson}}获取{{.Description}}记录
// Author [piexlmax](https://github.com/piexlmax)
-func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}(id uint) ({{.Abbreviation}} {{.Package}}.{{.StructName}}, err error) {
- err = {{$db}}.Where("id = ?", id).First(&{{.Abbreviation}}).Error
+func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}({{.PrimaryField.FieldJson}} string) ({{.Abbreviation}} {{.Package}}.{{.StructName}}, err error) {
+ err = {{$db}}.Where("{{.PrimaryField.ColumnName}} = ?", {{.PrimaryField.FieldJson}}).First(&{{.Abbreviation}}).Error
return
}
@@ -88,12 +86,14 @@ func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}InfoLis
db := {{$db}}.Model(&{{.Package}}.{{.StructName}}{})
var {{.Abbreviation}}s []{{.Package}}.{{.StructName}}
// 如果有条件搜索 下方会自动创建搜索语句
+{{- if .GvaModel }}
if info.StartCreatedAt !=nil && info.EndCreatedAt !=nil {
db = db.Where("created_at BETWEEN ? AND ?", info.StartCreatedAt, info.EndCreatedAt)
}
+{{- end }}
{{- range .Fields}}
{{- if .FieldSearchType}}
- {{- if or (eq .FieldType "string") (eq .FieldType "enum") }}
+ {{- if or (eq .FieldType "string") (eq .FieldType "enum") (eq .FieldType "picture") (eq .FieldType "video") (eq .FieldType "richtext") }}
if info.{{.FieldName}} != "" {
db = db.Where("{{.ColumnName}} {{.FieldSearchType}} ?",{{if eq .FieldSearchType "LIKE"}}"%"+ {{ end }}info.{{.FieldName}}{{if eq .FieldSearchType "LIKE"}}+"%"{{ end }})
}
@@ -136,3 +136,15 @@ func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}InfoLis
err = db.Find(&{{.Abbreviation}}s).Error
return {{.Abbreviation}}s, total, err
}
+
+{{- if .HasDataSource }}
+func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}DataSource() (res map[string][]map[string]any, err error) {
+ res = make(map[string][]map[string]any)
+ {{range $key, $value := .DataSourceMap}}
+ {{$key}} := make([]map[string]any, 0)
+ {{$db}}.Table("{{$value.Table}}").Select("{{$value.Label}} as label,{{$value.Value}} as value").Scan(&{{$key}})
+ res["{{$key}}"] = {{$key}}
+ {{- end }}
+ return
+}
+{{- end }}
\ No newline at end of file
diff --git a/server/resource/autocode_template/web/api.js.tpl b/server/resource/package/web/api/api.js.tpl
similarity index 83%
rename from server/resource/autocode_template/web/api.js.tpl
rename to server/resource/package/web/api/api.js.tpl
index 99f51c161..cf9d55305 100644
--- a/server/resource/autocode_template/web/api.js.tpl
+++ b/server/resource/package/web/api/api.js.tpl
@@ -24,11 +24,11 @@ export const create{{.StructName}} = (data) => {
// @Param data body model.{{.StructName}} true "删除{{.Description}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /{{.Abbreviation}}/delete{{.StructName}} [delete]
-export const delete{{.StructName}} = (data) => {
+export const delete{{.StructName}} = (params) => {
return service({
url: '/{{.Abbreviation}}/delete{{.StructName}}',
method: 'delete',
- data
+ params
})
}
@@ -40,11 +40,11 @@ export const delete{{.StructName}} = (data) => {
// @Param data body request.IdsReq true "批量删除{{.Description}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /{{.Abbreviation}}/delete{{.StructName}} [delete]
-export const delete{{.StructName}}ByIds = (data) => {
+export const delete{{.StructName}}ByIds = (params) => {
return service({
url: '/{{.Abbreviation}}/delete{{.StructName}}ByIds',
method: 'delete',
- data
+ params
})
}
@@ -95,3 +95,19 @@ export const get{{.StructName}}List = (params) => {
params
})
}
+
+{{- if .HasDataSource}}
+// @Tags {{.StructName}}
+// @Summary 获取数据源
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
+// @Router /{{.Abbreviation}}/find{{.StructName}}DataSource [get]
+export const get{{.StructName}}DataSource = () => {
+ return service({
+ url: '/{{.Abbreviation}}/get{{.StructName}}DataSource',
+ method: 'get',
+ })
+}
+{{- end}}
diff --git a/server/resource/autocode_template/web/form.vue.tpl b/server/resource/package/web/view/form.vue.tpl
similarity index 72%
rename from server/resource/autocode_template/web/form.vue.tpl
rename to server/resource/package/web/view/form.vue.tpl
index 0b99b5871..e61dd735a 100644
--- a/server/resource/autocode_template/web/form.vue.tpl
+++ b/server/resource/package/web/view/form.vue.tpl
@@ -4,24 +4,29 @@
无效的令牌
+错误码: 401 错误信息:${error}
+ `, '身份信息', { + dangerouslyUseHTMLString: true, + distinguishCancelAndClose: true, + confirmButtonText: '重新登录', + cancelButtonText: '取消' + }) + .then(() => { + const userStore = useUserStore() + userStore.ClearStorage() + router.push({ name: 'Login', replace: true }) + }) + break } return error diff --git a/web/src/view/about/index.vue b/web/src/view/about/index.vue index 5766e3984..97fc87ff7 100644 --- a/web/src/view/about/index.vue +++ b/web/src/view/about/index.vue @@ -1,5 +1,5 @@ -确定要删除并返回吗?
-请在对话框输入你需要AI帮你查询的内容:)
-
- {{ card.label }}
-
- {{ t('error.message1') }}
-{{ t('error.message2') }}
-↓
-
-
+ {{ t('error.message1') }}
+{{ t('error.message2') }}
+{{ t('error.projectAddress') }}https://github.com/flipped-aurora/gin-vue-admin
+{{ t('general.deleteConfirm') }}
-{{ t('init.note') }}
-{{ t('init.note1') }}
-{{ t('init.note2-1') }}{{ $GIN_VUE_ADMIN.appName }}
{{ t('init.note') }}
+{{ t('init.note1') }}
+{{ t('init.note2-1') }}{{ t('init.note2-3') }}
-{{ t('init.note3') }}
-{{ t('init.note4') }}innoDB
-{{ t('init.note5') }}
+{{ t('init.note3') }}
+{{ t('init.note4') }}innoDB
+{{ t('init.note5') }}
{{ t('general.deleteConfirm') }} {{ t('autoCode.confirmDelete') }} 操作栏:English
中文
العربية
+
-
-
+
English
中文
العربية