✨ Init
This commit is contained in:
commit
c4548fe498
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/server.iml" filepath="$PROJECT_DIR$/.idea/server.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
9
.idea/server.iml
Normal file
9
.idea/server.iml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="Go" enabled="true" />
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
FROM golang:alpine as builder
|
||||||
|
|
||||||
|
WORKDIR /go/src/miniapp
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go env -w GO111MODULE=on \
|
||||||
|
&& go env -w GOPROXY=https://goproxy.cn,direct \
|
||||||
|
&& go env -w CGO_ENABLED=0 \
|
||||||
|
&& go env \
|
||||||
|
&& go mod tidy \
|
||||||
|
&& go build -o server.exe.exe .
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"
|
||||||
|
|
||||||
|
WORKDIR /go/src/miniapp
|
||||||
|
|
||||||
|
COPY --from=0 /go/src/miniapp/server ./
|
||||||
|
COPY --from=0 /go/src/miniapp/resource ./resource/
|
||||||
|
COPY --from=0 /go/src/miniapp/config.docker.yaml ./
|
||||||
|
|
||||||
|
EXPOSE 8888
|
||||||
|
ENTRYPOINT ./server -c config.docker.yaml
|
54
README.md
Normal file
54
README.md
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
## server项目结构
|
||||||
|
|
||||||
|
```shell
|
||||||
|
├── api
|
||||||
|
│ └── v1
|
||||||
|
├── config
|
||||||
|
├── core
|
||||||
|
├── docs
|
||||||
|
├── global
|
||||||
|
├── initialize
|
||||||
|
│ └── internal
|
||||||
|
├── middleware
|
||||||
|
├── model
|
||||||
|
│ ├── request
|
||||||
|
│ └── response
|
||||||
|
├── packfile
|
||||||
|
├── resource
|
||||||
|
│ ├── excel
|
||||||
|
│ ├── page
|
||||||
|
│ └── template
|
||||||
|
├── router
|
||||||
|
├── service
|
||||||
|
├── source
|
||||||
|
└── utils
|
||||||
|
├── timer
|
||||||
|
└── upload
|
||||||
|
```
|
||||||
|
|
||||||
|
| 文件夹 | 说明 | 描述 |
|
||||||
|
| ------------ | ----------------------- | --------------------------- |
|
||||||
|
| `api` | api层 | api层 |
|
||||||
|
| `--v1` | v1版本接口 | v1版本接口 |
|
||||||
|
| `config` | 配置包 | config.yaml对应的配置结构体 |
|
||||||
|
| `core` | 核心文件 | 核心组件(zap, viper, server)的初始化 |
|
||||||
|
| `docs` | swagger文档目录 | swagger文档目录 |
|
||||||
|
| `global` | 全局对象 | 全局对象 |
|
||||||
|
| `initialize` | 初始化 | router,redis,gorm,validator, timer的初始化 |
|
||||||
|
| `--internal` | 初始化内部函数 | gorm 的 longger 自定义,在此文件夹的函数只能由 `initialize` 层进行调用 |
|
||||||
|
| `middleware` | 中间件层 | 用于存放 `gin` 中间件代码 |
|
||||||
|
| `model` | 模型层 | 模型对应数据表 |
|
||||||
|
| `--request` | 入参结构体 | 接收前端发送到后端的数据。 |
|
||||||
|
| `--response` | 出参结构体 | 返回给前端的数据结构体 |
|
||||||
|
| `packfile` | 静态文件打包 | 静态文件打包 |
|
||||||
|
| `resource` | 静态资源文件夹 | 负责存放静态文件 |
|
||||||
|
| `--excel` | excel导入导出默认路径 | excel导入导出默认路径 |
|
||||||
|
| `--page` | 表单生成器 | 表单生成器 打包后的dist |
|
||||||
|
| `--template` | 模板 | 模板文件夹,存放的是代码生成器的模板 |
|
||||||
|
| `router` | 路由层 | 路由层 |
|
||||||
|
| `service` | service层 | 存放业务逻辑问题 |
|
||||||
|
| `source` | source层 | 存放初始化数据的函数 |
|
||||||
|
| `utils` | 工具包 | 工具函数封装 |
|
||||||
|
| `--timer` | timer | 定时器接口封装 |
|
||||||
|
| `--upload` | oss | oss接口封装 |
|
||||||
|
|
43
api/base.go
Normal file
43
api/base.go
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.echol.cn/loser/logger/log"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/app"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetUser(ctx *gin.Context, u *app.User, dontResponse, dontCheck bool) {
|
||||||
|
userId := ctx.Request.Header.Get("userId")
|
||||||
|
if userId == "" {
|
||||||
|
if !dontResponse {
|
||||||
|
ctx.Abort()
|
||||||
|
response.FailWithMessage("未授权操作", ctx)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
id, _ := strconv.Atoi(userId)
|
||||||
|
u.ID = uint(id)
|
||||||
|
|
||||||
|
// 查询
|
||||||
|
err := global.GVA_DB.Take(&u).Error
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("获取用户信息失败:%s", err.Error())
|
||||||
|
ctx.Abort()
|
||||||
|
if !dontResponse {
|
||||||
|
response.FailWithMessage("用户状态异常", ctx)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 需要跳过微信绑定检验
|
||||||
|
if !dontCheck {
|
||||||
|
// 检查微信绑定
|
||||||
|
if u.WechatOpenId == nil || *u.WechatOpenId == "" {
|
||||||
|
log.Errorf("%v 未绑定微信", u.Nickname)
|
||||||
|
response.FailWithMessage("请先绑定微信", ctx)
|
||||||
|
ctx.Abort()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
api/v1/app/enter.go
Normal file
18
api/v1/app/enter.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package app
|
||||||
|
|
||||||
|
import "miniapp/service"
|
||||||
|
|
||||||
|
type ApiGroup struct {
|
||||||
|
UserApi
|
||||||
|
LoginApi
|
||||||
|
FavoriteApi
|
||||||
|
VisionApi
|
||||||
|
TodosApi
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
userService = service.ServiceGroupApp.AppServiceGroup.UserService
|
||||||
|
favoriteService = service.ServiceGroupApp.AppServiceGroup.FavoriteService
|
||||||
|
visionService = service.ServiceGroupApp.AppServiceGroup.VisionService
|
||||||
|
todosService = service.ServiceGroupApp.AppServiceGroup.TodesService
|
||||||
|
)
|
80
api/v1/app/favorite.go
Normal file
80
api/v1/app/favorite.go
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
package app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/app"
|
||||||
|
"miniapp/model/app/request"
|
||||||
|
r "miniapp/model/common/response"
|
||||||
|
)
|
||||||
|
|
||||||
|
type FavoriteApi struct{}
|
||||||
|
|
||||||
|
// GetList 获取收藏列表
|
||||||
|
func (f *FavoriteApi) GetList(ctx *gin.Context) {
|
||||||
|
var p request.GetFavoriteList
|
||||||
|
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("获取收藏列表失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取收藏列表
|
||||||
|
err, list, total := favoriteService.GetFavoriteList(p)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("获取收藏列表失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithData(r.PageResult{
|
||||||
|
List: list,
|
||||||
|
Total: total,
|
||||||
|
Page: p.Page,
|
||||||
|
PageSize: p.PageSize,
|
||||||
|
}, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create 创建收藏
|
||||||
|
func (f *FavoriteApi) Create(ctx *gin.Context) {
|
||||||
|
var p app.Favorite
|
||||||
|
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("创建收藏失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建收藏
|
||||||
|
err := favoriteService.CreateFavorite(&p)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("创建收藏失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.Ok(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete 删除收藏
|
||||||
|
func (f *FavoriteApi) Delete(ctx *gin.Context) {
|
||||||
|
var p app.Favorite
|
||||||
|
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("删除收藏失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除收藏
|
||||||
|
err := favoriteService.DeleteFavorite(&p)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("删除收藏失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.Ok(ctx)
|
||||||
|
}
|
120
api/v1/app/login.go
Normal file
120
api/v1/app/login.go
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
package app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"git.echol.cn/loser/logger/log"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/app/request"
|
||||||
|
"miniapp/model/common/constant"
|
||||||
|
r "miniapp/model/common/response"
|
||||||
|
"miniapp/oauth2"
|
||||||
|
"miniapp/service"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
type LoginApi struct{}
|
||||||
|
|
||||||
|
// Login 登录
|
||||||
|
func (l *LoginApi) Login(ctx *gin.Context) {
|
||||||
|
var p request.Login
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 获取用户基础账号信息
|
||||||
|
|
||||||
|
userId, err := oauth2.OAuthServer.UserAuthorizationHandler(ctx.Writer, ctx.Request)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("获取用户基础账号信息失败: %v", err)
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 重新组装登录参数
|
||||||
|
ctx.Request.Form = url.Values{
|
||||||
|
"username": {userId},
|
||||||
|
"password": {p.Password},
|
||||||
|
"scope": {"ALL"},
|
||||||
|
"grant_type": {"password"},
|
||||||
|
"nickName": {p.NickName},
|
||||||
|
"avatarUrl": {p.AvatarUrl},
|
||||||
|
}
|
||||||
|
|
||||||
|
// 参数解析成功,进行登录
|
||||||
|
if err = oauth2.OAuthServer.HandleTokenRequest(ctx.Writer, ctx.Request); err != nil {
|
||||||
|
log.Errorf("登录失败:%s", err.Error())
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 登录成功才更新登录时间
|
||||||
|
if ctx.Writer.Status() == http.StatusOK {
|
||||||
|
// 登录成功,更新登录时间和IP
|
||||||
|
uid, _ := strconv.Atoi(userId)
|
||||||
|
go service.ServiceGroupApp.AppServiceGroup.UserService.UpdateLastLoginInfo(uid)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Refresh 刷新登录Token
|
||||||
|
func (l *LoginApi) Refresh(ctx *gin.Context) {
|
||||||
|
var p request.RefreshToken
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage("参数错误: "+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 刷新Token
|
||||||
|
if err := oauth2.OAuthServer.HandleTokenRequest(ctx.Writer, ctx.Request); err != nil {
|
||||||
|
log.Errorf("Token数据返回失败: %v", err.Error())
|
||||||
|
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Logout 退出登录
|
||||||
|
func (l *LoginApi) Logout(ctx *gin.Context) {
|
||||||
|
log.Debug("退出登录啦")
|
||||||
|
// Token字符串前缀
|
||||||
|
const bearerSchema string = "Bearer "
|
||||||
|
// 取出Token
|
||||||
|
tokenHeader := ctx.Request.Header.Get("Authorization")
|
||||||
|
tokenStr := tokenHeader[len(bearerSchema):]
|
||||||
|
// 取出原始RedisKey
|
||||||
|
baseDataId, err := global.GVA_REDIS.Get(context.Background(), constant.OAuth2RedisKey+tokenStr).Result()
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage("Token信息获取失败", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
baseDataStr, err := global.GVA_REDIS.Get(context.Background(), constant.OAuth2RedisKey+baseDataId).Result()
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage("Token信息获取失败", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 转换数据为Map
|
||||||
|
tokenData := make(map[string]any)
|
||||||
|
if err = json.Unmarshal([]byte(baseDataStr), &tokenData); err != nil {
|
||||||
|
r.FailWithMessage("系统错误: "+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 删除Redis缓存的数据
|
||||||
|
global.GVA_REDIS.Del(context.Background(), constant.OAuth2RedisKey+baseDataId)
|
||||||
|
global.GVA_REDIS.Del(context.Background(), fmt.Sprintf("%v%v", constant.OAuth2RedisKey, tokenData["Access"]))
|
||||||
|
global.GVA_REDIS.Del(context.Background(), fmt.Sprintf("%v%v", constant.OAuth2RedisKey, tokenData["Refresh"]))
|
||||||
|
|
||||||
|
r.Ok(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *LoginApi) GetWeChatToken(c *gin.Context) {
|
||||||
|
wechaetToken, err := http.Get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx3d38ce1103a82225&secret=3c41ca428b4d0f43cfaef6f567a1cc06")
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("获取微信Token失败: %v", err)
|
||||||
|
r.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithData(wechaetToken, c)
|
||||||
|
}
|
49
api/v1/app/todos.go
Normal file
49
api/v1/app/todos.go
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/api"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/app"
|
||||||
|
"miniapp/model/common"
|
||||||
|
r "miniapp/model/common/response"
|
||||||
|
)
|
||||||
|
|
||||||
|
type TodosApi struct{}
|
||||||
|
|
||||||
|
func (t TodosApi) GetUserTodos(ctx *gin.Context) {
|
||||||
|
|
||||||
|
var ue app.User
|
||||||
|
if api.GetUser(ctx, &ue, false, true); ctx.IsAborted() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
list, err := todosService.GetUserTodos(ue.ID)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage("获取Todo列表失败:"+err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("获取Todo列表失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithData(list, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateTodo 更新Todo
|
||||||
|
func (t TodosApi) UpdateTodo(ctx *gin.Context) {
|
||||||
|
var todo common.UserTodo
|
||||||
|
if err := ctx.ShouldBind(&todo); err != nil {
|
||||||
|
r.FailWithMessage("参数错误:"+err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("参数错误", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
err := todosService.UpdateTodoById(&todo)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("更新失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.Ok(ctx)
|
||||||
|
}
|
134
api/v1/app/user.go
Normal file
134
api/v1/app/user.go
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
package app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.echol.cn/loser/logger/log"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"miniapp/api"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/app"
|
||||||
|
"miniapp/model/app/request"
|
||||||
|
"miniapp/model/app/response"
|
||||||
|
r "miniapp/model/common/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserApi struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUser 获取当前登录用户信息
|
||||||
|
func (u *UserApi) GetUser(ctx *gin.Context) {
|
||||||
|
// 取出当前登录用户
|
||||||
|
var ue app.User
|
||||||
|
if api.GetUser(ctx, &ue, false, true); ctx.IsAborted() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 转换为VO
|
||||||
|
var v response.UserVO
|
||||||
|
v.ParseOrdinary(ue)
|
||||||
|
|
||||||
|
r.OkWithData(v, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// BindingWeChat 绑定微信
|
||||||
|
func (u *UserApi) BindingWeChat(ctx *gin.Context) {
|
||||||
|
var p request.BindingWeChat
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取出当前登录用户
|
||||||
|
var loginUser app.User
|
||||||
|
if api.GetUser(ctx, &loginUser, true, true); ctx.IsAborted() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析出UnionId和OpenId
|
||||||
|
unionId, openId, _, err := utils.WeChatUtils().GetWechatUnionId(p.Code)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("获取微信UnionId失败:%s", err.Error())
|
||||||
|
r.FailWithMessage("系统错误,请稍后再试", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析成功,修改用户信息
|
||||||
|
loginUser.WechatUnionId = &unionId
|
||||||
|
loginUser.WechatOpenId = &openId
|
||||||
|
if err = userService.UpdateUserInfo(&loginUser); err != nil {
|
||||||
|
log.Errorf("修改用户信息失败:%s", err.Error())
|
||||||
|
r.FailWithMessage("系统错误,请稍后再试", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.Ok(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateUser 修改用户信息
|
||||||
|
func (u *UserApi) UpdateUser(ctx *gin.Context) {
|
||||||
|
var p request.ChangeUserInfo
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage("参数错误: "+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 获取当前登录用户
|
||||||
|
var loginUser app.User
|
||||||
|
if api.GetUser(ctx, &loginUser, false, true); ctx.IsAborted() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 修改资料
|
||||||
|
|
||||||
|
if p.Nickname != "" {
|
||||||
|
loginUser.Nickname = p.Nickname
|
||||||
|
}
|
||||||
|
if p.Avatar != "" && strings.HasPrefix(p.Avatar, "http") {
|
||||||
|
loginUser.Avatar = p.Avatar
|
||||||
|
}
|
||||||
|
if p.Phone != "" {
|
||||||
|
loginUser.Phone = p.Phone
|
||||||
|
}
|
||||||
|
// 修改数据
|
||||||
|
if err := userService.UpdateUserInfo(&loginUser); err != nil {
|
||||||
|
log.Errorf("修改用户信息失败:%s", err.Error())
|
||||||
|
r.FailWithMessage("修改用户信息失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 操作成功,更新头像和昵称
|
||||||
|
r.Ok(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateUserHospital 修改用户医院信息
|
||||||
|
func (u *UserApi) UpdateUserHospital(ctx *gin.Context) {
|
||||||
|
var p request.ChangeUserHospital
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage("参数错误: "+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改数据
|
||||||
|
if err := userService.UpdateUserHospital(&p); err != nil {
|
||||||
|
log.Errorf("修改用户信息失败:%s", err.Error())
|
||||||
|
r.FailWithMessage("修改用户信息失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 操作成功,更新头像和昵称
|
||||||
|
r.Ok(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetInfo 获取用户信息
|
||||||
|
func (u *UserApi) GetInfo(ctx *gin.Context) {
|
||||||
|
id := ctx.Param("id")
|
||||||
|
if id == "" {
|
||||||
|
global.GVA_LOG.Error("参数错误")
|
||||||
|
r.FailWithMessage("参数错误", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
userInfo, err := userService.GetUserInfo(id)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorf("获取用户信息失败:%s", err.Error())
|
||||||
|
r.FailWithMessage("获取用户信息失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.OkWithData(userInfo, ctx)
|
||||||
|
}
|
56
api/v1/app/vision.go
Normal file
56
api/v1/app/vision.go
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/app"
|
||||||
|
"miniapp/model/app/request"
|
||||||
|
r "miniapp/model/common/response"
|
||||||
|
)
|
||||||
|
|
||||||
|
type VisionApi struct{}
|
||||||
|
|
||||||
|
func (VisionApi) GetList(ctx *gin.Context) {
|
||||||
|
var p request.VisionListRequest
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage("参数错误:"+err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("参数错误", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取列表
|
||||||
|
list, total, err := visionService.GetVisionList(p)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("获取列表失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithData(r.PageResult{
|
||||||
|
List: list,
|
||||||
|
Total: total,
|
||||||
|
Page: p.Page,
|
||||||
|
PageSize: p.PageSize,
|
||||||
|
}, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (VisionApi) Create(ctx *gin.Context) {
|
||||||
|
var p app.Vision
|
||||||
|
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("参数错误", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
err := visionService.CreateVision(&p)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage(err.Error(), ctx)
|
||||||
|
global.GVA_LOG.Error("创建失败", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.Ok(ctx)
|
||||||
|
}
|
15
api/v1/enter.go
Normal file
15
api/v1/enter.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"miniapp/api/v1/app"
|
||||||
|
"miniapp/api/v1/example"
|
||||||
|
"miniapp/api/v1/system"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ApiGroup struct {
|
||||||
|
SystemApiGroup system.ApiGroup
|
||||||
|
ExampleApiGroup example.ApiGroup
|
||||||
|
AppApiGroup app.ApiGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
var ApiGroupApp = new(ApiGroup)
|
13
api/v1/example/enter.go
Normal file
13
api/v1/example/enter.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import "miniapp/service"
|
||||||
|
|
||||||
|
type ApiGroup struct {
|
||||||
|
CustomerApi
|
||||||
|
FileUploadAndDownloadApi
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
customerService = service.ServiceGroupApp.ExampleServiceGroup.CustomerService
|
||||||
|
fileUploadAndDownloadService = service.ServiceGroupApp.ExampleServiceGroup.FileUploadAndDownloadService
|
||||||
|
)
|
150
api/v1/example/exa_breakpoint_continue.go
Normal file
150
api/v1/example/exa_breakpoint_continue.go
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"mime/multipart"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"miniapp/model/example"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
exampleRes "miniapp/model/example/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BreakpointContinue
|
||||||
|
// @Tags ExaFileUploadAndDownload
|
||||||
|
// @Summary 断点续传到服务器
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept multipart/form-data
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param file formData file true "an example for breakpoint resume, 断点续传示例"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "断点续传到服务器"
|
||||||
|
// @Router /fileUploadAndDownload/breakpointContinue [post]
|
||||||
|
func (b *FileUploadAndDownloadApi) BreakpointContinue(c *gin.Context) {
|
||||||
|
fileMd5 := c.Request.FormValue("fileMd5")
|
||||||
|
fileName := c.Request.FormValue("fileName")
|
||||||
|
chunkMd5 := c.Request.FormValue("chunkMd5")
|
||||||
|
chunkNumber, _ := strconv.Atoi(c.Request.FormValue("chunkNumber"))
|
||||||
|
chunkTotal, _ := strconv.Atoi(c.Request.FormValue("chunkTotal"))
|
||||||
|
_, FileHeader, err := c.Request.FormFile("file")
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("接收文件失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("接收文件失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
f, err := FileHeader.Open()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("文件读取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("文件读取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer func(f multipart.File) {
|
||||||
|
err := f.Close()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
}(f)
|
||||||
|
cen, _ := io.ReadAll(f)
|
||||||
|
if !utils.CheckMd5(cen, chunkMd5) {
|
||||||
|
global.GVA_LOG.Error("检查md5失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("检查md5失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file, err := fileUploadAndDownloadService.FindOrCreateFile(fileMd5, fileName, chunkTotal)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("查找或创建记录失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("查找或创建记录失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pathC, err := utils.BreakPointContinue(cen, fileName, chunkNumber, chunkTotal, fileMd5)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("断点续传失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("断点续传失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = fileUploadAndDownloadService.CreateFileChunk(file.ID, pathC, chunkNumber); err != nil {
|
||||||
|
global.GVA_LOG.Error("创建文件记录失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("创建文件记录失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("切片创建成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindFile
|
||||||
|
// @Tags ExaFileUploadAndDownload
|
||||||
|
// @Summary 查找文件
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept multipart/form-data
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param file formData file true "Find the file, 查找文件"
|
||||||
|
// @Success 200 {object} response.Response{data=exampleRes.FileResponse,msg=string} "查找文件,返回包括文件详情"
|
||||||
|
// @Router /fileUploadAndDownload/findFile [post]
|
||||||
|
func (b *FileUploadAndDownloadApi) FindFile(c *gin.Context) {
|
||||||
|
fileMd5 := c.Query("fileMd5")
|
||||||
|
fileName := c.Query("fileName")
|
||||||
|
chunkTotal, _ := strconv.Atoi(c.Query("chunkTotal"))
|
||||||
|
file, err := fileUploadAndDownloadService.FindOrCreateFile(fileMd5, fileName, chunkTotal)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("查找失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("查找失败", c)
|
||||||
|
} else {
|
||||||
|
response.OkWithDetailed(exampleRes.FileResponse{File: file}, "查找成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// BreakpointContinueFinish
|
||||||
|
// @Tags ExaFileUploadAndDownload
|
||||||
|
// @Summary 创建文件
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept multipart/form-data
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param file formData file true "上传文件完成"
|
||||||
|
// @Success 200 {object} response.Response{data=exampleRes.FilePathResponse,msg=string} "创建文件,返回包括文件路径"
|
||||||
|
// @Router /fileUploadAndDownload/findFile [post]
|
||||||
|
func (b *FileUploadAndDownloadApi) BreakpointContinueFinish(c *gin.Context) {
|
||||||
|
fileMd5 := c.Query("fileMd5")
|
||||||
|
fileName := c.Query("fileName")
|
||||||
|
filePath, err := utils.MakeFile(fileName, fileMd5)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("文件创建失败!", zap.Error(err))
|
||||||
|
response.FailWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "文件创建失败", c)
|
||||||
|
} else {
|
||||||
|
response.OkWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "文件创建成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveChunk
|
||||||
|
// @Tags ExaFileUploadAndDownload
|
||||||
|
// @Summary 删除切片
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept multipart/form-data
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param file formData file true "删除缓存切片"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除切片"
|
||||||
|
// @Router /fileUploadAndDownload/removeChunk [post]
|
||||||
|
func (b *FileUploadAndDownloadApi) RemoveChunk(c *gin.Context) {
|
||||||
|
var file example.ExaFile
|
||||||
|
err := c.ShouldBindJSON(&file)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.RemoveChunk(file.FileMd5)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("缓存切片删除失败!", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = fileUploadAndDownloadService.DeleteFileChunk(file.FileMd5, file.FilePath)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error(err.Error(), zap.Error(err))
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("缓存切片删除成功", c)
|
||||||
|
}
|
176
api/v1/example/exa_customer.go
Normal file
176
api/v1/example/exa_customer.go
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/example"
|
||||||
|
exampleRes "miniapp/model/example/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CustomerApi struct{}
|
||||||
|
|
||||||
|
// CreateExaCustomer
|
||||||
|
// @Tags ExaCustomer
|
||||||
|
// @Summary 创建客户
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body example.ExaCustomer true "客户用户名, 客户手机号码"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "创建客户"
|
||||||
|
// @Router /customer/customer [post]
|
||||||
|
func (e *CustomerApi) CreateExaCustomer(c *gin.Context) {
|
||||||
|
var customer example.ExaCustomer
|
||||||
|
err := c.ShouldBindJSON(&customer)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(customer, utils.CustomerVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
customer.SysUserID = utils.GetUserID(c)
|
||||||
|
customer.SysUserAuthorityID = utils.GetUserAuthorityId(c)
|
||||||
|
err = customerService.CreateExaCustomer(customer)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("创建失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("创建失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("创建成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteExaCustomer
|
||||||
|
// @Tags ExaCustomer
|
||||||
|
// @Summary 删除客户
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body example.ExaCustomer true "客户ID"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除客户"
|
||||||
|
// @Router /customer/customer [delete]
|
||||||
|
func (e *CustomerApi) DeleteExaCustomer(c *gin.Context) {
|
||||||
|
var customer example.ExaCustomer
|
||||||
|
err := c.ShouldBindJSON(&customer)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(customer.GVA_MODEL, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = customerService.DeleteExaCustomer(customer)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateExaCustomer
|
||||||
|
// @Tags ExaCustomer
|
||||||
|
// @Summary 更新客户信息
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body example.ExaCustomer true "客户ID, 客户信息"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "更新客户信息"
|
||||||
|
// @Router /customer/customer [put]
|
||||||
|
func (e *CustomerApi) UpdateExaCustomer(c *gin.Context) {
|
||||||
|
var customer example.ExaCustomer
|
||||||
|
err := c.ShouldBindJSON(&customer)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(customer.GVA_MODEL, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(customer, utils.CustomerVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = customerService.UpdateExaCustomer(&customer)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("更新失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("更新失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("更新成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetExaCustomer
|
||||||
|
// @Tags ExaCustomer
|
||||||
|
// @Summary 获取单一客户信息
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data query example.ExaCustomer true "客户ID"
|
||||||
|
// @Success 200 {object} response.Response{data=exampleRes.ExaCustomerResponse,msg=string} "获取单一客户信息,返回包括客户详情"
|
||||||
|
// @Router /customer/customer [get]
|
||||||
|
func (e *CustomerApi) GetExaCustomer(c *gin.Context) {
|
||||||
|
var customer example.ExaCustomer
|
||||||
|
err := c.ShouldBindQuery(&customer)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(customer.GVA_MODEL, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data, err := customerService.GetExaCustomer(customer.ID)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(exampleRes.ExaCustomerResponse{Customer: data}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetExaCustomerList
|
||||||
|
// @Tags ExaCustomer
|
||||||
|
// @Summary 分页获取权限客户列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data query request.PageInfo true "页码, 每页大小"
|
||||||
|
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取权限客户列表,返回包括列表,总数,页码,每页数量"
|
||||||
|
// @Router /customer/customerList [get]
|
||||||
|
func (e *CustomerApi) GetExaCustomerList(c *gin.Context) {
|
||||||
|
var pageInfo request.PageInfo
|
||||||
|
err := c.ShouldBindQuery(&pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(pageInfo, utils.PageInfoVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
customerList, total, err := customerService.GetCustomerInfoList(utils.GetUserAuthorityId(c), pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败"+err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(response.PageResult{
|
||||||
|
List: customerList,
|
||||||
|
Total: total,
|
||||||
|
Page: pageInfo.Page,
|
||||||
|
PageSize: pageInfo.PageSize,
|
||||||
|
}, "获取成功", c)
|
||||||
|
}
|
110
api/v1/example/exa_file_upload_download.go
Normal file
110
api/v1/example/exa_file_upload_download.go
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/example"
|
||||||
|
exampleRes "miniapp/model/example/response"
|
||||||
|
)
|
||||||
|
|
||||||
|
type FileUploadAndDownloadApi struct{}
|
||||||
|
|
||||||
|
// UploadFile
|
||||||
|
// @Tags ExaFileUploadAndDownload
|
||||||
|
// @Summary 上传文件示例
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept multipart/form-data
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param file formData file true "上传文件示例"
|
||||||
|
// @Success 200 {object} response.Response{data=exampleRes.ExaFileResponse,msg=string} "上传文件示例,返回包括文件详情"
|
||||||
|
// @Router /fileUploadAndDownload/upload [post]
|
||||||
|
func (b *FileUploadAndDownloadApi) UploadFile(c *gin.Context) {
|
||||||
|
var file example.ExaFileUploadAndDownload
|
||||||
|
noSave := c.DefaultQuery("noSave", "0")
|
||||||
|
_, header, err := c.Request.FormFile("file")
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("接收文件失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("接收文件失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file, err = fileUploadAndDownloadService.UploadFile(header, noSave) // 文件上传后拿到文件路径
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("修改数据库链接失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("修改数据库链接失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(exampleRes.ExaFileResponse{File: file}, "上传成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// EditFileName 编辑文件名或者备注
|
||||||
|
func (b *FileUploadAndDownloadApi) EditFileName(c *gin.Context) {
|
||||||
|
var file example.ExaFileUploadAndDownload
|
||||||
|
err := c.ShouldBindJSON(&file)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = fileUploadAndDownloadService.EditFileName(file)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("编辑失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("编辑失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("编辑成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteFile
|
||||||
|
// @Tags ExaFileUploadAndDownload
|
||||||
|
// @Summary 删除文件
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body example.ExaFileUploadAndDownload true "传入文件里面id即可"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除文件"
|
||||||
|
// @Router /fileUploadAndDownload/deleteFile [post]
|
||||||
|
func (b *FileUploadAndDownloadApi) DeleteFile(c *gin.Context) {
|
||||||
|
var file example.ExaFileUploadAndDownload
|
||||||
|
err := c.ShouldBindJSON(&file)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := fileUploadAndDownloadService.DeleteFile(file); err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFileList
|
||||||
|
// @Tags ExaFileUploadAndDownload
|
||||||
|
// @Summary 分页文件列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.PageInfo true "页码, 每页大小"
|
||||||
|
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页文件列表,返回包括列表,总数,页码,每页数量"
|
||||||
|
// @Router /fileUploadAndDownload/getFileList [post]
|
||||||
|
func (b *FileUploadAndDownloadApi) GetFileList(c *gin.Context) {
|
||||||
|
var pageInfo request.PageInfo
|
||||||
|
err := c.ShouldBindJSON(&pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
list, total, err := fileUploadAndDownloadService.GetFileRecordInfoList(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)
|
||||||
|
}
|
106
api/v1/system/article.go
Normal file
106
api/v1/system/article.go
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
r "miniapp/model/common/response"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ArticleApi struct{}
|
||||||
|
|
||||||
|
// GetArticleList 获取文章列表
|
||||||
|
func (a ArticleApi) GetArticleList(ctx *gin.Context) {
|
||||||
|
var p request.PageInfo
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数错误" + err.Error())
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
list, total, err := articleService.GetArticleList(p)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取文章列表失败" + err.Error())
|
||||||
|
r.FailWithMessage("获取文章列表失败", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithDetailed(r.PageResult{List: list, Total: total, Page: p.Page, PageSize: p.PageSize}, "获取成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateArticle 创建文章
|
||||||
|
func (a ArticleApi) CreateArticle(ctx *gin.Context) {
|
||||||
|
var article common.Article
|
||||||
|
if err := ctx.ShouldBindJSON(&article); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数错误" + err.Error())
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := articleService.CreateArticle(&article)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("创建失败" + err.Error())
|
||||||
|
r.FailWithMessage("创建失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("创建成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateArticle 更新文章
|
||||||
|
func (a ArticleApi) UpdateArticle(ctx *gin.Context) {
|
||||||
|
var article common.Article
|
||||||
|
if err := ctx.ShouldBindJSON(&article); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数错误" + err.Error())
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := articleService.UpdateArticle(&article)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("更新失败" + err.Error())
|
||||||
|
r.FailWithMessage("更新失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("更新成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteArticle 删除文章
|
||||||
|
func (a ArticleApi) DeleteArticle(ctx *gin.Context) {
|
||||||
|
var article common.Article
|
||||||
|
if err := ctx.ShouldBind(&article); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数错误" + err.Error())
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := articleService.DeleteArticle(&article)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败" + err.Error())
|
||||||
|
r.FailWithMessage("删除失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("删除成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetArticleById 根据id获取文章
|
||||||
|
func (a ArticleApi) GetArticleById(ctx *gin.Context) {
|
||||||
|
Id := ctx.Param("id")
|
||||||
|
if Id == "" {
|
||||||
|
global.GVA_LOG.Error("参数错误")
|
||||||
|
r.FailWithMessage("参数错误", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
article, err := articleService.GetArticleById(Id)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败" + err.Error())
|
||||||
|
r.FailWithMessage("获取失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithDetailed(article, "获取成功", ctx)
|
||||||
|
}
|
108
api/v1/system/banner.go
Normal file
108
api/v1/system/banner.go
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
r "miniapp/model/common/response"
|
||||||
|
)
|
||||||
|
|
||||||
|
type BannerApi struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBannerList 获取轮播图列表
|
||||||
|
func (b *BannerApi) GetBannerList(ctx *gin.Context) {
|
||||||
|
var p request.PageInfo
|
||||||
|
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数错误" + err.Error())
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
list, total, err := bannerService.GetBannerList(p)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取轮播图列表失败" + err.Error())
|
||||||
|
r.FailWithMessage("获取轮播图列表失败", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithDetailed(r.PageResult{List: list, Total: total, Page: p.Page, PageSize: p.PageSize}, "获取成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateBanner 创建轮播图
|
||||||
|
func (b *BannerApi) CreateBanner(ctx *gin.Context) {
|
||||||
|
var banner common.Banner
|
||||||
|
if err := ctx.ShouldBindJSON(&banner); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数错误" + err.Error())
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := bannerService.CreateBanner(&banner)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("创建失败" + err.Error())
|
||||||
|
r.FailWithMessage("创建失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("创建成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateBanner 更新轮播图
|
||||||
|
func (b *BannerApi) UpdateBanner(ctx *gin.Context) {
|
||||||
|
var banner common.Banner
|
||||||
|
if err := ctx.ShouldBindJSON(&banner); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数错误" + err.Error())
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := bannerService.UpdateBanner(&banner)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("更新失败" + err.Error())
|
||||||
|
r.FailWithMessage("更新失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("更新成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteBanner 删除轮播图
|
||||||
|
func (b *BannerApi) DeleteBanner(ctx *gin.Context) {
|
||||||
|
var banner common.Banner
|
||||||
|
if err := ctx.ShouldBind(&banner); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数错误" + err.Error())
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := bannerService.DeleteBanner(&banner)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败" + err.Error())
|
||||||
|
r.FailWithMessage("删除失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("删除成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBannerById 根据id获取轮播图
|
||||||
|
func (b *BannerApi) GetBannerById(ctx *gin.Context) {
|
||||||
|
Id := ctx.Param("id")
|
||||||
|
if Id == "" {
|
||||||
|
global.GVA_LOG.Error("参数错误")
|
||||||
|
r.FailWithMessage("参数错误", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
banner, err := bannerService.GetBannerById(Id)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败" + err.Error())
|
||||||
|
r.FailWithMessage("获取失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithDetailed(banner, "获取成功", ctx)
|
||||||
|
}
|
46
api/v1/system/enter.go
Normal file
46
api/v1/system/enter.go
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import "miniapp/service"
|
||||||
|
|
||||||
|
type ApiGroup struct {
|
||||||
|
DBApi
|
||||||
|
JwtApi
|
||||||
|
BaseApi
|
||||||
|
SystemApi
|
||||||
|
CasbinApi
|
||||||
|
AutoCodeApi
|
||||||
|
SystemApiApi
|
||||||
|
AuthorityApi
|
||||||
|
DictionaryApi
|
||||||
|
AuthorityMenuApi
|
||||||
|
OperationRecordApi
|
||||||
|
AutoCodeHistoryApi
|
||||||
|
DictionaryDetailApi
|
||||||
|
AuthorityBtnApi
|
||||||
|
ChatGptApi
|
||||||
|
BannerApi
|
||||||
|
HospitalApi
|
||||||
|
ArticleApi
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
apiService = service.ServiceGroupApp.SystemServiceGroup.ApiService
|
||||||
|
jwtService = service.ServiceGroupApp.SystemServiceGroup.JwtService
|
||||||
|
menuService = service.ServiceGroupApp.SystemServiceGroup.MenuService
|
||||||
|
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
|
||||||
|
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
|
||||||
|
hospitalService = service.ServiceGroupApp.SystemServiceGroup.HospitalService
|
||||||
|
bannerService = service.ServiceGroupApp.SystemServiceGroup.BannerService
|
||||||
|
articleService = service.ServiceGroupApp.SystemServiceGroup.ArticleService
|
||||||
|
)
|
100
api/v1/system/hospital.go
Normal file
100
api/v1/system/hospital.go
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"miniapp/model/common"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
r "miniapp/model/common/response"
|
||||||
|
systemService "miniapp/service/system"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
type HospitalApi struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetHospitalList 获取医院列表
|
||||||
|
func (h HospitalApi) GetHospitalList(ctx *gin.Context) {
|
||||||
|
var p request.PageInfo
|
||||||
|
if err := ctx.ShouldBind(&p); err != nil {
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
list, total, err := systemService.HospitalService{}.GetHospitalList(p)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage("获取医院列表失败", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithDetailed(r.PageResult{List: list, Total: total, Page: p.Page, PageSize: p.PageSize}, "获取成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateHospital 创建医院
|
||||||
|
func (h HospitalApi) CreateHospital(ctx *gin.Context) {
|
||||||
|
var hospital common.Hospital
|
||||||
|
if err := ctx.ShouldBindJSON(&hospital); err != nil {
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := systemService.HospitalService{}.CreateHospital(&hospital)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage("创建失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("创建成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateHospital 更新医院
|
||||||
|
func (h HospitalApi) UpdateHospital(ctx *gin.Context) {
|
||||||
|
var hospital common.Hospital
|
||||||
|
if err := ctx.ShouldBindJSON(&hospital); err != nil {
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := systemService.HospitalService{}.UpdateHospital(&hospital)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage("更新失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("更新成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteHospital 删除医院
|
||||||
|
func (h HospitalApi) DeleteHospital(ctx *gin.Context) {
|
||||||
|
var hospital common.Hospital
|
||||||
|
if err := ctx.ShouldBind(&hospital); err != nil {
|
||||||
|
r.FailWithMessage("参数错误"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := hospitalService.DeleteHospital(&hospital)
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage("删除失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithMessage("删除成功", ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetHospitalById 根据id获取医院
|
||||||
|
func (h HospitalApi) GetHospitalById(ctx *gin.Context) {
|
||||||
|
Id := ctx.Param("id")
|
||||||
|
if Id == "" {
|
||||||
|
r.FailWithMessage("参数错误", ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 参数转换 string -> int
|
||||||
|
id, _ := strconv.Atoi(Id)
|
||||||
|
hospitalResult, err := systemService.HospitalService{}.GetHospitalById(uint(id))
|
||||||
|
if err != nil {
|
||||||
|
r.FailWithMessage("获取失败"+err.Error(), ctx)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.OkWithDetailed(hospitalResult, "获取成功", ctx)
|
||||||
|
}
|
231
api/v1/system/sys_api.go
Normal file
231
api/v1/system/sys_api.go
Normal file
@ -0,0 +1,231 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
systemReq "miniapp/model/system/request"
|
||||||
|
systemRes "miniapp/model/system/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SystemApiApi struct{}
|
||||||
|
|
||||||
|
// CreateApi
|
||||||
|
// @Tags SysApi
|
||||||
|
// @Summary 创建基础api
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysApi true "api路径, api中文描述, api组, 方法"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "创建基础api"
|
||||||
|
// @Router /api/createApi [post]
|
||||||
|
func (s *SystemApiApi) CreateApi(c *gin.Context) {
|
||||||
|
var api system.SysApi
|
||||||
|
err := c.ShouldBindJSON(&api)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(api, utils.ApiVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = apiService.CreateApi(api)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("创建失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("创建失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("创建成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteApi
|
||||||
|
// @Tags SysApi
|
||||||
|
// @Summary 删除api
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysApi true "ID"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除api"
|
||||||
|
// @Router /api/deleteApi [post]
|
||||||
|
func (s *SystemApiApi) DeleteApi(c *gin.Context) {
|
||||||
|
var api system.SysApi
|
||||||
|
err := c.ShouldBindJSON(&api)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(api.GVA_MODEL, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = apiService.DeleteApi(api)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetApiList
|
||||||
|
// @Tags SysApi
|
||||||
|
// @Summary 分页获取API列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.SearchApiParams true "分页获取API列表"
|
||||||
|
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取API列表,返回包括列表,总数,页码,每页数量"
|
||||||
|
// @Router /api/getApiList [post]
|
||||||
|
func (s *SystemApiApi) GetApiList(c *gin.Context) {
|
||||||
|
var pageInfo systemReq.SearchApiParams
|
||||||
|
err := c.ShouldBindJSON(&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 := apiService.GetAPIInfoList(pageInfo.SysApi, pageInfo.PageInfo, pageInfo.OrderKey, pageInfo.Desc)
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetApiById
|
||||||
|
// @Tags SysApi
|
||||||
|
// @Summary 根据id获取api
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.GetById true "根据id获取api"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysAPIResponse} "根据id获取api,返回包括api详情"
|
||||||
|
// @Router /api/getApiById [post]
|
||||||
|
func (s *SystemApiApi) GetApiById(c *gin.Context) {
|
||||||
|
var idInfo request.GetById
|
||||||
|
err := c.ShouldBindJSON(&idInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(idInfo, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
api, err := apiService.GetApiById(idInfo.ID)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysAPIResponse{Api: api}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateApi
|
||||||
|
// @Tags SysApi
|
||||||
|
// @Summary 修改基础api
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysApi true "api路径, api中文描述, api组, 方法"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "修改基础api"
|
||||||
|
// @Router /api/updateApi [post]
|
||||||
|
func (s *SystemApiApi) UpdateApi(c *gin.Context) {
|
||||||
|
var api system.SysApi
|
||||||
|
err := c.ShouldBindJSON(&api)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(api, utils.ApiVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = apiService.UpdateApi(api)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("修改失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("修改失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("修改成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetAllApis
|
||||||
|
// @Tags SysApi
|
||||||
|
// @Summary 获取所有的Api 不分页
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysAPIListResponse,msg=string} "获取所有的Api 不分页,返回包括api列表"
|
||||||
|
// @Router /api/getAllApis [post]
|
||||||
|
func (s *SystemApiApi) GetAllApis(c *gin.Context) {
|
||||||
|
apis, err := apiService.GetAllApis()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysAPIListResponse{Apis: apis}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteApisByIds
|
||||||
|
// @Tags SysApi
|
||||||
|
// @Summary 删除选中Api
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.IdsReq true "ID"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除选中Api"
|
||||||
|
// @Router /api/deleteApisByIds [delete]
|
||||||
|
func (s *SystemApiApi) DeleteApisByIds(c *gin.Context) {
|
||||||
|
var ids request.IdsReq
|
||||||
|
err := c.ShouldBindJSON(&ids)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = apiService.DeleteApisByIds(ids)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FreshCasbin
|
||||||
|
// @Tags SysApi
|
||||||
|
// @Summary 刷新casbin缓存
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "刷新成功"
|
||||||
|
// @Router /api/freshCasbin [get]
|
||||||
|
func (s *SystemApiApi) FreshCasbin(c *gin.Context) {
|
||||||
|
err := apiService.FreshCasbin()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("刷新失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("刷新失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("刷新成功", c)
|
||||||
|
}
|
208
api/v1/system/sys_authority.go
Normal file
208
api/v1/system/sys_authority.go
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
systemReq "miniapp/model/system/request"
|
||||||
|
systemRes "miniapp/model/system/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
|
type AuthorityApi struct{}
|
||||||
|
|
||||||
|
// CreateAuthority
|
||||||
|
// @Tags Authority
|
||||||
|
// @Summary 创建角色
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysAuthority true "权限id, 权限名, 父角色id"
|
||||||
|
// @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 {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = utils.Verify(authority, utils.AuthorityVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if authBack, err := authorityService.CreateAuthority(authority); err != nil {
|
||||||
|
global.GVA_LOG.Error("创建失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("创建失败"+err.Error(), c)
|
||||||
|
} else {
|
||||||
|
_ = menuService.AddMenuAuthority(systemReq.DefaultMenu(), authority.AuthorityId)
|
||||||
|
_ = casbinService.UpdateCasbin(authority.AuthorityId, systemReq.DefaultCasbin())
|
||||||
|
response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authBack}, "创建成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CopyAuthority
|
||||||
|
// @Tags Authority
|
||||||
|
// @Summary 拷贝角色
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body response.SysAuthorityCopyResponse true "旧角色id, 新权限id, 新权限名, 新父角色id"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysAuthorityResponse,msg=string} "拷贝角色,返回包括系统角色详情"
|
||||||
|
// @Router /authority/copyAuthority [post]
|
||||||
|
func (a *AuthorityApi) CopyAuthority(c *gin.Context) {
|
||||||
|
var copyInfo systemRes.SysAuthorityCopyResponse
|
||||||
|
err := c.ShouldBindJSON(©Info)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(copyInfo, utils.OldAuthorityVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(copyInfo.Authority, utils.AuthorityVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
authBack, err := authorityService.CopyAuthority(copyInfo)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("拷贝失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("拷贝失败"+err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authBack}, "拷贝成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteAuthority
|
||||||
|
// @Tags Authority
|
||||||
|
// @Summary 删除角色
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysAuthority true "删除角色"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除角色"
|
||||||
|
// @Router /authority/deleteAuthority [post]
|
||||||
|
func (a *AuthorityApi) DeleteAuthority(c *gin.Context) {
|
||||||
|
var authority system.SysAuthority
|
||||||
|
err := c.ShouldBindJSON(&authority)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(authority, utils.AuthorityIdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = authorityService.DeleteAuthority(&authority)
|
||||||
|
if err != nil { // 删除角色之前需要判断是否有用户正在使用此角色
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败"+err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateAuthority
|
||||||
|
// @Tags Authority
|
||||||
|
// @Summary 更新角色信息
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysAuthority true "权限id, 权限名, 父角色id"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysAuthorityResponse,msg=string} "更新角色信息,返回包括系统角色详情"
|
||||||
|
// @Router /authority/updateAuthority [post]
|
||||||
|
func (a *AuthorityApi) UpdateAuthority(c *gin.Context) {
|
||||||
|
var auth system.SysAuthority
|
||||||
|
err := c.ShouldBindJSON(&auth)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(auth, utils.AuthorityVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
authority, err := authorityService.UpdateAuthority(auth)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("更新失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("更新失败"+err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authority}, "更新成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetAuthorityList
|
||||||
|
// @Tags Authority
|
||||||
|
// @Summary 分页获取角色列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.PageInfo true "页码, 每页大小"
|
||||||
|
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取角色列表,返回包括列表,总数,页码,每页数量"
|
||||||
|
// @Router /authority/getAuthorityList [post]
|
||||||
|
func (a *AuthorityApi) GetAuthorityList(c *gin.Context) {
|
||||||
|
var pageInfo request.PageInfo
|
||||||
|
err := c.ShouldBindJSON(&pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(pageInfo, utils.PageInfoVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
list, total, err := authorityService.GetAuthorityInfoList(pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败"+err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(response.PageResult{
|
||||||
|
List: list,
|
||||||
|
Total: total,
|
||||||
|
Page: pageInfo.Page,
|
||||||
|
PageSize: pageInfo.PageSize,
|
||||||
|
}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDataAuthority
|
||||||
|
// @Tags Authority
|
||||||
|
// @Summary 设置角色资源权限
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysAuthority true "设置角色资源权限"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "设置角色资源权限"
|
||||||
|
// @Router /authority/setDataAuthority [post]
|
||||||
|
func (a *AuthorityApi) SetDataAuthority(c *gin.Context) {
|
||||||
|
var auth system.SysAuthority
|
||||||
|
err := c.ShouldBindJSON(&auth)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(auth, utils.AuthorityIdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = authorityService.SetDataAuthority(auth)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("设置失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("设置失败"+err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("设置成功", c)
|
||||||
|
}
|
80
api/v1/system/sys_authority_btn.go
Normal file
80
api/v1/system/sys_authority_btn.go
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system/request"
|
||||||
|
)
|
||||||
|
|
||||||
|
type AuthorityBtnApi struct{}
|
||||||
|
|
||||||
|
// GetAuthorityBtn
|
||||||
|
// @Tags AuthorityBtn
|
||||||
|
// @Summary 获取权限按钮
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.SysAuthorityBtnReq true "菜单id, 角色id, 选中的按钮id"
|
||||||
|
// @Success 200 {object} response.Response{data=response.SysAuthorityBtnRes,msg=string} "返回列表成功"
|
||||||
|
// @Router /authorityBtn/getAuthorityBtn [post]
|
||||||
|
func (a *AuthorityBtnApi) GetAuthorityBtn(c *gin.Context) {
|
||||||
|
var req request.SysAuthorityBtnReq
|
||||||
|
err := c.ShouldBindJSON(&req)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res, err := authorityBtnService.GetAuthorityBtn(req)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("查询失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("查询失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(res, "查询成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetAuthorityBtn
|
||||||
|
// @Tags AuthorityBtn
|
||||||
|
// @Summary 设置权限按钮
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.SysAuthorityBtnReq true "菜单id, 角色id, 选中的按钮id"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "返回列表成功"
|
||||||
|
// @Router /authorityBtn/setAuthorityBtn [post]
|
||||||
|
func (a *AuthorityBtnApi) SetAuthorityBtn(c *gin.Context) {
|
||||||
|
var req request.SysAuthorityBtnReq
|
||||||
|
err := c.ShouldBindJSON(&req)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = authorityBtnService.SetAuthorityBtn(req)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("分配失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("分配失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("分配成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CanRemoveAuthorityBtn
|
||||||
|
// @Tags AuthorityBtn
|
||||||
|
// @Summary 设置权限按钮
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除成功"
|
||||||
|
// @Router /authorityBtn/canRemoveAuthorityBtn [post]
|
||||||
|
func (a *AuthorityBtnApi) CanRemoveAuthorityBtn(c *gin.Context) {
|
||||||
|
id := c.Query("id")
|
||||||
|
err := authorityBtnService.CanRemoveAuthorityBtn(id)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
315
api/v1/system/sys_auto_code.go
Normal file
315
api/v1/system/sys_auto_code.go
Normal file
@ -0,0 +1,315 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
"miniapp/utils"
|
||||||
|
|
||||||
|
"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("预览失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("预览失败", c)
|
||||||
|
} else {
|
||||||
|
response.OkWithDetailed(gin.H{"autoCode": autoCode}, "预览成功", 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":"创建成功"}"
|
||||||
|
// @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("自动化创建失败!请自行清空垃圾数据!", zap.Error(err))
|
||||||
|
c.Writer.Header().Add("success", "false")
|
||||||
|
c.Writer.Header().Add("msg", url.QueryEscape("自动化创建失败!请自行清空垃圾数据!"))
|
||||||
|
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 获取当前所有数据库
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取当前所有数据库"
|
||||||
|
// @Router /autoCode/getDatabase [get]
|
||||||
|
func (autoApi *AutoCodeApi) GetDB(c *gin.Context) {
|
||||||
|
businessDB := c.Query("businessDB")
|
||||||
|
dbs, err := autoCodeService.Database(businessDB).GetDB(businessDB)
|
||||||
|
var dbList []map[string]interface{}
|
||||||
|
for _, db := range global.GVA_CONFIG.DBList {
|
||||||
|
var item = make(map[string]interface{})
|
||||||
|
item["aliasName"] = db.AliasName
|
||||||
|
item["dbName"] = db.Dbname
|
||||||
|
item["disable"] = db.Disable
|
||||||
|
item["dbtype"] = db.Type
|
||||||
|
dbList = append(dbList, item)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
} else {
|
||||||
|
response.OkWithDetailed(gin.H{"dbs": dbs, "dbList": dbList}, "获取成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTables
|
||||||
|
// @Tags AutoCode
|
||||||
|
// @Summary 获取当前数据库所有表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取当前数据库所有表"
|
||||||
|
// @Router /autoCode/getTables [get]
|
||||||
|
func (autoApi *AutoCodeApi) GetTables(c *gin.Context) {
|
||||||
|
dbName := c.DefaultQuery("dbName", global.GVA_CONFIG.Mysql.Dbname)
|
||||||
|
businessDB := c.Query("businessDB")
|
||||||
|
tables, err := autoCodeService.Database(businessDB).GetTables(businessDB, dbName)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("查询table失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("查询table失败", c)
|
||||||
|
} else {
|
||||||
|
response.OkWithDetailed(gin.H{"tables": tables}, "获取成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetColumn
|
||||||
|
// @Tags AutoCode
|
||||||
|
// @Summary 获取当前表所有字段
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取当前表所有字段"
|
||||||
|
// @Router /autoCode/getColumn [get]
|
||||||
|
func (autoApi *AutoCodeApi) GetColumn(c *gin.Context) {
|
||||||
|
businessDB := c.Query("businessDB")
|
||||||
|
dbName := c.DefaultQuery("dbName", global.GVA_CONFIG.Mysql.Dbname)
|
||||||
|
tableName := c.Query("tableName")
|
||||||
|
columns, err := autoCodeService.Database(businessDB).GetColumn(businessDB, tableName, dbName)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
} else {
|
||||||
|
response.OkWithDetailed(gin.H{"columns": columns}, "获取成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := autoCodeService.CreateAutoCode(&a)
|
||||||
|
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)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
a.Snake = strings.ToLower(a.PlugName)
|
||||||
|
a.NeedModel = a.HasRequest || a.HasResponse
|
||||||
|
err = autoCodeService.CreatePlug(a)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("预览失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("预览失败", 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)
|
||||||
|
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)
|
||||||
|
}
|
115
api/v1/system/sys_auto_code_history.go
Normal file
115
api/v1/system/sys_auto_code_history.go
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
systemReq "miniapp/model/system/request"
|
||||||
|
)
|
||||||
|
|
||||||
|
type AutoCodeHistoryApi struct{}
|
||||||
|
|
||||||
|
// First
|
||||||
|
// @Tags AutoCode
|
||||||
|
// @Summary 获取meta信息
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.GetById true "请求参数"
|
||||||
|
// @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
|
||||||
|
err := c.ShouldBindJSON(&info)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data, err := autoCodeHistoryService.First(&info)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(gin.H{"meta": data}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete
|
||||||
|
// @Tags AutoCode
|
||||||
|
// @Summary 删除回滚记录
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.GetById true "请求参数"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除回滚记录"
|
||||||
|
// @Router /autoCode/delSysHistory [post]
|
||||||
|
func (a *AutoCodeHistoryApi) Delete(c *gin.Context) {
|
||||||
|
var info request.GetById
|
||||||
|
err := c.ShouldBindJSON(&info)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = autoCodeHistoryService.Delete(&info)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RollBack
|
||||||
|
// @Tags AutoCode
|
||||||
|
// @Summary 回滚自动生成代码
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.RollBack true "请求参数"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "回滚自动生成代码"
|
||||||
|
// @Router /autoCode/rollback [post]
|
||||||
|
func (a *AutoCodeHistoryApi) RollBack(c *gin.Context) {
|
||||||
|
var info systemReq.RollBack
|
||||||
|
err := c.ShouldBindJSON(&info)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = autoCodeHistoryService.RollBack(&info)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("回滚成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetList
|
||||||
|
// @Tags AutoCode
|
||||||
|
// @Summary 查询回滚记录
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.SysAutoHistory 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)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
list, total, err := autoCodeHistoryService.GetList(search.PageInfo)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(response.PageResult{
|
||||||
|
List: list,
|
||||||
|
Total: total,
|
||||||
|
Page: search.Page,
|
||||||
|
PageSize: search.PageSize,
|
||||||
|
}, "获取成功", c)
|
||||||
|
}
|
70
api/v1/system/sys_captcha.go
Normal file
70
api/v1/system/sys_captcha.go
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/mojocn/base64Captcha"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
systemRes "miniapp/model/system/response"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 当开启多服务器部署时,替换下面的配置,使用redis共享存储验证码
|
||||||
|
// var store = captcha.NewDefaultRedisStore()
|
||||||
|
var store = base64Captcha.DefaultMemStore
|
||||||
|
|
||||||
|
type BaseApi struct{}
|
||||||
|
|
||||||
|
// Captcha
|
||||||
|
// @Tags Base
|
||||||
|
// @Summary 生成验证码
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysCaptchaResponse,msg=string} "生成验证码,返回包括随机数id,base64,验证码长度,是否开启验证码"
|
||||||
|
// @Router /base/captcha [post]
|
||||||
|
func (b *BaseApi) Captcha(c *gin.Context) {
|
||||||
|
// 判断验证码是否开启
|
||||||
|
openCaptcha := global.GVA_CONFIG.Captcha.OpenCaptcha // 是否开启防爆次数
|
||||||
|
openCaptchaTimeOut := global.GVA_CONFIG.Captcha.OpenCaptchaTimeOut // 缓存超时时间
|
||||||
|
key := c.ClientIP()
|
||||||
|
v, ok := global.BlackCache.Get(key)
|
||||||
|
if !ok {
|
||||||
|
global.BlackCache.Set(key, 1, time.Second*time.Duration(openCaptchaTimeOut))
|
||||||
|
}
|
||||||
|
|
||||||
|
var oc bool
|
||||||
|
if openCaptcha == 0 || openCaptcha < interfaceToInt(v) {
|
||||||
|
oc = true
|
||||||
|
}
|
||||||
|
// 字符,公式,验证码配置
|
||||||
|
// 生成默认数字的driver
|
||||||
|
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()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("验证码获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("验证码获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysCaptchaResponse{
|
||||||
|
CaptchaId: id,
|
||||||
|
PicPath: b64s,
|
||||||
|
CaptchaLength: global.GVA_CONFIG.Captcha.KeyLong,
|
||||||
|
OpenCaptcha: oc,
|
||||||
|
}, "验证码获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 类型转换
|
||||||
|
func interfaceToInt(v interface{}) (i int) {
|
||||||
|
switch v := v.(type) {
|
||||||
|
case int:
|
||||||
|
i = v
|
||||||
|
default:
|
||||||
|
i = 0
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
68
api/v1/system/sys_casbin.go
Normal file
68
api/v1/system/sys_casbin.go
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system/request"
|
||||||
|
systemRes "miniapp/model/system/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CasbinApi struct{}
|
||||||
|
|
||||||
|
// UpdateCasbin
|
||||||
|
// @Tags Casbin
|
||||||
|
// @Summary 更新角色api权限
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.CasbinInReceive true "权限id, 权限模型列表"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "更新角色api权限"
|
||||||
|
// @Router /casbin/UpdateCasbin [post]
|
||||||
|
func (cas *CasbinApi) UpdateCasbin(c *gin.Context) {
|
||||||
|
var cmr request.CasbinInReceive
|
||||||
|
err := c.ShouldBindJSON(&cmr)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(cmr, utils.AuthorityIdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = casbinService.UpdateCasbin(cmr.AuthorityId, cmr.CasbinInfos)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("更新失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("更新失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("更新成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetPolicyPathByAuthorityId
|
||||||
|
// @Tags Casbin
|
||||||
|
// @Summary 获取权限列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.CasbinInReceive true "权限id, 权限模型列表"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.PolicyPathResponse,msg=string} "获取权限列表,返回包括casbin详情列表"
|
||||||
|
// @Router /casbin/getPolicyPathByAuthorityId [post]
|
||||||
|
func (cas *CasbinApi) GetPolicyPathByAuthorityId(c *gin.Context) {
|
||||||
|
var casbin request.CasbinInReceive
|
||||||
|
err := c.ShouldBindJSON(&casbin)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(casbin, utils.AuthorityIdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
paths := casbinService.GetPolicyPathByAuthorityId(casbin.AuthorityId)
|
||||||
|
response.OkWithDetailed(systemRes.PolicyPathResponse{Paths: paths}, "获取成功", c)
|
||||||
|
}
|
71
api/v1/system/sys_chatgpt.go
Normal file
71
api/v1/system/sys_chatgpt.go
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
sysModel "miniapp/model/system"
|
||||||
|
"miniapp/model/system/request"
|
||||||
|
)
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
148
api/v1/system/sys_dictionary.go
Normal file
148
api/v1/system/sys_dictionary.go
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
"miniapp/model/system/request"
|
||||||
|
"miniapp/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DictionaryApi struct{}
|
||||||
|
|
||||||
|
// CreateSysDictionary
|
||||||
|
// @Tags SysDictionary
|
||||||
|
// @Summary 创建SysDictionary
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysDictionary true "SysDictionary模型"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "创建SysDictionary"
|
||||||
|
// @Router /sysDictionary/createSysDictionary [post]
|
||||||
|
func (s *DictionaryApi) CreateSysDictionary(c *gin.Context) {
|
||||||
|
var dictionary system.SysDictionary
|
||||||
|
err := c.ShouldBindJSON(&dictionary)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = dictionaryService.CreateSysDictionary(dictionary)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("创建失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("创建失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("创建成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSysDictionary
|
||||||
|
// @Tags SysDictionary
|
||||||
|
// @Summary 删除SysDictionary
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysDictionary true "SysDictionary模型"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除SysDictionary"
|
||||||
|
// @Router /sysDictionary/deleteSysDictionary [delete]
|
||||||
|
func (s *DictionaryApi) DeleteSysDictionary(c *gin.Context) {
|
||||||
|
var dictionary system.SysDictionary
|
||||||
|
err := c.ShouldBindJSON(&dictionary)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = dictionaryService.DeleteSysDictionary(dictionary)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateSysDictionary
|
||||||
|
// @Tags SysDictionary
|
||||||
|
// @Summary 更新SysDictionary
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysDictionary true "SysDictionary模型"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "更新SysDictionary"
|
||||||
|
// @Router /sysDictionary/updateSysDictionary [put]
|
||||||
|
func (s *DictionaryApi) UpdateSysDictionary(c *gin.Context) {
|
||||||
|
var dictionary system.SysDictionary
|
||||||
|
err := c.ShouldBindJSON(&dictionary)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = dictionaryService.UpdateSysDictionary(&dictionary)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("更新失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("更新失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("更新成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindSysDictionary
|
||||||
|
// @Tags SysDictionary
|
||||||
|
// @Summary 用id查询SysDictionary
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data query system.SysDictionary true "ID或字典英名"
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "用id查询SysDictionary"
|
||||||
|
// @Router /sysDictionary/findSysDictionary [get]
|
||||||
|
func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
|
||||||
|
var dictionary system.SysDictionary
|
||||||
|
err := c.ShouldBindQuery(&dictionary)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sysDictionary, err := dictionaryService.GetSysDictionary(dictionary.Type, dictionary.ID, dictionary.Status)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("字典未创建或未开启!", zap.Error(err))
|
||||||
|
response.FailWithMessage("字典未创建或未开启", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(gin.H{"resysDictionary": sysDictionary}, "查询成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSysDictionaryList
|
||||||
|
// @Tags SysDictionary
|
||||||
|
// @Summary 分页获取SysDictionary列表
|
||||||
|
// @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)
|
||||||
|
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)
|
||||||
|
}
|
148
api/v1/system/sys_dictionary_detail.go
Normal file
148
api/v1/system/sys_dictionary_detail.go
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
"miniapp/model/system/request"
|
||||||
|
"miniapp/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DictionaryDetailApi struct{}
|
||||||
|
|
||||||
|
// CreateSysDictionaryDetail
|
||||||
|
// @Tags SysDictionaryDetail
|
||||||
|
// @Summary 创建SysDictionaryDetail
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysDictionaryDetail true "SysDictionaryDetail模型"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "创建SysDictionaryDetail"
|
||||||
|
// @Router /sysDictionaryDetail/createSysDictionaryDetail [post]
|
||||||
|
func (s *DictionaryDetailApi) CreateSysDictionaryDetail(c *gin.Context) {
|
||||||
|
var detail system.SysDictionaryDetail
|
||||||
|
err := c.ShouldBindJSON(&detail)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = dictionaryDetailService.CreateSysDictionaryDetail(detail)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("创建失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("创建失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("创建成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSysDictionaryDetail
|
||||||
|
// @Tags SysDictionaryDetail
|
||||||
|
// @Summary 删除SysDictionaryDetail
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysDictionaryDetail true "SysDictionaryDetail模型"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除SysDictionaryDetail"
|
||||||
|
// @Router /sysDictionaryDetail/deleteSysDictionaryDetail [delete]
|
||||||
|
func (s *DictionaryDetailApi) DeleteSysDictionaryDetail(c *gin.Context) {
|
||||||
|
var detail system.SysDictionaryDetail
|
||||||
|
err := c.ShouldBindJSON(&detail)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = dictionaryDetailService.DeleteSysDictionaryDetail(detail)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateSysDictionaryDetail
|
||||||
|
// @Tags SysDictionaryDetail
|
||||||
|
// @Summary 更新SysDictionaryDetail
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysDictionaryDetail true "更新SysDictionaryDetail"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "更新SysDictionaryDetail"
|
||||||
|
// @Router /sysDictionaryDetail/updateSysDictionaryDetail [put]
|
||||||
|
func (s *DictionaryDetailApi) UpdateSysDictionaryDetail(c *gin.Context) {
|
||||||
|
var detail system.SysDictionaryDetail
|
||||||
|
err := c.ShouldBindJSON(&detail)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = dictionaryDetailService.UpdateSysDictionaryDetail(&detail)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("更新失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("更新失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("更新成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindSysDictionaryDetail
|
||||||
|
// @Tags SysDictionaryDetail
|
||||||
|
// @Summary 用id查询SysDictionaryDetail
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data query system.SysDictionaryDetail true "用id查询SysDictionaryDetail"
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "用id查询SysDictionaryDetail"
|
||||||
|
// @Router /sysDictionaryDetail/findSysDictionaryDetail [get]
|
||||||
|
func (s *DictionaryDetailApi) FindSysDictionaryDetail(c *gin.Context) {
|
||||||
|
var detail system.SysDictionaryDetail
|
||||||
|
err := c.ShouldBindQuery(&detail)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(detail, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reSysDictionaryDetail, err := dictionaryDetailService.GetSysDictionaryDetail(detail.ID)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("查询失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("查询失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(gin.H{"reSysDictionaryDetail": reSysDictionaryDetail}, "查询成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSysDictionaryDetailList
|
||||||
|
// @Tags SysDictionaryDetail
|
||||||
|
// @Summary 分页获取SysDictionaryDetail列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data query request.SysDictionaryDetailSearch true "页码, 每页大小, 搜索条件"
|
||||||
|
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取SysDictionaryDetail列表,返回包括列表,总数,页码,每页数量"
|
||||||
|
// @Router /sysDictionaryDetail/getSysDictionaryDetailList [get]
|
||||||
|
func (s *DictionaryDetailApi) GetSysDictionaryDetailList(c *gin.Context) {
|
||||||
|
var pageInfo request.SysDictionaryDetailSearch
|
||||||
|
err := c.ShouldBindQuery(&pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
list, total, err := dictionaryDetailService.GetSysDictionaryDetailInfoList(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)
|
||||||
|
}
|
59
api/v1/system/sys_initdb.go
Normal file
59
api/v1/system/sys_initdb.go
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system/request"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DBApi struct{}
|
||||||
|
|
||||||
|
// InitDB
|
||||||
|
// @Tags InitDB
|
||||||
|
// @Summary 初始化用户数据库
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.InitDB true "初始化数据库参数"
|
||||||
|
// @Success 200 {object} response.Response{data=string} "初始化用户数据库"
|
||||||
|
// @Router /init/initdb [post]
|
||||||
|
func (i *DBApi) InitDB(c *gin.Context) {
|
||||||
|
if global.GVA_DB != nil {
|
||||||
|
global.GVA_LOG.Error("已存在数据库配置!")
|
||||||
|
response.FailWithMessage("已存在数据库配置", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var dbInfo request.InitDB
|
||||||
|
if err := c.ShouldBindJSON(&dbInfo); err != nil {
|
||||||
|
global.GVA_LOG.Error("参数校验不通过!", zap.Error(err))
|
||||||
|
response.FailWithMessage("参数校验不通过", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := initDBService.InitDB(dbInfo); err != nil {
|
||||||
|
global.GVA_LOG.Error("自动创建数据库失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("自动创建数据库失败,请查看后台日志,检查后在进行初始化", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("自动创建数据库成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CheckDB
|
||||||
|
// @Tags CheckDB
|
||||||
|
// @Summary 初始化用户数据库
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "初始化用户数据库"
|
||||||
|
// @Router /init/checkdb [post]
|
||||||
|
func (i *DBApi) CheckDB(c *gin.Context) {
|
||||||
|
var (
|
||||||
|
message = "前往初始化数据库"
|
||||||
|
needInit = true
|
||||||
|
)
|
||||||
|
|
||||||
|
if global.GVA_DB != nil {
|
||||||
|
message = "数据库无需初始化"
|
||||||
|
needInit = false
|
||||||
|
}
|
||||||
|
global.GVA_LOG.Info(message)
|
||||||
|
response.OkWithDetailed(gin.H{"needInit": needInit}, message, c)
|
||||||
|
}
|
31
api/v1/system/sys_jwt_blacklist.go
Normal file
31
api/v1/system/sys_jwt_blacklist.go
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
)
|
||||||
|
|
||||||
|
type JwtApi struct{}
|
||||||
|
|
||||||
|
// JsonInBlacklist
|
||||||
|
// @Tags Jwt
|
||||||
|
// @Summary jwt加入黑名单
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @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")
|
||||||
|
jwt := system.JwtBlacklist{Jwt: token}
|
||||||
|
err := jwtService.JsonInBlacklist(jwt)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("jwt作废失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("jwt作废失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("jwt作废成功", c)
|
||||||
|
}
|
278
api/v1/system/sys_menu.go
Normal file
278
api/v1/system/sys_menu.go
Normal file
@ -0,0 +1,278 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
systemReq "miniapp/model/system/request"
|
||||||
|
systemRes "miniapp/model/system/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
|
type AuthorityMenuApi struct{}
|
||||||
|
|
||||||
|
// GetMenu
|
||||||
|
// @Tags AuthorityMenu
|
||||||
|
// @Summary 获取用户动态路由
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.Empty true "空"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysMenusResponse,msg=string} "获取用户动态路由,返回包括系统菜单详情列表"
|
||||||
|
// @Router /menu/getMenu [post]
|
||||||
|
func (a *AuthorityMenuApi) GetMenu(c *gin.Context) {
|
||||||
|
menus, err := menuService.GetMenuTree(utils.GetUserAuthorityId(c))
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if menus == nil {
|
||||||
|
menus = []system.SysMenu{}
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysMenusResponse{Menus: menus}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBaseMenuTree
|
||||||
|
// @Tags AuthorityMenu
|
||||||
|
// @Summary 获取用户动态路由
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.Empty true "空"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysBaseMenusResponse,msg=string} "获取用户动态路由,返回包括系统菜单列表"
|
||||||
|
// @Router /menu/getBaseMenuTree [post]
|
||||||
|
func (a *AuthorityMenuApi) GetBaseMenuTree(c *gin.Context) {
|
||||||
|
menus, err := menuService.GetBaseMenuTree()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysBaseMenusResponse{Menus: menus}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddMenuAuthority
|
||||||
|
// @Tags AuthorityMenu
|
||||||
|
// @Summary 增加menu和角色关联关系
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.AddMenuAuthorityInfo true "角色ID"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "增加menu和角色关联关系"
|
||||||
|
// @Router /menu/addMenuAuthority [post]
|
||||||
|
func (a *AuthorityMenuApi) AddMenuAuthority(c *gin.Context) {
|
||||||
|
var authorityMenu systemReq.AddMenuAuthorityInfo
|
||||||
|
err := c.ShouldBindJSON(&authorityMenu)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := utils.Verify(authorityMenu, utils.AuthorityIdVerify); err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := menuService.AddMenuAuthority(authorityMenu.Menus, authorityMenu.AuthorityId); err != nil {
|
||||||
|
global.GVA_LOG.Error("添加失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("添加失败", c)
|
||||||
|
} else {
|
||||||
|
response.OkWithMessage("添加成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMenuAuthority
|
||||||
|
// @Tags AuthorityMenu
|
||||||
|
// @Summary 获取指定角色menu
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.GetAuthorityId true "角色ID"
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取指定角色menu"
|
||||||
|
// @Router /menu/getMenuAuthority [post]
|
||||||
|
func (a *AuthorityMenuApi) GetMenuAuthority(c *gin.Context) {
|
||||||
|
var param request.GetAuthorityId
|
||||||
|
err := c.ShouldBindJSON(¶m)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(param, utils.AuthorityIdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
menus, err := menuService.GetMenuAuthority(¶m)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithDetailed(systemRes.SysMenusResponse{Menus: menus}, "获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(gin.H{"menus": menus}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddBaseMenu
|
||||||
|
// @Tags Menu
|
||||||
|
// @Summary 新增菜单
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysBaseMenu true "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "新增菜单"
|
||||||
|
// @Router /menu/addBaseMenu [post]
|
||||||
|
func (a *AuthorityMenuApi) AddBaseMenu(c *gin.Context) {
|
||||||
|
var menu system.SysBaseMenu
|
||||||
|
err := c.ShouldBindJSON(&menu)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(menu, utils.MenuVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(menu.Meta, utils.MenuMetaVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = menuService.AddBaseMenu(menu)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("添加失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("添加失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("添加成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteBaseMenu
|
||||||
|
// @Tags Menu
|
||||||
|
// @Summary 删除菜单
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.GetById true "菜单id"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除菜单"
|
||||||
|
// @Router /menu/deleteBaseMenu [post]
|
||||||
|
func (a *AuthorityMenuApi) DeleteBaseMenu(c *gin.Context) {
|
||||||
|
var menu request.GetById
|
||||||
|
err := c.ShouldBindJSON(&menu)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(menu, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = baseMenuService.DeleteBaseMenu(menu.ID)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateBaseMenu
|
||||||
|
// @Tags Menu
|
||||||
|
// @Summary 更新菜单
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysBaseMenu true "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "更新菜单"
|
||||||
|
// @Router /menu/updateBaseMenu [post]
|
||||||
|
func (a *AuthorityMenuApi) UpdateBaseMenu(c *gin.Context) {
|
||||||
|
var menu system.SysBaseMenu
|
||||||
|
err := c.ShouldBindJSON(&menu)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(menu, utils.MenuVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(menu.Meta, utils.MenuMetaVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = baseMenuService.UpdateBaseMenu(menu)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("更新失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("更新失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("更新成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBaseMenuById
|
||||||
|
// @Tags Menu
|
||||||
|
// @Summary 根据id获取菜单
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.GetById true "菜单id"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysBaseMenuResponse,msg=string} "根据id获取菜单,返回包括系统菜单列表"
|
||||||
|
// @Router /menu/getBaseMenuById [post]
|
||||||
|
func (a *AuthorityMenuApi) GetBaseMenuById(c *gin.Context) {
|
||||||
|
var idInfo request.GetById
|
||||||
|
err := c.ShouldBindJSON(&idInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(idInfo, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
menu, err := baseMenuService.GetBaseMenuById(idInfo.ID)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysBaseMenuResponse{Menu: menu}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMenuList
|
||||||
|
// @Tags Menu
|
||||||
|
// @Summary 分页获取基础menu列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.PageInfo true "页码, 每页大小"
|
||||||
|
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取基础menu列表,返回包括列表,总数,页码,每页数量"
|
||||||
|
// @Router /menu/getMenuList [post]
|
||||||
|
func (a *AuthorityMenuApi) GetMenuList(c *gin.Context) {
|
||||||
|
var pageInfo request.PageInfo
|
||||||
|
err := c.ShouldBindJSON(&pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(pageInfo, utils.PageInfoVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
menuList, total, err := menuService.GetInfoList()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(response.PageResult{
|
||||||
|
List: menuList,
|
||||||
|
Total: total,
|
||||||
|
Page: pageInfo.Page,
|
||||||
|
PageSize: pageInfo.PageSize,
|
||||||
|
}, "获取成功", c)
|
||||||
|
}
|
149
api/v1/system/sys_operation_record.go
Normal file
149
api/v1/system/sys_operation_record.go
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
systemReq "miniapp/model/system/request"
|
||||||
|
"miniapp/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type OperationRecordApi struct{}
|
||||||
|
|
||||||
|
// CreateSysOperationRecord
|
||||||
|
// @Tags SysOperationRecord
|
||||||
|
// @Summary 创建SysOperationRecord
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysOperationRecord true "创建SysOperationRecord"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "创建SysOperationRecord"
|
||||||
|
// @Router /sysOperationRecord/createSysOperationRecord [post]
|
||||||
|
func (s *OperationRecordApi) CreateSysOperationRecord(c *gin.Context) {
|
||||||
|
var sysOperationRecord system.SysOperationRecord
|
||||||
|
err := c.ShouldBindJSON(&sysOperationRecord)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = operationRecordService.CreateSysOperationRecord(sysOperationRecord)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("创建失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("创建失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("创建成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSysOperationRecord
|
||||||
|
// @Tags SysOperationRecord
|
||||||
|
// @Summary 删除SysOperationRecord
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysOperationRecord true "SysOperationRecord模型"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除SysOperationRecord"
|
||||||
|
// @Router /sysOperationRecord/deleteSysOperationRecord [delete]
|
||||||
|
func (s *OperationRecordApi) DeleteSysOperationRecord(c *gin.Context) {
|
||||||
|
var sysOperationRecord system.SysOperationRecord
|
||||||
|
err := c.ShouldBindJSON(&sysOperationRecord)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = operationRecordService.DeleteSysOperationRecord(sysOperationRecord)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSysOperationRecordByIds
|
||||||
|
// @Tags SysOperationRecord
|
||||||
|
// @Summary 批量删除SysOperationRecord
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.IdsReq true "批量删除SysOperationRecord"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "批量删除SysOperationRecord"
|
||||||
|
// @Router /sysOperationRecord/deleteSysOperationRecordByIds [delete]
|
||||||
|
func (s *OperationRecordApi) DeleteSysOperationRecordByIds(c *gin.Context) {
|
||||||
|
var IDS request.IdsReq
|
||||||
|
err := c.ShouldBindJSON(&IDS)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = operationRecordService.DeleteSysOperationRecordByIds(IDS)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("批量删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("批量删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("批量删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindSysOperationRecord
|
||||||
|
// @Tags SysOperationRecord
|
||||||
|
// @Summary 用id查询SysOperationRecord
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data query system.SysOperationRecord true "Id"
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "用id查询SysOperationRecord"
|
||||||
|
// @Router /sysOperationRecord/findSysOperationRecord [get]
|
||||||
|
func (s *OperationRecordApi) FindSysOperationRecord(c *gin.Context) {
|
||||||
|
var sysOperationRecord system.SysOperationRecord
|
||||||
|
err := c.ShouldBindQuery(&sysOperationRecord)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(sysOperationRecord, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reSysOperationRecord, err := operationRecordService.GetSysOperationRecord(sysOperationRecord.ID)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("查询失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("查询失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(gin.H{"reSysOperationRecord": reSysOperationRecord}, "查询成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSysOperationRecordList
|
||||||
|
// @Tags SysOperationRecord
|
||||||
|
// @Summary 分页获取SysOperationRecord列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data query request.SysOperationRecordSearch true "页码, 每页大小, 搜索条件"
|
||||||
|
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取SysOperationRecord列表,返回包括列表,总数,页码,每页数量"
|
||||||
|
// @Router /sysOperationRecord/getSysOperationRecordList [get]
|
||||||
|
func (s *OperationRecordApi) GetSysOperationRecordList(c *gin.Context) {
|
||||||
|
var pageInfo systemReq.SysOperationRecordSearch
|
||||||
|
err := c.ShouldBindQuery(&pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
list, total, err := operationRecordService.GetSysOperationRecordInfoList(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)
|
||||||
|
}
|
89
api/v1/system/sys_system.go
Normal file
89
api/v1/system/sys_system.go
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
systemRes "miniapp/model/system/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SystemApi struct{}
|
||||||
|
|
||||||
|
// GetSystemConfig
|
||||||
|
// @Tags System
|
||||||
|
// @Summary 获取配置文件内容
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysConfigResponse,msg=string} "获取配置文件内容,返回包括系统配置"
|
||||||
|
// @Router /system/getSystemConfig [post]
|
||||||
|
func (s *SystemApi) GetSystemConfig(c *gin.Context) {
|
||||||
|
config, err := systemConfigService.GetSystemConfig()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysConfigResponse{Config: config}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetSystemConfig
|
||||||
|
// @Tags System
|
||||||
|
// @Summary 设置配置文件内容
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.System true "设置配置文件内容"
|
||||||
|
// @Success 200 {object} response.Response{data=string} "设置配置文件内容"
|
||||||
|
// @Router /system/setSystemConfig [post]
|
||||||
|
func (s *SystemApi) SetSystemConfig(c *gin.Context) {
|
||||||
|
var sys system.System
|
||||||
|
err := c.ShouldBindJSON(&sys)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = systemConfigService.SetSystemConfig(sys)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("设置失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("设置失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("设置成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReloadSystem
|
||||||
|
// @Tags System
|
||||||
|
// @Summary 重启系统
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "重启系统"
|
||||||
|
// @Router /system/reloadSystem [post]
|
||||||
|
func (s *SystemApi) ReloadSystem(c *gin.Context) {
|
||||||
|
err := utils.Reload()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("重启系统失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("重启系统失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("重启系统成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetServerInfo
|
||||||
|
// @Tags System
|
||||||
|
// @Summary 获取服务器信息
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取服务器信息"
|
||||||
|
// @Router /system/getServerInfo [post]
|
||||||
|
func (s *SystemApi) GetServerInfo(c *gin.Context) {
|
||||||
|
server, err := systemConfigService.GetServerInfo()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(gin.H{"server.exe.exe": server}, "获取成功", c)
|
||||||
|
}
|
462
api/v1/system/sys_user.go
Normal file
462
api/v1/system/sys_user.go
Normal file
@ -0,0 +1,462 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/common/request"
|
||||||
|
"miniapp/model/common/response"
|
||||||
|
"miniapp/model/system"
|
||||||
|
systemReq "miniapp/model/system/request"
|
||||||
|
systemRes "miniapp/model/system/response"
|
||||||
|
"miniapp/utils"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/redis/go-redis/v9"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Login
|
||||||
|
// @Tags Base
|
||||||
|
// @Summary 用户登录
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.Login true "用户名, 密码, 验证码"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.LoginResponse,msg=string} "返回包括用户信息,token,过期时间"
|
||||||
|
// @Router /base/login [post]
|
||||||
|
func (b *BaseApi) Login(c *gin.Context) {
|
||||||
|
var l systemReq.Login
|
||||||
|
err := c.ShouldBindJSON(&l)
|
||||||
|
key := c.ClientIP()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(l, utils.LoginVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断验证码是否开启
|
||||||
|
openCaptcha := global.GVA_CONFIG.Captcha.OpenCaptcha // 是否开启防爆次数
|
||||||
|
openCaptchaTimeOut := global.GVA_CONFIG.Captcha.OpenCaptchaTimeOut // 缓存超时时间
|
||||||
|
v, ok := global.BlackCache.Get(key)
|
||||||
|
if !ok {
|
||||||
|
global.BlackCache.Set(key, 1, time.Second*time.Duration(openCaptchaTimeOut))
|
||||||
|
}
|
||||||
|
|
||||||
|
var oc bool = openCaptcha == 0 || openCaptcha < interfaceToInt(v)
|
||||||
|
|
||||||
|
if !oc || (l.CaptchaId != "" && l.Captcha != "" && store.Verify(l.CaptchaId, l.Captcha, true)) {
|
||||||
|
u := &system.SysUser{Username: l.Username, Password: l.Password}
|
||||||
|
user, err := userService.Login(u)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("登陆失败! 用户名不存在或者密码错误!", zap.Error(err))
|
||||||
|
// 验证码次数+1
|
||||||
|
global.BlackCache.Increment(key, 1)
|
||||||
|
response.FailWithMessage("用户名不存在或者密码错误", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if user.Enable != 1 {
|
||||||
|
global.GVA_LOG.Error("登陆失败! 用户被禁止登录!")
|
||||||
|
// 验证码次数+1
|
||||||
|
global.BlackCache.Increment(key, 1)
|
||||||
|
response.FailWithMessage("用户被禁止登录", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
b.TokenNext(c, *user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 验证码次数+1
|
||||||
|
global.BlackCache.Increment(key, 1)
|
||||||
|
response.FailWithMessage("验证码错误", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取token失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取token失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !global.GVA_CONFIG.System.UseMultipoint {
|
||||||
|
response.OkWithDetailed(systemRes.LoginResponse{
|
||||||
|
User: user,
|
||||||
|
Token: token,
|
||||||
|
ExpiresAt: claims.RegisteredClaims.ExpiresAt.Unix() * 1000,
|
||||||
|
}, "登录成功", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if jwtStr, err := jwtService.GetRedisJWT(user.Username); err == redis.Nil {
|
||||||
|
if err := jwtService.SetRedisJWT(token, user.Username); err != nil {
|
||||||
|
global.GVA_LOG.Error("设置登录状态失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("设置登录状态失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.LoginResponse{
|
||||||
|
User: user,
|
||||||
|
Token: token,
|
||||||
|
ExpiresAt: claims.RegisteredClaims.ExpiresAt.Unix() * 1000,
|
||||||
|
}, "登录成功", c)
|
||||||
|
} else if err != nil {
|
||||||
|
global.GVA_LOG.Error("设置登录状态失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("设置登录状态失败", c)
|
||||||
|
} else {
|
||||||
|
var blackJWT system.JwtBlacklist
|
||||||
|
blackJWT.Jwt = jwtStr
|
||||||
|
if err := jwtService.JsonInBlacklist(blackJWT); err != nil {
|
||||||
|
response.FailWithMessage("jwt作废失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := jwtService.SetRedisJWT(token, user.Username); err != nil {
|
||||||
|
response.FailWithMessage("设置登录状态失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.LoginResponse{
|
||||||
|
User: user,
|
||||||
|
Token: token,
|
||||||
|
ExpiresAt: claims.RegisteredClaims.ExpiresAt.Unix() * 1000,
|
||||||
|
}, "登录成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 用户注册账号
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.Register true "用户名, 昵称, 密码, 角色ID"
|
||||||
|
// @Success 200 {object} response.Response{data=systemRes.SysUserResponse,msg=string} "用户注册账号,返回包括用户信息"
|
||||||
|
// @Router /user/admin_register [post]
|
||||||
|
func (b *BaseApi) Register(c *gin.Context) {
|
||||||
|
var r systemReq.Register
|
||||||
|
err := c.ShouldBindJSON(&r)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(r, utils.RegisterVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var authorities []system.SysAuthority
|
||||||
|
for _, v := range r.AuthorityIds {
|
||||||
|
authorities = append(authorities, system.SysAuthority{
|
||||||
|
AuthorityId: v,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
user := &system.SysUser{Username: r.Username, NickName: r.NickName, Password: r.Password, HeaderImg: r.HeaderImg, AuthorityId: r.AuthorityId, Authorities: authorities, Enable: r.Enable, Phone: r.Phone, Email: r.Email}
|
||||||
|
userReturn, err := userService.Register(*user)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("注册失败!", zap.Error(err))
|
||||||
|
response.FailWithDetailed(systemRes.SysUserResponse{User: userReturn}, "注册失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(systemRes.SysUserResponse{User: userReturn}, "注册成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ChangePassword
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 用户修改密码
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.ChangePasswordReq true "用户名, 原密码, 新密码"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "用户修改密码"
|
||||||
|
// @Router /user/changePassword [post]
|
||||||
|
func (b *BaseApi) ChangePassword(c *gin.Context) {
|
||||||
|
var req systemReq.ChangePasswordReq
|
||||||
|
err := c.ShouldBindJSON(&req)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(req, utils.ChangePasswordVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uid := utils.GetUserID(c)
|
||||||
|
u := &system.SysUser{GVA_MODEL: global.GVA_MODEL{ID: uid}, Password: req.Password}
|
||||||
|
_, err = userService.ChangePassword(u, req.NewPassword)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("修改失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("修改失败,原密码与当前账户不符", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("修改成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUserList
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 分页获取用户列表
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.PageInfo true "页码, 每页大小"
|
||||||
|
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取用户列表,返回包括列表,总数,页码,每页数量"
|
||||||
|
// @Router /user/getUserList [post]
|
||||||
|
func (b *BaseApi) GetUserList(c *gin.Context) {
|
||||||
|
var pageInfo request.PageInfo
|
||||||
|
err := c.ShouldBindJSON(&pageInfo)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(pageInfo, utils.PageInfoVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
list, total, err := userService.GetUserInfoList(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)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetUserAuthority
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 更改用户权限
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.SetUserAuth true "用户UUID, 角色ID"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "设置用户权限"
|
||||||
|
// @Router /user/setUserAuthority [post]
|
||||||
|
func (b *BaseApi) SetUserAuthority(c *gin.Context) {
|
||||||
|
var sua systemReq.SetUserAuth
|
||||||
|
err := c.ShouldBindJSON(&sua)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if UserVerifyErr := utils.Verify(sua, utils.SetUserAuthorityVerify); UserVerifyErr != nil {
|
||||||
|
response.FailWithMessage(UserVerifyErr.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
userID := utils.GetUserID(c)
|
||||||
|
err = userService.SetUserAuthority(userID, sua.AuthorityId)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("修改失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
claims := utils.GetUserInfo(c)
|
||||||
|
j := &utils.JWT{SigningKey: []byte(global.GVA_CONFIG.JWT.SigningKey)} // 唯一签名
|
||||||
|
claims.AuthorityId = sua.AuthorityId
|
||||||
|
if token, err := j.CreateToken(*claims); err != nil {
|
||||||
|
global.GVA_LOG.Error("修改失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
} else {
|
||||||
|
c.Header("new-token", token)
|
||||||
|
c.Header("new-expires-at", strconv.FormatInt(claims.ExpiresAt.Unix(), 10))
|
||||||
|
response.OkWithMessage("修改成功", c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetUserAuthorities
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 设置用户权限
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body systemReq.SetUserAuthorities true "用户UUID, 角色ID"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "设置用户权限"
|
||||||
|
// @Router /user/setUserAuthorities [post]
|
||||||
|
func (b *BaseApi) SetUserAuthorities(c *gin.Context) {
|
||||||
|
var sua systemReq.SetUserAuthorities
|
||||||
|
err := c.ShouldBindJSON(&sua)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = userService.SetUserAuthorities(sua.ID, sua.AuthorityIds)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("修改失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("修改失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("修改成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteUser
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 删除用户
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body request.GetById true "用户ID"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "删除用户"
|
||||||
|
// @Router /user/deleteUser [delete]
|
||||||
|
func (b *BaseApi) DeleteUser(c *gin.Context) {
|
||||||
|
var reqId request.GetById
|
||||||
|
err := c.ShouldBindJSON(&reqId)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(reqId, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
jwtId := utils.GetUserID(c)
|
||||||
|
if jwtId == uint(reqId.ID) {
|
||||||
|
response.FailWithMessage("删除失败, 自杀失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = userService.DeleteUser(reqId.ID)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("删除失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("删除失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("删除成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetUserInfo
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 设置用户信息
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysUser true "ID, 用户名, 昵称, 头像链接"
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "设置用户信息"
|
||||||
|
// @Router /user/setUserInfo [put]
|
||||||
|
func (b *BaseApi) SetUserInfo(c *gin.Context) {
|
||||||
|
var user systemReq.ChangeUserInfo
|
||||||
|
err := c.ShouldBindJSON(&user)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = utils.Verify(user, utils.IdVerify)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(user.AuthorityIds) != 0 {
|
||||||
|
err = userService.SetUserAuthorities(user.ID, user.AuthorityIds)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("设置失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("设置失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err = userService.SetUserInfo(system.SysUser{
|
||||||
|
GVA_MODEL: global.GVA_MODEL{
|
||||||
|
ID: user.ID,
|
||||||
|
},
|
||||||
|
NickName: user.NickName,
|
||||||
|
HeaderImg: user.HeaderImg,
|
||||||
|
Phone: user.Phone,
|
||||||
|
Email: user.Email,
|
||||||
|
SideMode: user.SideMode,
|
||||||
|
Enable: user.Enable,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("设置失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("设置失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("设置成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetSelfInfo
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 设置用户信息
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysUser true "ID, 用户名, 昵称, 头像链接"
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "设置用户信息"
|
||||||
|
// @Router /user/SetSelfInfo [put]
|
||||||
|
func (b *BaseApi) SetSelfInfo(c *gin.Context) {
|
||||||
|
var user systemReq.ChangeUserInfo
|
||||||
|
err := c.ShouldBindJSON(&user)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
user.ID = utils.GetUserID(c)
|
||||||
|
err = userService.SetSelfInfo(system.SysUser{
|
||||||
|
GVA_MODEL: global.GVA_MODEL{
|
||||||
|
ID: user.ID,
|
||||||
|
},
|
||||||
|
NickName: user.NickName,
|
||||||
|
HeaderImg: user.HeaderImg,
|
||||||
|
Phone: user.Phone,
|
||||||
|
Email: user.Email,
|
||||||
|
SideMode: user.SideMode,
|
||||||
|
Enable: user.Enable,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("设置失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("设置失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("设置成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUserInfo
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 获取用户信息
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @accept application/json
|
||||||
|
// @Produce application/json
|
||||||
|
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取用户信息"
|
||||||
|
// @Router /user/getUserInfo [get]
|
||||||
|
func (b *BaseApi) GetUserInfo(c *gin.Context) {
|
||||||
|
uuid := utils.GetUserUuid(c)
|
||||||
|
ReqUser, err := userService.GetUserInfo(uuid)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("获取失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("获取失败", c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithDetailed(gin.H{"userInfo": ReqUser}, "获取成功", c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ResetPassword
|
||||||
|
// @Tags SysUser
|
||||||
|
// @Summary 重置用户密码
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Produce application/json
|
||||||
|
// @Param data body system.SysUser true "ID"
|
||||||
|
// @Success 200 {object} response.Response{msg=string} "重置用户密码"
|
||||||
|
// @Router /user/resetPassword [post]
|
||||||
|
func (b *BaseApi) ResetPassword(c *gin.Context) {
|
||||||
|
var user system.SysUser
|
||||||
|
err := c.ShouldBindJSON(&user)
|
||||||
|
if err != nil {
|
||||||
|
response.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = userService.ResetPassword(user.ID)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("重置失败!", zap.Error(err))
|
||||||
|
response.FailWithMessage("重置失败"+err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
response.OkWithMessage("重置成功", c)
|
||||||
|
}
|
25
client/redis.go
Normal file
25
client/redis.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"git.echol.cn/loser/logger/log"
|
||||||
|
"github.com/go-redis/redis/v8"
|
||||||
|
"miniapp/global"
|
||||||
|
)
|
||||||
|
|
||||||
|
var Redis *redis.Client
|
||||||
|
|
||||||
|
func InitRedisClient() {
|
||||||
|
// 初始化连接
|
||||||
|
conn := redis.NewClient(&redis.Options{
|
||||||
|
Addr: global.GVA_CONFIG.Redis.Addr,
|
||||||
|
Password: global.GVA_CONFIG.Redis.Password,
|
||||||
|
DB: global.GVA_CONFIG.Redis.DB,
|
||||||
|
})
|
||||||
|
if err := conn.Ping(context.Background()).Err(); err != nil {
|
||||||
|
log.Panicf("Redis连接初始化失败: %v", err)
|
||||||
|
} else {
|
||||||
|
log.Debug("Redis连接初始化成功")
|
||||||
|
}
|
||||||
|
Redis = conn
|
||||||
|
}
|
203
config.docker.yaml
Normal file
203
config.docker.yaml
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
# miniapp Global Configuration
|
||||||
|
|
||||||
|
# jwt configuration
|
||||||
|
jwt:
|
||||||
|
signing-key: qmPlus
|
||||||
|
expires-time: 7d
|
||||||
|
buffer-time: 1d
|
||||||
|
issuer: qmPlus
|
||||||
|
# zap logger configuration
|
||||||
|
zap:
|
||||||
|
level: info
|
||||||
|
format: console
|
||||||
|
prefix: "[miniapp]"
|
||||||
|
director: log
|
||||||
|
show-line: true
|
||||||
|
encode-level: LowercaseColorLevelEncoder
|
||||||
|
stacktrace-key: stacktrace
|
||||||
|
log-in-console: true
|
||||||
|
|
||||||
|
# redis configuration
|
||||||
|
redis:
|
||||||
|
db: 0
|
||||||
|
addr: 177.7.0.14:6379
|
||||||
|
password: ""
|
||||||
|
|
||||||
|
# email configuration
|
||||||
|
email:
|
||||||
|
to: xxx@qq.com
|
||||||
|
port: 465
|
||||||
|
from: xxx@163.com
|
||||||
|
host: smtp.163.com
|
||||||
|
is-ssl: true
|
||||||
|
secret: xxx
|
||||||
|
nickname: test
|
||||||
|
|
||||||
|
# system configuration
|
||||||
|
system:
|
||||||
|
env: public # Change to "develop" to skip authentication for development mode
|
||||||
|
addr: 8888
|
||||||
|
db-type: mysql
|
||||||
|
oss-type: local # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server.exe.exe/utils/upload/upload.go 中 NewOss函数配置
|
||||||
|
use-redis: false # 使用redis
|
||||||
|
use-multipoint: false
|
||||||
|
# IP限制次数 一个小时15000次
|
||||||
|
iplimit-count: 15000
|
||||||
|
# IP限制一个小时
|
||||||
|
iplimit-time: 3600
|
||||||
|
|
||||||
|
# captcha configuration
|
||||||
|
captcha:
|
||||||
|
key-long: 6
|
||||||
|
img-width: 240
|
||||||
|
img-height: 80
|
||||||
|
open-captcha: 0 # 0代表一直开启,大于0代表限制次数
|
||||||
|
open-captcha-timeout: 3600 # open-captcha大于0时才生效
|
||||||
|
|
||||||
|
# mysql connect configuration
|
||||||
|
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://gin-vue-admin.com/docs/first_master)
|
||||||
|
mysql:
|
||||||
|
path: ""
|
||||||
|
port: ""
|
||||||
|
config: ""
|
||||||
|
db-name: ""
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
max-idle-conns: 10
|
||||||
|
max-open-conns: 100
|
||||||
|
log-mode: ""
|
||||||
|
log-zap: false
|
||||||
|
|
||||||
|
# pgsql connect configuration
|
||||||
|
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://gin-vue-admin.com/docs/first_master)
|
||||||
|
pgsql:
|
||||||
|
path: ""
|
||||||
|
port: ""
|
||||||
|
config: ""
|
||||||
|
db-name: ""
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
max-idle-conns: 10
|
||||||
|
max-open-conns: 100
|
||||||
|
log-mode: ""
|
||||||
|
log-zap: false
|
||||||
|
|
||||||
|
db-list:
|
||||||
|
- disable: true # 是否禁用
|
||||||
|
type: "" # 数据库的类型,目前支持mysql、pgsql
|
||||||
|
alias-name: "" # 数据库的名称,注意: alias-name 需要在db-list中唯一
|
||||||
|
path: ""
|
||||||
|
port: ""
|
||||||
|
config: ""
|
||||||
|
db-name: ""
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
max-idle-conns: 10
|
||||||
|
max-open-conns: 100
|
||||||
|
log-mode: ""
|
||||||
|
log-zap: false
|
||||||
|
|
||||||
|
|
||||||
|
# local configuration
|
||||||
|
local:
|
||||||
|
path: uploads/file
|
||||||
|
store-path: uploads/file
|
||||||
|
|
||||||
|
# autocode configuration
|
||||||
|
autocode:
|
||||||
|
transfer-restart: true
|
||||||
|
# root 自动适配项目根目录
|
||||||
|
# 请不要手动配置,他会在项目加载的时候识别出根路径
|
||||||
|
root: ""
|
||||||
|
server: /server.exe.exe
|
||||||
|
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
|
||||||
|
|
||||||
|
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
|
||||||
|
qiniu:
|
||||||
|
zone: ZoneHuaDong
|
||||||
|
bucket: ""
|
||||||
|
img-path: ""
|
||||||
|
use-https: false
|
||||||
|
access-key: ""
|
||||||
|
secret-key: ""
|
||||||
|
use-cdn-domains: false
|
||||||
|
|
||||||
|
# aliyun oss configuration
|
||||||
|
aliyun-oss:
|
||||||
|
endpoint: yourEndpoint
|
||||||
|
access-key-id: yourAccessKeyId
|
||||||
|
access-key-secret: yourAccessKeySecret
|
||||||
|
bucket-name: yourBucketName
|
||||||
|
bucket-url: yourBucketUrl
|
||||||
|
base-path: yourBasePath
|
||||||
|
|
||||||
|
# tencent cos configuration
|
||||||
|
tencent-cos:
|
||||||
|
bucket: xxxxx-10005608
|
||||||
|
region: ap-shanghai
|
||||||
|
secret-id: your-secret-id
|
||||||
|
secret-key: your-secret-key
|
||||||
|
base-url: https://gin.vue.admin
|
||||||
|
path-prefix: miniapp
|
||||||
|
|
||||||
|
# aws s3 configuration (minio compatible)
|
||||||
|
aws-s3:
|
||||||
|
bucket: xxxxx-10005608
|
||||||
|
region: ap-shanghai
|
||||||
|
endpoint: ""
|
||||||
|
s3-force-path-style: false
|
||||||
|
disable-ssl: false
|
||||||
|
secret-id: your-secret-id
|
||||||
|
secret-key: your-secret-key
|
||||||
|
base-url: https://gin.vue.admin
|
||||||
|
path-prefix: miniapp
|
||||||
|
|
||||||
|
# huawei obs configuration
|
||||||
|
hua-wei-obs:
|
||||||
|
path: you-path
|
||||||
|
bucket: you-bucket
|
||||||
|
endpoint: you-endpoint
|
||||||
|
access-key: you-access-key
|
||||||
|
secret-key: you-secret-key
|
||||||
|
|
||||||
|
# excel configuration
|
||||||
|
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
|
||||||
|
|
||||||
|
# 跨域配置
|
||||||
|
# 需要配合 server.exe.exe/initialize/router.go -> `Router.Use(middleware.CorsByRules())` 使用
|
||||||
|
cors:
|
||||||
|
mode: whitelist # 放行模式: allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝
|
||||||
|
whitelist:
|
||||||
|
- allow-origin: example1.com
|
||||||
|
allow-headers: content-type
|
||||||
|
allow-methods: GET, POST
|
||||||
|
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
|
||||||
|
allow-credentials: true # 布尔值
|
||||||
|
- allow-origin: example2.com
|
||||||
|
allow-headers: content-type
|
||||||
|
allow-methods: GET, POST
|
||||||
|
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
|
||||||
|
allow-credentials: true # 布尔值
|
128
config.yaml
Normal file
128
config.yaml
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
aliyun-oss:
|
||||||
|
endpoint: oss-cn-chengdu.aliyuncs.com
|
||||||
|
access-key-id: LTAI5tFHes6HBWJFUjuPwHso
|
||||||
|
access-key-secret: qXuWtEJvYEQvj9yhkmLYfRxHShheYa
|
||||||
|
bucket-name: jmyl-app
|
||||||
|
bucket-url: https://jmyl-app.oss-cn-chengdu.aliyuncs.com
|
||||||
|
base-path: miniapp
|
||||||
|
autocode:
|
||||||
|
server-model: /model/%s
|
||||||
|
server-router: /router/%s
|
||||||
|
server: /server.exe.exe
|
||||||
|
server-api: /api/v1/%s
|
||||||
|
server-plug: /plugin/%s
|
||||||
|
server-initialize: /initialize
|
||||||
|
root: C:\Users\Administrator\Desktop
|
||||||
|
web-table: /view
|
||||||
|
web: /web/src
|
||||||
|
server-service: /service/%s
|
||||||
|
server-request: /model/%s/request/
|
||||||
|
web-api: /api
|
||||||
|
web-form: /view
|
||||||
|
transfer-restart: true
|
||||||
|
captcha:
|
||||||
|
key-long: 4
|
||||||
|
img-width: 240
|
||||||
|
img-height: 80
|
||||||
|
open-captcha: 0
|
||||||
|
open-captcha-timeout: 3600
|
||||||
|
cors:
|
||||||
|
mode: strict-whitelist
|
||||||
|
whitelist:
|
||||||
|
- allow-origin: example1.com
|
||||||
|
allow-methods: POST, GET
|
||||||
|
allow-headers: Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id
|
||||||
|
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
|
||||||
|
allow-credentials: true
|
||||||
|
- allow-origin: example2.com
|
||||||
|
allow-methods: GET, POST
|
||||||
|
allow-headers: content-type
|
||||||
|
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
|
||||||
|
allow-credentials: true
|
||||||
|
db-list:
|
||||||
|
- type: ""
|
||||||
|
alias-name: ""
|
||||||
|
prefix: ""
|
||||||
|
port: ""
|
||||||
|
config: ""
|
||||||
|
db-name: ""
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
path: ""
|
||||||
|
engine: ""
|
||||||
|
log-mode: ""
|
||||||
|
max-idle-conns: 10
|
||||||
|
max-open-conns: 100
|
||||||
|
singular: false
|
||||||
|
log-zap: false
|
||||||
|
disable: true
|
||||||
|
email:
|
||||||
|
to: xxx@qq.com
|
||||||
|
from: xxx@163.com
|
||||||
|
host: smtp.163.com
|
||||||
|
secret: xxx
|
||||||
|
nickname: test
|
||||||
|
port: 465
|
||||||
|
is-ssl: true
|
||||||
|
excel:
|
||||||
|
dir: ./resource/excel/
|
||||||
|
jwt:
|
||||||
|
signing-key: f2b1b2af-c8f1-43cf-88e4-40b0a64b5487
|
||||||
|
expires-time: 7d
|
||||||
|
buffer-time: 1d
|
||||||
|
issuer: qmPlus
|
||||||
|
local:
|
||||||
|
path: uploads/file
|
||||||
|
store-path: uploads/file
|
||||||
|
mini-app:
|
||||||
|
app-id: wxaaf66dbb5c3983b3
|
||||||
|
app-secret: 0abba24dbff43febba1e551651f693b4
|
||||||
|
mysql:
|
||||||
|
prefix: ""
|
||||||
|
port: "3307"
|
||||||
|
config: charset=utf8mb4&parseTime=True&loc=Local
|
||||||
|
db-name: jm_wechat2
|
||||||
|
username: root
|
||||||
|
password: loser7659
|
||||||
|
path: 192.168.123.120
|
||||||
|
engine: ""
|
||||||
|
log-mode: error
|
||||||
|
max-idle-conns: 10
|
||||||
|
max-open-conns: 100
|
||||||
|
singular: false
|
||||||
|
log-zap: false
|
||||||
|
redis:
|
||||||
|
addr: 192.168.123.120:6378
|
||||||
|
password: ""
|
||||||
|
db: 0
|
||||||
|
system:
|
||||||
|
env: public
|
||||||
|
db-type: mysql
|
||||||
|
oss-type: aliyun-oss
|
||||||
|
router-prefix: ""
|
||||||
|
addr: 8888
|
||||||
|
iplimit-count: 15000
|
||||||
|
iplimit-time: 3600
|
||||||
|
use-multipoint: false
|
||||||
|
use-redis: true
|
||||||
|
timer:
|
||||||
|
spec: '@daily'
|
||||||
|
detail:
|
||||||
|
- tableName: sys_operation_records
|
||||||
|
compareField: created_at
|
||||||
|
interval: 2160h
|
||||||
|
- tableName: jwt_blacklists
|
||||||
|
compareField: created_at
|
||||||
|
interval: 168h
|
||||||
|
start: true
|
||||||
|
with_seconds: false
|
||||||
|
zap:
|
||||||
|
level: info
|
||||||
|
prefix: '[miniapp]'
|
||||||
|
format: console
|
||||||
|
director: log
|
||||||
|
encode-level: LowercaseColorLevelEncoder
|
||||||
|
stacktrace-key: stacktrace
|
||||||
|
max-age: 0
|
||||||
|
show-line: true
|
||||||
|
log-in-console: true
|
18
config/auto_code.go
Normal file
18
config/auto_code.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Autocode struct {
|
||||||
|
SModel string `mapstructure:"server.exe.exe-model" json:"server.exe.exe-model" yaml:"server.exe.exe-model"`
|
||||||
|
SRouter string `mapstructure:"server.exe.exe-router" json:"server.exe.exe-router" yaml:"server.exe.exe-router"`
|
||||||
|
Server string `mapstructure:"server.exe.exe" json:"server.exe.exe" yaml:"server.exe.exe"`
|
||||||
|
SApi string `mapstructure:"server.exe.exe-api" json:"server.exe.exe-api" yaml:"server.exe.exe-api"`
|
||||||
|
SPlug string `mapstructure:"server.exe.exe-plug" json:"server.exe.exe-plug" yaml:"server.exe.exe-plug"`
|
||||||
|
SInitialize string `mapstructure:"server.exe.exe-initialize" json:"server.exe.exe-initialize" yaml:"server.exe.exe-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.exe.exe-service" json:"server.exe.exe-service" yaml:"server.exe.exe-service"`
|
||||||
|
SRequest string `mapstructure:"server.exe.exe-request" json:"server.exe.exe-request" yaml:"server.exe.exe-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"`
|
||||||
|
}
|
9
config/captcha.go
Normal file
9
config/captcha.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Captcha struct {
|
||||||
|
KeyLong int `mapstructure:"key-long" json:"key-long" yaml:"key-long"` // 验证码长度
|
||||||
|
ImgWidth int `mapstructure:"img-width" json:"img-width" yaml:"img-width"` // 验证码宽度
|
||||||
|
ImgHeight int `mapstructure:"img-height" json:"img-height" yaml:"img-height"` // 验证码高度
|
||||||
|
OpenCaptcha int `mapstructure:"open-captcha" json:"open-captcha" yaml:"open-captcha"` // 防爆破验证码开启此数,0代表每次登录都需要验证码,其他数字代表错误密码此数,如3代表错误三次后出现验证码
|
||||||
|
OpenCaptchaTimeOut int `mapstructure:"open-captcha-timeout" json:"open-captcha-timeout" yaml:"open-captcha-timeout"` // 防爆破验证码超时时间,单位:s(秒)
|
||||||
|
}
|
34
config/config.go
Normal file
34
config/config.go
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
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"`
|
||||||
|
Email Email `mapstructure:"email" json:"email" yaml:"email"`
|
||||||
|
System System `mapstructure:"system" json:"system" yaml:"system"`
|
||||||
|
Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
|
||||||
|
// auto
|
||||||
|
AutoCode Autocode `mapstructure:"autocode" json:"autocode" yaml:"autocode"`
|
||||||
|
// gorm
|
||||||
|
Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
|
||||||
|
Mssql Mssql `mapstructure:"mssql" json:"mssql" yaml:"mssql"`
|
||||||
|
Pgsql Pgsql `mapstructure:"pgsql" json:"pgsql" yaml:"pgsql"`
|
||||||
|
Oracle Oracle `mapstructure:"oracle" json:"oracle" yaml:"oracle"`
|
||||||
|
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"`
|
||||||
|
|
||||||
|
Excel Excel `mapstructure:"excel" json:"excel" yaml:"excel"`
|
||||||
|
Timer Timer `mapstructure:"timer" json:"timer" yaml:"timer"`
|
||||||
|
|
||||||
|
// 跨域配置
|
||||||
|
Cors CORS `mapstructure:"cors" json:"cors" yaml:"cors"`
|
||||||
|
|
||||||
|
MiniApp MiniApp `mapstructure:"mini-app" json:"mini-app" yaml:"mini-app"`
|
||||||
|
}
|
14
config/cors.go
Normal file
14
config/cors.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type CORS struct {
|
||||||
|
Mode string `mapstructure:"mode" json:"mode" yaml:"mode"`
|
||||||
|
Whitelist []CORSWhitelist `mapstructure:"whitelist" json:"whitelist" yaml:"whitelist"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CORSWhitelist struct {
|
||||||
|
AllowOrigin string `mapstructure:"allow-origin" json:"allow-origin" yaml:"allow-origin"`
|
||||||
|
AllowMethods string `mapstructure:"allow-methods" json:"allow-methods" yaml:"allow-methods"`
|
||||||
|
AllowHeaders string `mapstructure:"allow-headers" json:"allow-headers" yaml:"allow-headers"`
|
||||||
|
ExposeHeaders string `mapstructure:"expose-headers" json:"expose-headers" yaml:"expose-headers"`
|
||||||
|
AllowCredentials bool `mapstructure:"allow-credentials" json:"allow-credentials" yaml:"allow-credentials"`
|
||||||
|
}
|
32
config/db_list.go
Normal file
32
config/db_list.go
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type DsnProvider interface {
|
||||||
|
Dsn() string
|
||||||
|
}
|
||||||
|
|
||||||
|
// Embeded 结构体可以压平到上一层,从而保持 config 文件的结构和原来一样
|
||||||
|
// 见 playground: https://go.dev/play/p/KIcuhqEoxmY
|
||||||
|
|
||||||
|
// 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
|
||||||
|
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表示开启
|
||||||
|
LogZap bool `mapstructure:"log-zap" json:"log-zap" yaml:"log-zap"` // 是否通过zap写入日志文件
|
||||||
|
}
|
||||||
|
|
||||||
|
type SpecializedDB struct {
|
||||||
|
Type string `mapstructure:"type" json:"type" yaml:"type"`
|
||||||
|
AliasName string `mapstructure:"alias-name" json:"alias-name" yaml:"alias-name"`
|
||||||
|
GeneralDB `yaml:",inline" mapstructure:",squash"`
|
||||||
|
Disable bool `mapstructure:"disable" json:"disable" yaml:"disable"`
|
||||||
|
}
|
11
config/email.go
Normal file
11
config/email.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Email struct {
|
||||||
|
To string `mapstructure:"to" json:"to" yaml:"to"` // 收件人:多个以英文逗号分隔 例:a@qq.com b@qq.com 正式开发中请把此项目作为参数使用
|
||||||
|
From string `mapstructure:"from" json:"from" yaml:"from"` // 发件人 你自己要发邮件的邮箱
|
||||||
|
Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址 例如 smtp.qq.com 请前往QQ或者你要发邮件的邮箱查看其smtp协议
|
||||||
|
Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // 密钥 用于登录的密钥 最好不要用邮箱密码 去邮箱smtp申请一个用于登录的密钥
|
||||||
|
Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称 发件人昵称 通常为自己的邮箱
|
||||||
|
Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 请前往QQ或者你要发邮件的邮箱查看其smtp协议 大多为 465
|
||||||
|
IsSSL bool `mapstructure:"is-ssl" json:"is-ssl" yaml:"is-ssl"` // 是否SSL 是否开启SSL
|
||||||
|
}
|
5
config/excel.go
Normal file
5
config/excel.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Excel struct {
|
||||||
|
Dir string `mapstructure:"dir" json:"dir" yaml:"dir"`
|
||||||
|
}
|
14
config/gorm_mssql.go
Normal file
14
config/gorm_mssql.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Mssql struct {
|
||||||
|
GeneralDB `yaml:",inline" mapstructure:",squash"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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
|
||||||
|
}
|
13
config/gorm_mysql.go
Normal file
13
config/gorm_mysql.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Mysql struct {
|
||||||
|
GeneralDB `yaml:",inline" mapstructure:",squash"`
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
14
config/gorm_oracle.go
Normal file
14
config/gorm_oracle.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Oracle struct {
|
||||||
|
GeneralDB `yaml:",inline" mapstructure:",squash"`
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
21
config/gorm_pgsql.go
Normal file
21
config/gorm_pgsql.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Pgsql struct {
|
||||||
|
GeneralDB `yaml:",inline" mapstructure:",squash"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dsn 基于配置文件获取 dsn
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
func (p *Pgsql) Dsn() string {
|
||||||
|
return "host=" + p.Path + " user=" + p.Username + " password=" + p.Password + " dbname=" + p.Dbname + " port=" + p.Port + " " + p.Config
|
||||||
|
}
|
||||||
|
|
||||||
|
// LinkDsn 根据 dbname 生成 dsn
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
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
|
||||||
|
}
|
17
config/gorm_sqlite.go
Normal file
17
config/gorm_sqlite.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Sqlite struct {
|
||||||
|
GeneralDB `yaml:",inline" mapstructure:",squash"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Sqlite) Dsn() string {
|
||||||
|
return filepath.Join(s.Path, s.Dbname+".db")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Sqlite) GetLogMode() string {
|
||||||
|
return s.LogMode
|
||||||
|
}
|
8
config/jwt.go
Normal file
8
config/jwt.go
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type JWT struct {
|
||||||
|
SigningKey string `mapstructure:"signing-key" json:"signing-key" yaml:"signing-key"` // jwt签名
|
||||||
|
ExpiresTime string `mapstructure:"expires-time" json:"expires-time" yaml:"expires-time"` // 过期时间
|
||||||
|
BufferTime string `mapstructure:"buffer-time" json:"buffer-time" yaml:"buffer-time"` // 缓冲时间
|
||||||
|
Issuer string `mapstructure:"issuer" json:"issuer" yaml:"issuer"` // 签发者
|
||||||
|
}
|
10
config/oss_aliyun.go
Normal file
10
config/oss_aliyun.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type AliyunOSS struct {
|
||||||
|
Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
|
||||||
|
AccessKeyId string `mapstructure:"access-key-id" json:"access-key-id" yaml:"access-key-id"`
|
||||||
|
AccessKeySecret string `mapstructure:"access-key-secret" json:"access-key-secret" yaml:"access-key-secret"`
|
||||||
|
BucketName string `mapstructure:"bucket-name" json:"bucket-name" yaml:"bucket-name"`
|
||||||
|
BucketUrl string `mapstructure:"bucket-url" json:"bucket-url" yaml:"bucket-url"`
|
||||||
|
BasePath string `mapstructure:"base-path" json:"base-path" yaml:"base-path"`
|
||||||
|
}
|
13
config/oss_aws.go
Normal file
13
config/oss_aws.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type AwsS3 struct {
|
||||||
|
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
|
||||||
|
Region string `mapstructure:"region" json:"region" yaml:"region"`
|
||||||
|
Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
|
||||||
|
SecretID string `mapstructure:"secret-id" json:"secret-id" yaml:"secret-id"`
|
||||||
|
SecretKey string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"`
|
||||||
|
BaseURL string `mapstructure:"base-url" json:"base-url" yaml:"base-url"`
|
||||||
|
PathPrefix string `mapstructure:"path-prefix" json:"path-prefix" yaml:"path-prefix"`
|
||||||
|
S3ForcePathStyle bool `mapstructure:"s3-force-path-style" json:"s3-force-path-style" yaml:"s3-force-path-style"`
|
||||||
|
DisableSSL bool `mapstructure:"disable-ssl" json:"disable-ssl" yaml:"disable-ssl"`
|
||||||
|
}
|
9
config/oss_huawei.go
Normal file
9
config/oss_huawei.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type HuaWeiObs struct {
|
||||||
|
Path string `mapstructure:"path" json:"path" yaml:"path"`
|
||||||
|
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
|
||||||
|
Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
|
||||||
|
AccessKey string `mapstructure:"access-key" json:"access-key" yaml:"access-key"`
|
||||||
|
SecretKey string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"`
|
||||||
|
}
|
6
config/oss_local.go
Normal file
6
config/oss_local.go
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Local struct {
|
||||||
|
Path string `mapstructure:"path" json:"path" yaml:"path"` // 本地文件访问路径
|
||||||
|
StorePath string `mapstructure:"store-path" json:"store-path" yaml:"store-path"` // 本地文件存储路径
|
||||||
|
}
|
11
config/oss_qiniu.go
Normal file
11
config/oss_qiniu.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type Qiniu struct {
|
||||||
|
Zone string `mapstructure:"zone" json:"zone" yaml:"zone"` // 存储区域
|
||||||
|
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` // 空间名称
|
||||||
|
ImgPath string `mapstructure:"img-path" json:"img-path" yaml:"img-path"` // CDN加速域名
|
||||||
|
AccessKey string `mapstructure:"access-key" json:"access-key" yaml:"access-key"` // 秘钥AK
|
||||||
|
SecretKey string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"` // 秘钥SK
|
||||||
|
UseHTTPS bool `mapstructure:"use-https" json:"use-https" yaml:"use-https"` // 是否使用https
|
||||||
|
UseCdnDomains bool `mapstructure:"use-cdn-domains" json:"use-cdn-domains" yaml:"use-cdn-domains"` // 上传是否使用CDN上传加速
|
||||||
|
}
|
10
config/oss_tencent.go
Normal file
10
config/oss_tencent.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type TencentCOS struct {
|
||||||
|
Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
|
||||||
|
Region string `mapstructure:"region" json:"region" yaml:"region"`
|
||||||
|
SecretID string `mapstructure:"secret-id" json:"secret-id" yaml:"secret-id"`
|
||||||
|
SecretKey string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"`
|
||||||
|
BaseURL string `mapstructure:"base-url" json:"base-url" yaml:"base-url"`
|
||||||
|
PathPrefix string `mapstructure:"path-prefix" json:"path-prefix" yaml:"path-prefix"`
|
||||||
|
}
|
7
config/redis.go
Normal file
7
config/redis.go
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
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的哪个数据库
|
||||||
|
}
|
13
config/system.go
Normal file
13
config/system.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
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"`
|
||||||
|
Addr int `mapstructure:"addr" json:"addr" yaml:"addr"` // 端口值
|
||||||
|
LimitCountIP int `mapstructure:"iplimit-count" json:"iplimit-count" yaml:"iplimit-count"`
|
||||||
|
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
|
||||||
|
}
|
15
config/timer.go
Normal file
15
config/timer.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
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"` // 时间间隔
|
||||||
|
}
|
23
config/wechat.go
Normal file
23
config/wechat.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
type MiniApp struct {
|
||||||
|
AppId string `mapstructure:"app-id" yaml:"app-id"`
|
||||||
|
AppSecret string `mapstructure:"app-secret" yaml:"app-secret"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 微信小程序配置
|
||||||
|
|
||||||
|
// 微信支付配置
|
||||||
|
type wechatPayConfig struct {
|
||||||
|
MchId string `mapstructure:"mchId" yaml:"mchId"` // 商户号
|
||||||
|
SerialNo string `mapstructure:"serialNo" yaml:"serialNo"` // 商户API证书的证书序列号
|
||||||
|
ApiV3Key string `mapstructure:"apiV3Key" yaml:"apiV3Key"` // 支付key
|
||||||
|
PrivateKey string `mapstructure:"privateKey" yaml:"privateKey"` // 支付私钥绝对路径
|
||||||
|
}
|
||||||
|
|
||||||
|
// api密钥配置
|
||||||
|
type CapiConfig struct {
|
||||||
|
AppId string `mapstructure:"app-id" yaml:"app-id"` // APP ID
|
||||||
|
SecretId string `mapstructure:"secret-id" yaml:"secret-id"` // Secret ID
|
||||||
|
SecretKey string `mapstructure:"secret-key" yaml:"secret-key"` // Secret Key
|
||||||
|
}
|
60
config/zap.go
Normal file
60
config/zap.go
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go.uber.org/zap/zapcore"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Zap struct {
|
||||||
|
Level string `mapstructure:"level" json:"level" yaml:"level"` // 级别
|
||||||
|
Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // 日志前缀
|
||||||
|
Format string `mapstructure:"format" json:"format" yaml:"format"` // 输出
|
||||||
|
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"` // 输出控制台
|
||||||
|
}
|
||||||
|
|
||||||
|
// ZapEncodeLevel 根据 EncodeLevel 返回 zapcore.LevelEncoder
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
func (z *Zap) ZapEncodeLevel() zapcore.LevelEncoder {
|
||||||
|
switch {
|
||||||
|
case z.EncodeLevel == "LowercaseLevelEncoder": // 小写编码器(默认)
|
||||||
|
return zapcore.LowercaseLevelEncoder
|
||||||
|
case z.EncodeLevel == "LowercaseColorLevelEncoder": // 小写编码器带颜色
|
||||||
|
return zapcore.LowercaseColorLevelEncoder
|
||||||
|
case z.EncodeLevel == "CapitalLevelEncoder": // 大写编码器
|
||||||
|
return zapcore.CapitalLevelEncoder
|
||||||
|
case z.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
|
||||||
|
}
|
||||||
|
}
|
9
core/internal/constant.go
Normal file
9
core/internal/constant.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package internal
|
||||||
|
|
||||||
|
const (
|
||||||
|
ConfigEnv = "GVA_CONFIG"
|
||||||
|
ConfigDefaultFile = "config.yaml"
|
||||||
|
ConfigTestFile = "config.test.yaml"
|
||||||
|
ConfigDebugFile = "config.debug.yaml"
|
||||||
|
ConfigReleaseFile = "config.release.yaml"
|
||||||
|
)
|
97
core/internal/cutter.go
Normal file
97
core/internal/cutter.go
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Cutter struct {
|
||||||
|
level string // 日志级别(debug, info, warn, error, dpanic, panic, fatal)
|
||||||
|
format string // 时间格式(2006-01-02)
|
||||||
|
Director string // 日志文件夹
|
||||||
|
file *os.File // 文件句柄
|
||||||
|
mutex *sync.RWMutex // 读写锁
|
||||||
|
}
|
||||||
|
|
||||||
|
type CutterOption func(*Cutter)
|
||||||
|
|
||||||
|
// WithCutterFormat 设置时间格式
|
||||||
|
func WithCutterFormat(format string) CutterOption {
|
||||||
|
return func(c *Cutter) {
|
||||||
|
c.format = format
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCutter(director string, level string, options ...CutterOption) *Cutter {
|
||||||
|
rotate := &Cutter{
|
||||||
|
level: level,
|
||||||
|
Director: director,
|
||||||
|
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()
|
||||||
|
}()
|
||||||
|
var business string
|
||||||
|
if strings.Contains(string(bytes), "business") {
|
||||||
|
var compile *regexp.Regexp
|
||||||
|
compile, err = regexp.Compile(`{"business": "([^,]+)"}`)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
if compile.Match(bytes) {
|
||||||
|
finds := compile.FindSubmatch(bytes)
|
||||||
|
business = string(finds[len(finds)-1])
|
||||||
|
bytes = compile.ReplaceAll(bytes, []byte(""))
|
||||||
|
}
|
||||||
|
compile, err = regexp.Compile(`"business": "([^,]+)"`)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
if compile.Match(bytes) {
|
||||||
|
finds := compile.FindSubmatch(bytes)
|
||||||
|
business = string(finds[len(finds)-1])
|
||||||
|
bytes = compile.ReplaceAll(bytes, []byte(""))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
format := time.Now().Format(c.format)
|
||||||
|
formats := make([]string, 0, 4)
|
||||||
|
formats = append(formats, c.Director)
|
||||||
|
if format != "" {
|
||||||
|
formats = append(formats, format)
|
||||||
|
}
|
||||||
|
if business != "" {
|
||||||
|
formats = append(formats, business)
|
||||||
|
}
|
||||||
|
formats = append(formats, c.level+".log")
|
||||||
|
filename := filepath.Join(formats...)
|
||||||
|
dirname := filepath.Dir(filename)
|
||||||
|
err = os.MkdirAll(dirname, 0755)
|
||||||
|
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)
|
||||||
|
}
|
21
core/internal/file_rotatelogs.go
Normal file
21
core/internal/file_rotatelogs.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go.uber.org/zap/zapcore"
|
||||||
|
"miniapp/global"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
var FileRotatelogs = new(fileRotatelogs)
|
||||||
|
|
||||||
|
type fileRotatelogs struct{}
|
||||||
|
|
||||||
|
// GetWriteSyncer 获取 zapcore.WriteSyncer
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
func (r *fileRotatelogs) GetWriteSyncer(level string) zapcore.WriteSyncer {
|
||||||
|
fileWriter := NewCutter(global.GVA_CONFIG.Zap.Director, level, WithCutterFormat("2006-01-02"))
|
||||||
|
if global.GVA_CONFIG.Zap.LogInConsole {
|
||||||
|
return zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), zapcore.AddSync(fileWriter))
|
||||||
|
}
|
||||||
|
return zapcore.AddSync(fileWriter)
|
||||||
|
}
|
101
core/internal/zap.go
Normal file
101
core/internal/zap.go
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"go.uber.org/zap/zapcore"
|
||||||
|
"miniapp/global"
|
||||||
|
"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 := FileRotatelogs.GetWriteSyncer(l.String()) // 日志分割
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
39
core/server.go
Normal file
39
core/server.go
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package core
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/initialize"
|
||||||
|
"miniapp/service/system"
|
||||||
|
)
|
||||||
|
|
||||||
|
type server interface {
|
||||||
|
ListenAndServe() error
|
||||||
|
}
|
||||||
|
|
||||||
|
func RunWindowsServer() {
|
||||||
|
if global.GVA_CONFIG.System.UseMultipoint || global.GVA_CONFIG.System.UseRedis {
|
||||||
|
// 初始化redis服务
|
||||||
|
initialize.Redis()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从db加载jwt数据
|
||||||
|
if global.GVA_DB != nil {
|
||||||
|
system.LoadAll()
|
||||||
|
}
|
||||||
|
|
||||||
|
Router := initialize.Routers()
|
||||||
|
Router.Static("/form-generator", "./resource/page")
|
||||||
|
|
||||||
|
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.exe.exe run success on ", zap.String("address", address))
|
||||||
|
|
||||||
|
global.GVA_LOG.Error(s.ListenAndServe().Error())
|
||||||
|
}
|
19
core/server_other.go
Normal file
19
core/server_other.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//go:build !windows
|
||||||
|
// +build !windows
|
||||||
|
|
||||||
|
package core
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/fvbock/endless"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func initServer(address string, router *gin.Engine) server {
|
||||||
|
s := endless.NewServer(address, router)
|
||||||
|
s.ReadHeaderTimeout = 20 * time.Second
|
||||||
|
s.WriteTimeout = 20 * time.Second
|
||||||
|
s.MaxHeaderBytes = 1 << 20
|
||||||
|
return s
|
||||||
|
}
|
21
core/server_win.go
Normal file
21
core/server_win.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
//go:build windows
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package core
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func initServer(address string, router *gin.Engine) server {
|
||||||
|
return &http.Server{
|
||||||
|
Addr: address,
|
||||||
|
Handler: router,
|
||||||
|
ReadTimeout: 20 * time.Second,
|
||||||
|
WriteTimeout: 20 * time.Second,
|
||||||
|
MaxHeaderBytes: 1 << 20,
|
||||||
|
}
|
||||||
|
}
|
74
core/viper.go
Normal file
74
core/viper.go
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
package core
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"miniapp/core/internal"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/fsnotify/fsnotify"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
|
"miniapp/global"
|
||||||
|
_ "miniapp/packfile"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Viper //
|
||||||
|
// 优先级: 命令行 > 环境变量 > 默认值
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
func Viper(path ...string) *viper.Viper {
|
||||||
|
var config string
|
||||||
|
|
||||||
|
if len(path) == 0 {
|
||||||
|
flag.StringVar(&config, "c", "", "choose config file.")
|
||||||
|
flag.Parse()
|
||||||
|
if config == "" { // 判断命令行参数是否为空
|
||||||
|
if configEnv := os.Getenv(internal.ConfigEnv); configEnv == "" { // 判断 internal.ConfigEnv 常量存储的环境变量是否为空
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
} else { // internal.ConfigEnv 常量存储的环境变量不为空 将值赋值于config
|
||||||
|
config = configEnv
|
||||||
|
fmt.Printf("您正在使用%s环境变量,config的路径为%s\n", internal.ConfigEnv, config)
|
||||||
|
}
|
||||||
|
} else { // 命令行参数不为空 将值赋值于config
|
||||||
|
fmt.Printf("您正在使用命令行的-c参数传递的值,config的路径为%s\n", config)
|
||||||
|
}
|
||||||
|
} else { // 函数传递的可变参数的第一个值赋值于config
|
||||||
|
config = path[0]
|
||||||
|
fmt.Printf("您正在使用func Viper()传递的值,config的路径为%s\n", config)
|
||||||
|
}
|
||||||
|
|
||||||
|
v := viper.New()
|
||||||
|
v.SetConfigFile(config)
|
||||||
|
v.SetConfigType("yaml")
|
||||||
|
err := v.ReadInConfig()
|
||||||
|
if err != nil {
|
||||||
|
panic(fmt.Errorf("Fatal error config file: %s \n", err))
|
||||||
|
}
|
||||||
|
v.WatchConfig()
|
||||||
|
|
||||||
|
v.OnConfigChange(func(e fsnotify.Event) {
|
||||||
|
fmt.Println("config file changed:", e.Name)
|
||||||
|
if err = v.Unmarshal(&global.GVA_CONFIG); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if err = v.Unmarshal(&global.GVA_CONFIG); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// root 适配性 根据root位置去找到对应迁移位置,保证root路径有效
|
||||||
|
global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..")
|
||||||
|
return v
|
||||||
|
}
|
28
core/zap.go
Normal file
28
core/zap.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package core
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"go.uber.org/zap/zapcore"
|
||||||
|
"miniapp/core/internal"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/utils"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Zap 获取 zap.Logger
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
func Zap() (logger *zap.Logger) {
|
||||||
|
if ok, _ := utils.PathExists(global.GVA_CONFIG.Zap.Director); !ok { // 判断是否有Director文件夹
|
||||||
|
fmt.Printf("create %v directory\n", global.GVA_CONFIG.Zap.Director)
|
||||||
|
_ = os.Mkdir(global.GVA_CONFIG.Zap.Director, os.ModePerm)
|
||||||
|
}
|
||||||
|
|
||||||
|
cores := internal.Zap.GetZapCores()
|
||||||
|
logger = zap.New(zapcore.NewTee(cores...))
|
||||||
|
|
||||||
|
if global.GVA_CONFIG.Zap.ShowLine {
|
||||||
|
logger = logger.WithOptions(zap.AddCaller())
|
||||||
|
}
|
||||||
|
return logger
|
||||||
|
}
|
6882
docs/docs.go
Normal file
6882
docs/docs.go
Normal file
File diff suppressed because it is too large
Load Diff
6916
docs/swagger.json
Normal file
6916
docs/swagger.json
Normal file
File diff suppressed because it is too large
Load Diff
4196
docs/swagger.yaml
Normal file
4196
docs/swagger.yaml
Normal file
File diff suppressed because it is too large
Load Diff
51
global/global.go
Normal file
51
global/global.go
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package global
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"github.com/songzhibin97/gkit/cache/local_cache"
|
||||||
|
"miniapp/utils/timer"
|
||||||
|
|
||||||
|
"golang.org/x/sync/singleflight"
|
||||||
|
|
||||||
|
"go.uber.org/zap"
|
||||||
|
|
||||||
|
"miniapp/config"
|
||||||
|
|
||||||
|
"github.com/redis/go-redis/v9"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
GVA_DB *gorm.DB
|
||||||
|
GVA_DBList map[string]*gorm.DB
|
||||||
|
GVA_REDIS *redis.Client
|
||||||
|
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
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetGlobalDBByDBName 通过名称获取db list中的db
|
||||||
|
func GetGlobalDBByDBName(dbname string) *gorm.DB {
|
||||||
|
lock.RLock()
|
||||||
|
defer lock.RUnlock()
|
||||||
|
return GVA_DBList[dbname]
|
||||||
|
}
|
||||||
|
|
||||||
|
// MustGetGlobalDBByDBName 通过名称获取db 如果不存在则panic
|
||||||
|
func MustGetGlobalDBByDBName(dbname string) *gorm.DB {
|
||||||
|
lock.RLock()
|
||||||
|
defer lock.RUnlock()
|
||||||
|
db, ok := GVA_DBList[dbname]
|
||||||
|
if !ok || db == nil {
|
||||||
|
panic("db no init")
|
||||||
|
}
|
||||||
|
return db
|
||||||
|
}
|
14
global/model.go
Normal file
14
global/model.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package global
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GVA_MODEL struct {
|
||||||
|
ID uint `gorm:"primarykey"` // 主键ID
|
||||||
|
CreatedAt time.Time // 创建时间
|
||||||
|
UpdatedAt time.Time // 更新时间
|
||||||
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间
|
||||||
|
}
|
145
go.mod
Normal file
145
go.mod
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
module miniapp
|
||||||
|
|
||||||
|
go 1.20
|
||||||
|
|
||||||
|
require (
|
||||||
|
git.echol.cn/loser/logger v1.0.15
|
||||||
|
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/gorm-adapter/v3 v3.18.0
|
||||||
|
github.com/duke-git/lancet/v2 v2.2.7
|
||||||
|
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-oauth2/oauth2/v4 v4.5.2
|
||||||
|
github.com/go-oauth2/redis/v4 v4.1.1
|
||||||
|
github.com/go-redis/redis/v8 v8.11.4
|
||||||
|
github.com/go-sql-driver/mysql v1.7.1
|
||||||
|
github.com/gofrs/uuid/v5 v5.0.0
|
||||||
|
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||||
|
github.com/google/uuid v1.3.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/medivhzhan/weapp/v3 v3.6.19
|
||||||
|
github.com/mojocn/base64Captcha v1.3.5
|
||||||
|
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/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/tencentyun/cos-go-sdk-v5 v0.7.42
|
||||||
|
github.com/unrolled/secure v1.13.0
|
||||||
|
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
|
||||||
|
gorm.io/driver/sqlserver v1.5.1
|
||||||
|
gorm.io/gorm v1.25.2
|
||||||
|
nhooyr.io/websocket v1.8.7
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
|
||||||
|
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||||
|
github.com/bytedance/sonic v1.9.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/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||||
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
|
github.com/fatih/color v1.15.0 // 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-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-jwt/jwt v3.2.1+incompatible // 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/google/go-querystring v1.0.0 // 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/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/josharian/intern v1.0.0 // indirect
|
||||||
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
|
github.com/klauspost/compress v1.15.0 // indirect
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
|
||||||
|
github.com/leodido/go-urn v1.2.4 // 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
|
||||||
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
|
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||||
|
github.com/microsoft/go-mssqldb v1.1.0 // indirect
|
||||||
|
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/mozillazg/go-httpheader v0.2.1 // indirect
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.8 // 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/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/tidwall/btree v0.0.0-20191029221954-400434d76274 // indirect
|
||||||
|
github.com/tidwall/buntdb v1.1.2 // indirect
|
||||||
|
github.com/tidwall/gjson v1.12.1 // indirect
|
||||||
|
github.com/tidwall/grect v0.0.0-20161006141115-ba9a043346eb // indirect
|
||||||
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
|
github.com/tidwall/rtree v0.0.0-20180113144539-6cd427091e0e // indirect
|
||||||
|
github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563 // 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/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // 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
|
||||||
|
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/time v0.1.0 // indirect
|
||||||
|
golang.org/x/tools v0.9.1 // indirect
|
||||||
|
google.golang.org/protobuf v1.30.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
|
||||||
|
modernc.org/libc v1.24.1 // indirect
|
||||||
|
modernc.org/mathutil v1.5.0 // indirect
|
||||||
|
modernc.org/memory v1.6.0 // indirect
|
||||||
|
modernc.org/sqlite v1.23.0 // indirect
|
||||||
|
)
|
997
go.sum
Normal file
997
go.sum
Normal file
@ -0,0 +1,997 @@
|
|||||||
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||||
|
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||||
|
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||||
|
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||||
|
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||||
|
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||||
|
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||||
|
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
||||||
|
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||||
|
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
||||||
|
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
|
||||||
|
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
||||||
|
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
||||||
|
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||||
|
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||||
|
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||||
|
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
|
||||||
|
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||||
|
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||||
|
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||||
|
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||||
|
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||||
|
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||||
|
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||||
|
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||||
|
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||||
|
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||||
|
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||||
|
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
|
||||||
|
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||||
|
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||||
|
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||||
|
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||||
|
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=
|
||||||
|
git.echol.cn/loser/logger v1.0.15 h1:paD2Lz4WzNKs1QezLbavqdxo+/zb9cW0YRQ7/mSglgo=
|
||||||
|
git.echol.cn/loser/logger v1.0.15/go.mod h1:tc96/GAMirPcVTT/Rs6qPXrnGq9buiAR0cyL37j4ZuA=
|
||||||
|
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=
|
||||||
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o=
|
||||||
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
|
github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
|
||||||
|
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/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||||
|
github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM=
|
||||||
|
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
|
||||||
|
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
|
||||||
|
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.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
|
||||||
|
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.0.0/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
|
||||||
|
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
|
||||||
|
github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=
|
||||||
|
github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
|
||||||
|
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/gorm-adapter/v3 v3.18.0 h1:0td7v030eK3H5ftXRHx1d5wVPbuYEJP2ObMSUHtA0Ek=
|
||||||
|
github.com/casbin/gorm-adapter/v3 v3.18.0/go.mod h1:ekufPNBgVIQvv9JffVGsg7KUv4DjnevTh6AQnBNkoK8=
|
||||||
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
|
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||||
|
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
|
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||||
|
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
|
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
|
||||||
|
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
|
||||||
|
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
|
||||||
|
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||||
|
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||||
|
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||||
|
github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I=
|
||||||
|
github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng=
|
||||||
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
|
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/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=
|
||||||
|
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||||
|
github.com/dgryski/go-rendezvous v0.0.0-20200609043717-5ab96a526299/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||||
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||||
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||||
|
github.com/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/duke-git/lancet/v2 v2.2.7 h1:u9zr6HR+MDUvZEtTlAFtSTIgZfEFsN7cKi27n5weZsw=
|
||||||
|
github.com/duke-git/lancet/v2 v2.2.7/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc=
|
||||||
|
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=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
|
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
|
||||||
|
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
||||||
|
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
||||||
|
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
|
||||||
|
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||||
|
miniapp v0.0.0-20231010105746-b3dbb8d4be1f h1:sbAmzjFAivP+AJI8GK4hE/5XS99uW1BoVNRgN6TVbtM=
|
||||||
|
miniapp v0.0.0-20231010105746-b3dbb8d4be1f/go.mod h1:+F/ve48KKaHY2PUejjziInYtC7VKMafUrd7KomJuw5c=
|
||||||
|
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/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
|
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||||
|
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=
|
||||||
|
github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6/go.mod h1:YxOVT5+yHzKvwhsiSIWmbAYM3Dr9AEEbER2dVayfBkg=
|
||||||
|
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/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8=
|
||||||
|
github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
|
||||||
|
github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4=
|
||||||
|
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=
|
||||||
|
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
|
||||||
|
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
|
||||||
|
github.com/glebarez/go-sqlite v1.21.1 h1:7MZyUPh2XTrHS7xNEHQbrhfMZuPSzhkm2A1qgg0y5NY=
|
||||||
|
github.com/glebarez/go-sqlite v1.21.1/go.mod h1:ISs8MF6yk5cL4n/43rSOmVMGJJjHYr7L2MbZZ5Q4E2E=
|
||||||
|
github.com/glebarez/sqlite v1.8.0 h1:02X12E2I/4C1n+v90yTqrjRa8yuo7c3KeHI3FRznCvc=
|
||||||
|
github.com/glebarez/sqlite v1.8.0/go.mod h1:bpET16h1za2KOOMb8+jCp6UBP/iahDpfPQqSaYLTLx8=
|
||||||
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
|
github.com/go-oauth2/oauth2/v4 v4.1.0/go.mod h1:+rsyi0o/ZbSfhL/3Xr/sAtL4brS+IdGj86PHVlPjE+4=
|
||||||
|
github.com/go-oauth2/oauth2/v4 v4.5.2 h1:CuZhD3lhGuI6aNLyUbRHXsgG2RwGRBOuCBfd4WQKqBQ=
|
||||||
|
github.com/go-oauth2/oauth2/v4 v4.5.2/go.mod h1:wk/2uLImWIa9VVQDgxz99H2GDbhmfi/9/Xr+GvkSUSQ=
|
||||||
|
github.com/go-oauth2/redis/v4 v4.1.1 h1:uYLGPbAEZ3tb2Qg+BHzrtMHbJ7NeX6S9Ol0+iYyBF5E=
|
||||||
|
github.com/go-oauth2/redis/v4 v4.1.1/go.mod h1:cYNT5bLEwCnrFXqSbWDvxXzfTaF/fKMf1XoRVFwBPrc=
|
||||||
|
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-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/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=
|
||||||
|
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
||||||
|
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.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
|
||||||
|
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
|
||||||
|
github.com/go-redis/redis/v8 v8.0.0-beta.5/go.mod h1:Mm9EH/5UMRx680UIryN6rd5XFn/L7zORPqLV+1D5thQ=
|
||||||
|
github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg=
|
||||||
|
github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w=
|
||||||
|
github.com/go-session/session v3.1.2+incompatible/go.mod h1:8B3iivBQjrz/JtC68Np2T1yBBLxTan3mn/3OM0CyRt0=
|
||||||
|
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-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||||
|
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=
|
||||||
|
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||||
|
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
|
||||||
|
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||||
|
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
|
||||||
|
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||||
|
github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M=
|
||||||
|
github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
|
||||||
|
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
|
||||||
|
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||||
|
github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||||
|
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
||||||
|
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||||
|
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA=
|
||||||
|
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||||
|
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
|
||||||
|
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
|
||||||
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
|
||||||
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||||
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
|
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||||
|
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
|
||||||
|
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||||
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||||
|
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||||
|
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||||
|
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||||
|
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.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
|
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=
|
||||||
|
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
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=
|
||||||
|
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
|
||||||
|
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||||
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
|
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
|
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
|
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
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/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=
|
||||||
|
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||||
|
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
|
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
|
||||||
|
github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0=
|
||||||
|
github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w=
|
||||||
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
||||||
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
|
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
|
||||||
|
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
|
||||||
|
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
|
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||||
|
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
|
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=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||||
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
|
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.8+incompatible h1:3kDd8PIWAdU+qGs/+0QUgsMI2ZSiJPt45Xn0su+x/Q0=
|
||||||
|
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.8+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s=
|
||||||
|
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
|
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
|
github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=
|
||||||
|
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
|
||||||
|
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/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=
|
||||||
|
github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg=
|
||||||
|
github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs=
|
||||||
|
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.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=
|
||||||
|
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||||
|
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/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=
|
||||||
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
|
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
|
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
|
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||||
|
github.com/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/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||||
|
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||||
|
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
|
||||||
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
|
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
|
github.com/klauspost/compress v1.10.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
|
github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
|
github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U=
|
||||||
|
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||||
|
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/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/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||||
|
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/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
|
||||||
|
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-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
|
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||||
|
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||||
|
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||||
|
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
|
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/medivhzhan/weapp/v3 v3.6.19 h1:SXY1H1AdX4RvRyuCTb5+sJxEMisyoxHLL87aIwuos/g=
|
||||||
|
github.com/medivhzhan/weapp/v3 v3.6.19/go.mod h1:DBlnuMNGIcDYSDaM8JnBIT14I+OqMaMNm9QU8HvhhMU=
|
||||||
|
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=
|
||||||
|
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||||
|
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
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/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||||
|
github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=
|
||||||
|
github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
|
||||||
|
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/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||||
|
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||||
|
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||||
|
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||||
|
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||||
|
github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0=
|
||||||
|
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
|
||||||
|
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
|
||||||
|
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||||
|
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||||
|
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||||
|
github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c=
|
||||||
|
github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||||
|
github.com/opentracing/opentracing-go v1.1.1-0.20190913142402-a7454ce5950e/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||||
|
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=
|
||||||
|
github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
|
||||||
|
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
|
||||||
|
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/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=
|
||||||
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
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/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/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/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/sashabaranov/go-openai v1.14.1 h1:jqfkdj8XHnBF84oi2aNtT8Ktp3EJ0MfuVjvcMkfI0LA=
|
||||||
|
github.com/sashabaranov/go-openai v1.14.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
|
||||||
|
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
|
||||||
|
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||||
|
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
|
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=
|
||||||
|
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
|
||||||
|
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
|
||||||
|
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
|
||||||
|
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||||
|
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||||
|
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||||
|
github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=
|
||||||
|
github.com/songzhibin97/gkit v1.2.11 h1:O8+l6eLMrZ2yNbT6Vohc6ggWnH5zt4P8/3ZEkf8jUL4=
|
||||||
|
github.com/songzhibin97/gkit v1.2.11/go.mod h1:axjYsiJWnn/kf/uGiUr9JPHRlt2CQrqfq/fPZ3xIY+M=
|
||||||
|
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
|
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
|
||||||
|
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
|
||||||
|
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
|
||||||
|
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
|
||||||
|
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||||
|
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||||
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/spf13/viper v1.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/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=
|
||||||
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
|
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||||
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
|
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
|
||||||
|
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
|
||||||
|
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/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/tidwall/btree v0.0.0-20191029221954-400434d76274 h1:G6Z6HvJuPjG6XfNGi/feOATzeJrfgTNJY+rGrHbA04E=
|
||||||
|
github.com/tidwall/btree v0.0.0-20191029221954-400434d76274/go.mod h1:huei1BkDWJ3/sLXmO+bsCNELL+Bp2Kks9OLyQFkzvA8=
|
||||||
|
github.com/tidwall/buntdb v1.1.2 h1:noCrqQXL9EKMtcdwJcmuVKSEjqu1ua99RHHgbLTEHRo=
|
||||||
|
github.com/tidwall/buntdb v1.1.2/go.mod h1:xAzi36Hir4FarpSHyfuZ6JzPJdjRZ8QlLZSntE2mqlI=
|
||||||
|
github.com/tidwall/gjson v1.3.4/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
|
||||||
|
github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
|
||||||
|
github.com/tidwall/gjson v1.12.1 h1:ikuZsLdhr8Ws0IdROXUS1Gi4v9Z4pGqpX/CvJkxvfpo=
|
||||||
|
github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
|
github.com/tidwall/grect v0.0.0-20161006141115-ba9a043346eb h1:5NSYaAdrnblKByzd7XByQEJVT8+9v0W/tIY0Oo4OwrE=
|
||||||
|
github.com/tidwall/grect v0.0.0-20161006141115-ba9a043346eb/go.mod h1:lKYYLFIr9OIgdgrtgkZ9zgRxRdvPYsExnYBsEAd8W5M=
|
||||||
|
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
|
||||||
|
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||||
|
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||||
|
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||||
|
github.com/tidwall/pretty v1.0.1/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||||
|
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
||||||
|
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||||
|
github.com/tidwall/rtree v0.0.0-20180113144539-6cd427091e0e h1:+NL1GDIUOKxVfbp2KoJQD9cTQ6dyP2co9q4yzmT9FZo=
|
||||||
|
github.com/tidwall/rtree v0.0.0-20180113144539-6cd427091e0e/go.mod h1:/h+UnNGt0IhNNJLkGikcdcJqm66zGD/uJGMRxK/9+Ao=
|
||||||
|
github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563 h1:Otn9S136ELckZ3KKDyCkxapfufrqDqwmGjcHfAyXRrE=
|
||||||
|
github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563/go.mod h1:mLqSmt7Dv/CNneF2wfcChfN1rvapyQr01LGKnKex0DQ=
|
||||||
|
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=
|
||||||
|
github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4=
|
||||||
|
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||||
|
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||||
|
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||||
|
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/unrolled/secure v1.13.0 h1:sdr3Phw2+f8Px8HE5sd1EHdj1aV3yUwed/uZXChLFsk=
|
||||||
|
github.com/unrolled/secure v1.13.0/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40=
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
|
github.com/valyala/fasthttp v1.14.0/go.mod h1:ol1PCaL0dX20wC0htZ7sYCsvCYmrouYra0zHzaclZhE=
|
||||||
|
github.com/valyala/fasthttp v1.34.0 h1:d3AAQJ2DRcxJYHm7OXNXtXt2as1vMDfxeIcFvhmGGm4=
|
||||||
|
github.com/valyala/fasthttp v1.34.0/go.mod h1:epZA5N+7pY6ZaEKRmstzOuYJx9HI8DI1oaCGZpdH4h0=
|
||||||
|
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
|
||||||
|
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||||
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
|
||||||
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||||
|
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
|
||||||
|
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||||
|
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/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY=
|
||||||
|
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
|
||||||
|
github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
|
||||||
|
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
|
||||||
|
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
|
||||||
|
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
|
||||||
|
github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
|
||||||
|
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=
|
||||||
|
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
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.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=
|
||||||
|
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||||
|
go.opentelemetry.io/otel v0.6.0/go.mod h1:jzBIgIzK43Iu1BpDAXwqOd6UPsSAk+ewVZ5ofSXw4Ek=
|
||||||
|
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/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
|
||||||
|
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=
|
||||||
|
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
|
||||||
|
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=
|
||||||
|
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=
|
||||||
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
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-20220214200702-86341886e292/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/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=
|
||||||
|
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||||
|
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||||
|
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
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/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=
|
||||||
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||||
|
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||||
|
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||||
|
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||||
|
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||||
|
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
|
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
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/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||||
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
|
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
|
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||||
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
|
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/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=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
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-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/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/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=
|
||||||
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.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/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/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=
|
||||||
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
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.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/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=
|
||||||
|
golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA=
|
||||||
|
golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
|
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
|
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||||
|
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
|
||||||
|
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
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/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||||
|
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||||
|
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||||
|
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||||
|
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||||
|
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||||
|
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||||
|
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
||||||
|
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
||||||
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||||
|
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||||
|
google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
||||||
|
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||||
|
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||||
|
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||||
|
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
|
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||||
|
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||||
|
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||||
|
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
||||||
|
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||||
|
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||||
|
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||||
|
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||||
|
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||||
|
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||||
|
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||||
|
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||||
|
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.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
|
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=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-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=
|
||||||
|
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||||
|
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||||
|
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU=
|
||||||
|
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
|
||||||
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||||
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||||
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
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/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/sqlserver v1.5.1 h1:wpyW/pR26U94uaujltiFGXY7fd2Jw5hC9PB1ZF/Y5s4=
|
||||||
|
gorm.io/driver/sqlserver v1.5.1/go.mod h1:AYHzzte2msKTmYBYsSIq8ZUsznLJwBdkB2wpI+kt0nM=
|
||||||
|
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=
|
||||||
|
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=
|
||||||
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||||
|
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
|
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
|
modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM=
|
||||||
|
modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak=
|
||||||
|
modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
|
||||||
|
modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||||
|
modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o=
|
||||||
|
modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
|
||||||
|
modernc.org/sqlite v1.23.0 h1:MWTFBI5H1WLnXpNBh/BTruBVqzzoh28DA0iOnlkkRaM=
|
||||||
|
modernc.org/sqlite v1.23.0/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk=
|
||||||
|
nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
|
||||||
|
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
|
||||||
|
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
|
||||||
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
|
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||||
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||||
|
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
36
initialize/db_list.go
Normal file
36
initialize/db_list.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"miniapp/config"
|
||||||
|
"miniapp/global"
|
||||||
|
)
|
||||||
|
|
||||||
|
const sys = "system"
|
||||||
|
|
||||||
|
func DBList() {
|
||||||
|
dbMap := make(map[string]*gorm.DB)
|
||||||
|
for _, info := range global.GVA_CONFIG.DBList {
|
||||||
|
if info.Disable {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch info.Type {
|
||||||
|
case "mysql":
|
||||||
|
dbMap[info.AliasName] = GormMysqlByConfig(config.Mysql{GeneralDB: info.GeneralDB})
|
||||||
|
case "mssql":
|
||||||
|
dbMap[info.AliasName] = GormMssqlByConfig(config.Mssql{GeneralDB: info.GeneralDB})
|
||||||
|
case "pgsql":
|
||||||
|
dbMap[info.AliasName] = GormPgSqlByConfig(config.Pgsql{GeneralDB: info.GeneralDB})
|
||||||
|
case "oracle":
|
||||||
|
dbMap[info.AliasName] = GormOracleByConfig(config.Oracle{GeneralDB: info.GeneralDB})
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 做特殊判断,是否有迁移
|
||||||
|
// 适配低版本迁移多数据库版本
|
||||||
|
if sysDB, ok := dbMap[sys]; ok {
|
||||||
|
global.GVA_DB = sysDB
|
||||||
|
}
|
||||||
|
global.GVA_DBList = dbMap
|
||||||
|
}
|
100
initialize/ensure_tables.go
Normal file
100
initialize/ensure_tables.go
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
adapter "github.com/casbin/gorm-adapter/v3"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"miniapp/model/example"
|
||||||
|
sysModel "miniapp/model/system"
|
||||||
|
"miniapp/service/system"
|
||||||
|
)
|
||||||
|
|
||||||
|
const initOrderEnsureTables = system.InitOrderExternal - 1
|
||||||
|
|
||||||
|
type ensureTables struct{}
|
||||||
|
|
||||||
|
// auto run
|
||||||
|
func init() {
|
||||||
|
system.RegisterInit(initOrderEnsureTables, &ensureTables{})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ensureTables) InitializerName() string {
|
||||||
|
return "ensure_tables_created"
|
||||||
|
}
|
||||||
|
func (e *ensureTables) InitializeData(ctx context.Context) (next context.Context, err error) {
|
||||||
|
return ctx, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *ensureTables) DataInserted(ctx context.Context) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *ensureTables) MigrateTable(ctx context.Context) (context.Context, error) {
|
||||||
|
db, ok := ctx.Value("db").(*gorm.DB)
|
||||||
|
if !ok {
|
||||||
|
return ctx, system.ErrMissingDBContext
|
||||||
|
}
|
||||||
|
tables := []interface{}{
|
||||||
|
sysModel.SysApi{},
|
||||||
|
sysModel.SysUser{},
|
||||||
|
sysModel.SysBaseMenu{},
|
||||||
|
sysModel.SysAuthority{},
|
||||||
|
sysModel.JwtBlacklist{},
|
||||||
|
sysModel.SysDictionary{},
|
||||||
|
sysModel.SysAutoCodeHistory{},
|
||||||
|
sysModel.SysOperationRecord{},
|
||||||
|
sysModel.SysDictionaryDetail{},
|
||||||
|
sysModel.SysBaseMenuParameter{},
|
||||||
|
sysModel.SysBaseMenuBtn{},
|
||||||
|
sysModel.SysAuthorityBtn{},
|
||||||
|
sysModel.SysAutoCode{},
|
||||||
|
sysModel.SysChatGptOption{},
|
||||||
|
|
||||||
|
adapter.CasbinRule{},
|
||||||
|
|
||||||
|
example.ExaFile{},
|
||||||
|
example.ExaCustomer{},
|
||||||
|
example.ExaFileChunk{},
|
||||||
|
example.ExaFileUploadAndDownload{},
|
||||||
|
}
|
||||||
|
for _, t := range tables {
|
||||||
|
_ = db.AutoMigrate(&t)
|
||||||
|
// 视图 authority_menu 会被当成表来创建,引发冲突错误(更新版本的gorm似乎不会)
|
||||||
|
// 由于 AutoMigrate() 基本无需考虑错误,因此显式忽略
|
||||||
|
}
|
||||||
|
return ctx, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *ensureTables) TableCreated(ctx context.Context) bool {
|
||||||
|
db, ok := ctx.Value("db").(*gorm.DB)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
tables := []interface{}{
|
||||||
|
sysModel.SysApi{},
|
||||||
|
sysModel.SysUser{},
|
||||||
|
sysModel.SysBaseMenu{},
|
||||||
|
sysModel.SysAuthority{},
|
||||||
|
sysModel.JwtBlacklist{},
|
||||||
|
sysModel.SysDictionary{},
|
||||||
|
sysModel.SysAutoCodeHistory{},
|
||||||
|
sysModel.SysOperationRecord{},
|
||||||
|
sysModel.SysDictionaryDetail{},
|
||||||
|
sysModel.SysBaseMenuParameter{},
|
||||||
|
sysModel.SysBaseMenuBtn{},
|
||||||
|
sysModel.SysAuthorityBtn{},
|
||||||
|
sysModel.SysAutoCode{},
|
||||||
|
sysModel.SysChatGptOption{},
|
||||||
|
adapter.CasbinRule{},
|
||||||
|
|
||||||
|
example.ExaFile{},
|
||||||
|
example.ExaCustomer{},
|
||||||
|
example.ExaFileChunk{},
|
||||||
|
example.ExaFileUploadAndDownload{},
|
||||||
|
}
|
||||||
|
yes := true
|
||||||
|
for _, t := range tables {
|
||||||
|
yes = yes && db.Migrator().HasTable(t)
|
||||||
|
}
|
||||||
|
return yes
|
||||||
|
}
|
78
initialize/gorm.go
Normal file
78
initialize/gorm.go
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"miniapp/model/app"
|
||||||
|
"miniapp/model/common"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/model/example"
|
||||||
|
"miniapp/model/system"
|
||||||
|
|
||||||
|
"go.uber.org/zap"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Gorm 初始化数据库并产生数据库全局变量
|
||||||
|
// Author SliverHorn
|
||||||
|
func Gorm() *gorm.DB {
|
||||||
|
switch global.GVA_CONFIG.System.DbType {
|
||||||
|
case "mysql":
|
||||||
|
return GormMysql()
|
||||||
|
case "pgsql":
|
||||||
|
return GormPgSql()
|
||||||
|
case "oracle":
|
||||||
|
return GormOracle()
|
||||||
|
case "mssql":
|
||||||
|
return GormMssql()
|
||||||
|
case "sqlite":
|
||||||
|
return GormSqlite()
|
||||||
|
default:
|
||||||
|
return GormMysql()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterTables 注册数据库表专用
|
||||||
|
// Author SliverHorn
|
||||||
|
func RegisterTables() {
|
||||||
|
db := global.GVA_DB
|
||||||
|
err := db.AutoMigrate(
|
||||||
|
// 系统模块表
|
||||||
|
system.SysApi{},
|
||||||
|
system.SysUser{},
|
||||||
|
system.SysBaseMenu{},
|
||||||
|
system.JwtBlacklist{},
|
||||||
|
system.SysAuthority{},
|
||||||
|
system.SysDictionary{},
|
||||||
|
system.SysOperationRecord{},
|
||||||
|
system.SysAutoCodeHistory{},
|
||||||
|
system.SysDictionaryDetail{},
|
||||||
|
system.SysBaseMenuParameter{},
|
||||||
|
system.SysBaseMenuBtn{},
|
||||||
|
system.SysAuthorityBtn{},
|
||||||
|
system.SysAutoCode{},
|
||||||
|
system.SysChatGptOption{},
|
||||||
|
|
||||||
|
example.ExaFile{},
|
||||||
|
example.ExaCustomer{},
|
||||||
|
example.ExaFileChunk{},
|
||||||
|
example.ExaFileUploadAndDownload{},
|
||||||
|
|
||||||
|
app.User{},
|
||||||
|
app.OAuth2Client{},
|
||||||
|
app.Favorite{},
|
||||||
|
app.Vision{},
|
||||||
|
|
||||||
|
common.Hospital{},
|
||||||
|
common.Notes{},
|
||||||
|
common.Todos{},
|
||||||
|
common.Article{},
|
||||||
|
common.Banner{},
|
||||||
|
common.UserTodo{},
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("register table failed", zap.Error(err))
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
global.GVA_LOG.Info("register table success")
|
||||||
|
}
|
59
initialize/gorm_mssql.go
Normal file
59
initialize/gorm_mssql.go
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* @Author: 逆光飞翔 191180776@qq.com
|
||||||
|
* @Date: 2022-12-08 17:25:49
|
||||||
|
* @LastEditors: 逆光飞翔 191180776@qq.com
|
||||||
|
* @LastEditTime: 2022-12-08 18:00:00
|
||||||
|
* @FilePath: \server.exe.exe\initialize\gorm_mssql.go
|
||||||
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
*/
|
||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/driver/sqlserver"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"miniapp/config"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/initialize/internal"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GormMssql 初始化Mssql数据库
|
||||||
|
// Author [LouisZhang](191180776@qq.com)
|
||||||
|
func GormMssql() *gorm.DB {
|
||||||
|
m := global.GVA_CONFIG.Mssql
|
||||||
|
if m.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
mssqlConfig := sqlserver.Config{
|
||||||
|
DSN: m.Dsn(), // DSN data source name
|
||||||
|
DefaultStringSize: 191, // string 类型字段的默认长度
|
||||||
|
}
|
||||||
|
if db, err := gorm.Open(sqlserver.New(mssqlConfig), internal.Gorm.Config(m.Prefix, m.Singular)); err != nil {
|
||||||
|
return nil
|
||||||
|
} else {
|
||||||
|
db.InstanceSet("gorm:table_options", "ENGINE="+m.Engine)
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(m.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(m.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GormMssqlByConfig 初始化Mysql数据库用过传入配置
|
||||||
|
func GormMssqlByConfig(m config.Mssql) *gorm.DB {
|
||||||
|
if m.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
mssqlConfig := sqlserver.Config{
|
||||||
|
DSN: m.Dsn(), // DSN data source name
|
||||||
|
DefaultStringSize: 191, // string 类型字段的默认长度
|
||||||
|
}
|
||||||
|
if db, err := gorm.Open(sqlserver.New(mssqlConfig), internal.Gorm.Config(m.Prefix, m.Singular)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
db.InstanceSet("gorm:table_options", "ENGINE=InnoDB")
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(m.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(m.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
55
initialize/gorm_mysql.go
Normal file
55
initialize/gorm_mysql.go
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "github.com/go-sql-driver/mysql"
|
||||||
|
"gorm.io/driver/mysql"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"miniapp/config"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/initialize/internal"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GormMysql 初始化Mysql数据库
|
||||||
|
// Author [piexlmax](https://github.com/piexlmax)
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
func GormMysql() *gorm.DB {
|
||||||
|
m := global.GVA_CONFIG.Mysql
|
||||||
|
if m.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
mysqlConfig := mysql.Config{
|
||||||
|
DSN: m.Dsn(), // DSN data source name
|
||||||
|
DefaultStringSize: 191, // string 类型字段的默认长度
|
||||||
|
SkipInitializeWithVersion: false, // 根据版本自动配置
|
||||||
|
}
|
||||||
|
if db, err := gorm.Open(mysql.New(mysqlConfig), internal.Gorm.Config(m.Prefix, m.Singular)); err != nil {
|
||||||
|
return nil
|
||||||
|
} else {
|
||||||
|
db.InstanceSet("gorm:table_options", "ENGINE="+m.Engine)
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(m.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(m.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GormMysqlByConfig 初始化Mysql数据库用过传入配置
|
||||||
|
func GormMysqlByConfig(m config.Mysql) *gorm.DB {
|
||||||
|
if m.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
mysqlConfig := mysql.Config{
|
||||||
|
DSN: m.Dsn(), // DSN data source name
|
||||||
|
DefaultStringSize: 191, // string 类型字段的默认长度
|
||||||
|
SkipInitializeWithVersion: false, // 根据版本自动配置
|
||||||
|
}
|
||||||
|
if db, err := gorm.Open(mysql.New(mysqlConfig), internal.Gorm.Config(m.Prefix, m.Singular)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
db.InstanceSet("gorm:table_options", "ENGINE=InnoDB")
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(m.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(m.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
52
initialize/gorm_oracle.go
Normal file
52
initialize/gorm_oracle.go
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
//"github.com/dzwvip/oracle"
|
||||||
|
"miniapp/config"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/initialize/internal"
|
||||||
|
|
||||||
|
//_ "github.com/godror/godror"
|
||||||
|
"gorm.io/driver/mysql"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GormOracle 初始化oracle数据库
|
||||||
|
// 如果需要Oracle库 放开import里的注释 把下方 mysql.Config 改为 oracle.Config ; mysql.New 改为 oracle.New
|
||||||
|
func GormOracle() *gorm.DB {
|
||||||
|
m := global.GVA_CONFIG.Oracle
|
||||||
|
if m.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
oracleConfig := mysql.Config{
|
||||||
|
DSN: m.Dsn(), // DSN data source name
|
||||||
|
DefaultStringSize: 191, // string 类型字段的默认长度
|
||||||
|
}
|
||||||
|
if db, err := gorm.Open(mysql.New(oracleConfig), internal.Gorm.Config(m.Prefix, m.Singular)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(m.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(m.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GormOracleByConfig 初始化Oracle数据库用过传入配置
|
||||||
|
func GormOracleByConfig(m config.Oracle) *gorm.DB {
|
||||||
|
if m.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
oracleConfig := mysql.Config{
|
||||||
|
DSN: m.Dsn(), // DSN data source name
|
||||||
|
DefaultStringSize: 191, // string 类型字段的默认长度
|
||||||
|
}
|
||||||
|
if db, err := gorm.Open(mysql.New(oracleConfig), internal.Gorm.Config(m.Prefix, m.Singular)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(m.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(m.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
50
initialize/gorm_pgsql.go
Normal file
50
initialize/gorm_pgsql.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/driver/postgres"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"miniapp/config"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/initialize/internal"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GormPgSql 初始化 Postgresql 数据库
|
||||||
|
// Author [piexlmax](https://github.com/piexlmax)
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
func GormPgSql() *gorm.DB {
|
||||||
|
p := global.GVA_CONFIG.Pgsql
|
||||||
|
if p.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
pgsqlConfig := postgres.Config{
|
||||||
|
DSN: p.Dsn(), // DSN data source name
|
||||||
|
PreferSimpleProtocol: false,
|
||||||
|
}
|
||||||
|
if db, err := gorm.Open(postgres.New(pgsqlConfig), internal.Gorm.Config(p.Prefix, p.Singular)); err != nil {
|
||||||
|
return nil
|
||||||
|
} else {
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(p.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(p.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GormPgSqlByConfig 初始化 Postgresql 数据库 通过参数
|
||||||
|
func GormPgSqlByConfig(p config.Pgsql) *gorm.DB {
|
||||||
|
if p.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
pgsqlConfig := postgres.Config{
|
||||||
|
DSN: p.Dsn(), // DSN data source name
|
||||||
|
PreferSimpleProtocol: false,
|
||||||
|
}
|
||||||
|
if db, err := gorm.Open(postgres.New(pgsqlConfig), internal.Gorm.Config(p.Prefix, p.Singular)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(p.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(p.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
42
initialize/gorm_sqlite.go
Normal file
42
initialize/gorm_sqlite.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/glebarez/sqlite"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"miniapp/config"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/initialize/internal"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GormSqlite 初始化Sqlite数据库
|
||||||
|
func GormSqlite() *gorm.DB {
|
||||||
|
s := global.GVA_CONFIG.Sqlite
|
||||||
|
if s.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if db, err := gorm.Open(sqlite.Open(s.Dsn()), internal.Gorm.Config(s.Prefix, s.Singular)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(s.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(s.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GormSqliteByConfig 初始化Sqlite数据库用过传入配置
|
||||||
|
func GormSqliteByConfig(s config.Sqlite) *gorm.DB {
|
||||||
|
if s.Dbname == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if db, err := gorm.Open(sqlite.Open(s.Dsn()), internal.Gorm.Config(s.Prefix, s.Singular)); err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
sqlDB, _ := db.DB()
|
||||||
|
sqlDB.SetMaxIdleConns(s.MaxIdleConns)
|
||||||
|
sqlDB.SetMaxOpenConns(s.MaxOpenConns)
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
}
|
62
initialize/internal/gorm.go
Normal file
62
initialize/internal/gorm.go
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm/schema"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"gorm.io/gorm/logger"
|
||||||
|
"miniapp/global"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DBBASE interface {
|
||||||
|
GetLogMode() string
|
||||||
|
}
|
||||||
|
|
||||||
|
var Gorm = new(_gorm)
|
||||||
|
|
||||||
|
type _gorm struct{}
|
||||||
|
|
||||||
|
// Config gorm 自定义配置
|
||||||
|
// Author [SliverHorn](https://github.com/SliverHorn)
|
||||||
|
func (g *_gorm) Config(prefix string, singular bool) *gorm.Config {
|
||||||
|
config := &gorm.Config{
|
||||||
|
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
|
||||||
|
}
|
35
initialize/internal/logger.go
Normal file
35
initialize/internal/logger.go
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"gorm.io/gorm/logger"
|
||||||
|
"miniapp/global"
|
||||||
|
)
|
||||||
|
|
||||||
|
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...)
|
||||||
|
}
|
||||||
|
}
|
23
initialize/other.go
Normal file
23
initialize/other.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/songzhibin97/gkit/cache/local_cache"
|
||||||
|
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
func OtherInit() {
|
||||||
|
dr, err := utils.ParseDuration(global.GVA_CONFIG.JWT.ExpiresTime)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
_, err = utils.ParseDuration(global.GVA_CONFIG.JWT.BufferTime)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
global.BlackCache = local_cache.NewCache(
|
||||||
|
local_cache.SetDefaultExpire(dr),
|
||||||
|
)
|
||||||
|
}
|
36
initialize/plugin.go
Normal file
36
initialize/plugin.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/middleware"
|
||||||
|
"miniapp/plugin/email"
|
||||||
|
"miniapp/utils/plugin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func PluginInit(group *gin.RouterGroup, Plugin ...plugin.Plugin) {
|
||||||
|
for i := range Plugin {
|
||||||
|
PluginGroup := group.Group(Plugin[i].RouterPath())
|
||||||
|
Plugin[i].Register(PluginGroup)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
))
|
||||||
|
}
|
26
initialize/redis.go
Normal file
26
initialize/redis.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"miniapp/global"
|
||||||
|
|
||||||
|
"github.com/redis/go-redis/v9"
|
||||||
|
"go.uber.org/zap"
|
||||||
|
)
|
||||||
|
|
||||||
|
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
|
||||||
|
})
|
||||||
|
pong, err := client.Ping(context.Background()).Result()
|
||||||
|
if err != nil {
|
||||||
|
global.GVA_LOG.Error("redis connect ping failed, err:", zap.Error(err))
|
||||||
|
} else {
|
||||||
|
global.GVA_LOG.Info("redis connect ping response:", zap.String("pong", pong))
|
||||||
|
global.GVA_REDIS = client
|
||||||
|
}
|
||||||
|
}
|
10
initialize/register_init.go
Normal file
10
initialize/register_init.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "miniapp/source/example"
|
||||||
|
_ "miniapp/source/system"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// do nothing,only import source package so that inits can be registered
|
||||||
|
}
|
90
initialize/router.go
Normal file
90
initialize/router.go
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
swaggerFiles "github.com/swaggo/files"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
ginSwagger "github.com/swaggo/gin-swagger"
|
||||||
|
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/middleware"
|
||||||
|
"miniapp/router"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 初始化总路由
|
||||||
|
|
||||||
|
func Routers() *gin.Engine {
|
||||||
|
Router := gin.Default()
|
||||||
|
InstallPlugin(Router) // 安装插件
|
||||||
|
systemRouter := router.RouterGroupApp.System
|
||||||
|
exampleRouter := router.RouterGroupApp.Example
|
||||||
|
appRouter := router.RouterGroupApp.App
|
||||||
|
// 如果想要不使用nginx代理前端网页,可以修改 web/.env.production 下的
|
||||||
|
// VUE_APP_BASE_API = /
|
||||||
|
// VUE_APP_BASE_PATH = http://localhost
|
||||||
|
// 然后执行打包命令 npm run build。在打开下面3行注释
|
||||||
|
// Router.Static("/favicon.ico", "./dist/favicon.ico")
|
||||||
|
// 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.exe.exe.go 将启动模式 更变为 Router.RunTLS("端口","你的cre/pem文件","你的key文件")
|
||||||
|
// 跨域,如需跨域可以打开下面的注释
|
||||||
|
// Router.Use(middleware.Cors()) // 直接放行全部跨域请求
|
||||||
|
// Router.Use(middleware.CorsByRules()) // 按照配置的规则放行跨域请求
|
||||||
|
//global.GVA_LOG.Info("use middleware cors")
|
||||||
|
|
||||||
|
Router.GET(global.GVA_CONFIG.System.RouterPrefix+"/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
||||||
|
global.GVA_LOG.Info("register swagger handler")
|
||||||
|
// 方便统一添加路由组前缀 多服务器上线使用
|
||||||
|
|
||||||
|
PublicGroup := Router.Group(global.GVA_CONFIG.System.RouterPrefix)
|
||||||
|
{
|
||||||
|
// 健康监测
|
||||||
|
PublicGroup.GET("/health", func(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusOK, "ok")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
{
|
||||||
|
systemRouter.InitBaseRouter(PublicGroup) // 注册基础功能路由 不做鉴权
|
||||||
|
systemRouter.InitInitRouter(PublicGroup) // 自动初始化相关
|
||||||
|
}
|
||||||
|
//用户端路由 无需鉴权
|
||||||
|
{
|
||||||
|
appRouter.InitLoginRouter(PublicGroup) // 登陆路由
|
||||||
|
appRouter.InitUserRouter(PublicGroup) // 注册用户路由
|
||||||
|
appRouter.InitFavoriteRouter(PublicGroup) // 收藏路由
|
||||||
|
appRouter.InitVisionRouter(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接口
|
||||||
|
|
||||||
|
exampleRouter.InitCustomerRouter(PrivateGroup) // 客户路由
|
||||||
|
exampleRouter.InitFileUploadAndDownloadRouter(PrivateGroup) // 文件上传下载功能路由
|
||||||
|
|
||||||
|
systemRouter.InitHospitalRouter(PublicGroup) // 医院路由
|
||||||
|
systemRouter.InitBannerRouter(PublicGroup) // banner路由
|
||||||
|
systemRouter.InitArticleRouter(PublicGroup) // 文章路由
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
global.GVA_LOG.Info("router register success")
|
||||||
|
return Router
|
||||||
|
}
|
33
initialize/timer.go
Normal file
33
initialize/timer.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/robfig/cron/v3"
|
||||||
|
|
||||||
|
"miniapp/config"
|
||||||
|
"miniapp/global"
|
||||||
|
"miniapp/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])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
initialize/validator.go
Normal file
22
initialize/validator.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package initialize
|
||||||
|
|
||||||
|
import "miniapp/utils"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
_ = utils.RegisterRule("PageVerify",
|
||||||
|
utils.Rules{
|
||||||
|
"Page": {utils.NotEmpty()},
|
||||||
|
"PageSize": {utils.NotEmpty()},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
_ = utils.RegisterRule("IdVerify",
|
||||||
|
utils.Rules{
|
||||||
|
"Id": {utils.NotEmpty()},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
_ = utils.RegisterRule("AuthorityIdVerify",
|
||||||
|
utils.Rules{
|
||||||
|
"AuthorityId": {utils.NotEmpty()},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
60
log/2023-10-11/error.log
Normal file
60
log/2023-10-11/error.log
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
[miniapp]2023/10/11 - 12:17:48.633 [31merror[0m C:/Users/Administrator/Desktop/server/api/v1/system/sys_user.go:56 登陆失败! 用户名不存在或者密码错误! {"error": "db not init"}
|
||||||
|
[miniapp]2023/10/11 - 12:49:14.470 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 12:49:32.985 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 14:32:21.261 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 14:32:27.921 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 15:44:36.062 [31merror[0m C:/Users/Administrator/Desktop/server/utils/upload/aliyun_oss.go:36 function formUploader.Put() Failed {"err": "oss: service returned error: StatusCode=400, ErrorCode=InvalidObjectName, ErrorMessage=\"The specified object is not valid.\", RequestId=652652648915C63137533C77, Ec=0016-00000005"}
|
||||||
|
[miniapp]2023/10/11 - 15:45:18.933 [31merror[0m C:/Users/Administrator/Desktop/server/utils/upload/aliyun_oss.go:36 function formUploader.Put() Failed {"err": "oss: service returned error: StatusCode=400, ErrorCode=InvalidObjectName, ErrorMessage=\"The specified object is not valid.\", RequestId=6526528FB6896C32324B0C23, Ec=0016-00000005"}
|
||||||
|
[miniapp]2023/10/11 - 21:30:35.072 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 21:30:35.762 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 21:30:35.765 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 21:49:13.118 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 21:49:14.248 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 21:49:14.250 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 21:51:29.980 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 21:51:29.985 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 21:54:28.032 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 21:54:28.659 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 21:54:28.661 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 21:57:19.306 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 21:57:19.306 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 21:57:19.308 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 22:03:03.529 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 22:03:49.141 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 22:03:49.777 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 22:03:49.780 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 22:04:26.159 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 22:04:26.818 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 22:04:26.820 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 22:08:39.077 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 22:08:45.745 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 22:08:45.745 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 22:08:45.745 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 22:08:45.748 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 22:08:45.749 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 22:08:46.369 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 22:08:46.371 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 22:11:23.107 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 22:11:23.110 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 22:13:36.214 [31merror[0m C:/Users/Administrator/Desktop/server/utils/clamis.go:15 从Gin的Context中获取从jwt解析信息失败, 请检查请求头是否存在x-token且claims是否为规定结构
|
||||||
|
[miniapp]2023/10/11 - 22:13:36.216 [31merror[0m C:/Users/Administrator/Desktop/server/middleware/operation.go:123 create operation record error: {"error": "Error 1406 (22001): Data too long for column 'agent' at row 1"}
|
||||||
|
[miniapp]2023/10/11 - 22:14:59.957 [31merror[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:70 register table failed {"error": "Error 1069 (42000): Too many keys specified; max 64 keys allowed"}
|
||||||
|
[miniapp]2023/10/11 - 22:15:41.382 [31merror[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:70 register table failed {"error": "Error 1069 (42000): Too many keys specified; max 64 keys allowed"}
|
||||||
|
[miniapp]2023/10/11 - 22:36:29.260 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 清理失败,跳过清理
|
||||||
|
[miniapp]2023/10/11 - 22:36:29.261 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: context canceled
|
||||||
|
[miniapp]2023/10/11 - 22:41:42.786 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 22:47:14.886 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:00:58.398 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 23:00:59.633 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 23:00:59.633 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 获取用户基础账号信息失败: 未知的用户身份类型
|
||||||
|
[miniapp]2023/10/11 - 23:01:00.334 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:01:14.971 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:01:25.497 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:04:12.045 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:15:08.506 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:15:16.620 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:17:51.189 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:18:17.252 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:18:51.753 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:19:55.688 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
||||||
|
[miniapp]2023/10/11 - 23:24:59.675 [31merror[0m D:/GOPATH/pkg/mod/git.echol.cn/loser/logger@v1.0.15/log/say.go:65 收到未定义的登录错误: Client authentication failed
|
95
log/2023-10-11/info.log
Normal file
95
log/2023-10-11/info.log
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
[miniapp]2023/10/11 - 12:17:24.308 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:44 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:17:24.316 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:81 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:17:24.318 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:17:59.631 [34minfo[0m C:/Users/Administrator/Desktop/server/api/v1/system/sys_initdb.go:57 前往初始化数据库
|
||||||
|
[miniapp]2023/10/11 - 12:22:36.247 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:22:36.248 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:22:36.249 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:44 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:22:36.249 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:81 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:22:36.257 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:26:26.104 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:26:26.105 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:26:26.106 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:44 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:26:26.106 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:81 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:26:26.120 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:28:21.674 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/api/v1/system/sys_initdb.go:57 数据库无需初始化
|
||||||
|
[miniapp]2023/10/11 - 12:28:42.802 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/api/v1/system/sys_initdb.go:57 数据库无需初始化
|
||||||
|
[miniapp]2023/10/11 - 12:29:07.498 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:29:07.505 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:44 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:29:07.505 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:81 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:29:07.515 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:29:15.197 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/api/v1/system/sys_initdb.go:57 前往初始化数据库
|
||||||
|
[miniapp]2023/10/11 - 12:31:44.363 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:31:44.365 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:31:44.365 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:44 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:31:44.366 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:81 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:31:44.380 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:36:28.127 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:36:28.128 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:36:28.128 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:44 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:36:28.129 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/initialize/router.go:81 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:36:28.139 [34minfo[0m D:/GOPATH/pkg/mod/miniapp@v0.0.0-20231010105746-b3dbb8d4be1f/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:40:59.510 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:41:36.502 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:41:36.504 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:41:36.505 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:41:36.505 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:85 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:41:36.518 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:47:37.733 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:47:37.735 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:47:37.736 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:47:37.736 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:85 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:47:37.745 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:48:02.622 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:48:02.624 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:48:02.625 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:48:02.626 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:85 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:48:02.633 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:48:47.654 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:48:47.659 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:48:47.660 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:48:47.660 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:85 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:48:47.676 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 12:51:25.617 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 12:51:25.619 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 12:51:25.620 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 12:51:25.621 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:85 router register success
|
||||||
|
[miniapp]2023/10/11 - 12:51:25.631 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 14:46:18.358 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 14:46:18.361 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 14:46:18.362 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 14:47:00.201 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:63 register table success
|
||||||
|
[miniapp]2023/10/11 - 14:47:00.204 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 14:47:00.205 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 14:47:00.205 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:86 router register success
|
||||||
|
[miniapp]2023/10/11 - 14:47:00.219 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 14:53:02.134 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:73 register table success
|
||||||
|
[miniapp]2023/10/11 - 14:53:02.137 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 14:53:02.137 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 14:53:02.138 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:86 router register success
|
||||||
|
[miniapp]2023/10/11 - 14:53:02.150 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 15:00:11.005 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:73 register table success
|
||||||
|
[miniapp]2023/10/11 - 15:00:11.008 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 15:00:11.008 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 15:00:11.009 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:86 router register success
|
||||||
|
[miniapp]2023/10/11 - 15:00:11.023 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 15:41:43.799 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:73 register table success
|
||||||
|
[miniapp]2023/10/11 - 15:41:43.802 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 15:41:43.802 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 15:41:43.803 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:86 router register success
|
||||||
|
[miniapp]2023/10/11 - 15:41:43.814 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 22:16:48.448 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:73 register table success
|
||||||
|
[miniapp]2023/10/11 - 22:16:48.451 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 22:16:48.451 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 22:16:48.452 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:86 router register success
|
||||||
|
[miniapp]2023/10/11 - 22:16:48.456 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 23:23:50.878 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:73 register table success
|
||||||
|
[miniapp]2023/10/11 - 23:23:50.880 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 23:23:50.881 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 23:23:50.881 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:86 router register success
|
||||||
|
[miniapp]2023/10/11 - 23:23:50.890 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
||||||
|
[miniapp]2023/10/11 - 23:24:18.312 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/gorm.go:73 register table success
|
||||||
|
[miniapp]2023/10/11 - 23:24:18.315 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/redis.go:23 redis connect ping response: {"pong": "PONG"}
|
||||||
|
[miniapp]2023/10/11 - 23:24:18.315 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:39 register swagger handler
|
||||||
|
[miniapp]2023/10/11 - 23:24:18.316 [34minfo[0m C:/Users/Administrator/Desktop/server/initialize/router.go:86 router register success
|
||||||
|
[miniapp]2023/10/11 - 23:24:18.321 [34minfo[0m C:/Users/Administrator/Desktop/server/core/server.go:36 server run success on {"address": ":8888"}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user