未验证 提交 1ecd5803 编写于 作者: Mr.奇淼('s avatar Mr.奇淼( 提交者: GitHub

Merge branch 'master' into master

......@@ -78,7 +78,7 @@ func (autoCodeExampleApi *AutoCodeExampleApi) UpdateAutoCodeExample(c *gin.Conte
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body autocode.AutoCodeExample true "用id查询AutoCodeExample"
// @Param data query autocode.AutoCodeExample true "用id查询AutoCodeExample"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /autoCodeExample/findAutoCodeExample [get]
func (autoCodeExampleApi *AutoCodeExampleApi) FindAutoCodeExample(c *gin.Context) {
......@@ -101,7 +101,7 @@ func (autoCodeExampleApi *AutoCodeExampleApi) FindAutoCodeExample(c *gin.Context
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body autocodeReq.AutoCodeExampleSearch true "页码, 每页大小, 搜索条件"
// @Param data query autocodeReq.AutoCodeExampleSearch true "页码, 每页大小, 搜索条件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /autoCodeExample/getAutoCodeExampleList [get]
func (autoCodeExampleApi *AutoCodeExampleApi) GetAutoCodeExampleList(c *gin.Context) {
......
......@@ -94,7 +94,7 @@ func (e *CustomerApi) UpdateExaCustomer(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body example.ExaCustomer true "客户ID"
// @Param data query example.ExaCustomer true "客户ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/customer [get]
func (e *CustomerApi) GetExaCustomer(c *gin.Context) {
......@@ -118,7 +118,7 @@ func (e *CustomerApi) GetExaCustomer(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Param data query request.PageInfo true "页码, 每页大小"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/customerList [get]
func (e *CustomerApi) GetExaCustomerList(c *gin.Context) {
......
......@@ -10,7 +10,7 @@ import (
)
// 当开启多服务器部署时,替换下面的配置,使用redis共享存储验证码
// var store = captcha.NewDefaultRedisStore()
//var store = captcha.NewDefaultRedisStore()
var store = base64Captcha.DefaultMemStore
type BaseApi struct {
......@@ -27,6 +27,7 @@ func (b *BaseApi) Captcha(c *gin.Context) {
// 字符,公式,验证码配置
// 生成默认数字的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)
if id, b64s, err := cp.Generate(); err != nil {
global.GVA_LOG.Error("验证码获取失败!", zap.Any("err", err))
......
......@@ -75,7 +75,7 @@ func (s *DictionaryApi) UpdateSysDictionary(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysDictionary true "ID或字典英名"
// @Param data query system.SysDictionary true "ID或字典英名"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /sysDictionary/findSysDictionary [get]
func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
......@@ -94,7 +94,7 @@ func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SysDictionarySearch true "页码, 每页大小, 搜索条件"
// @Param data query request.SysDictionarySearch true "页码, 每页大小, 搜索条件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /sysDictionary/getSysDictionaryList [get]
func (s *DictionaryApi) GetSysDictionaryList(c *gin.Context) {
......
......@@ -75,7 +75,7 @@ func (s *DictionaryDetailApi) UpdateSysDictionaryDetail(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysDictionaryDetail true "用id查询SysDictionaryDetail"
// @Param data query system.SysDictionaryDetail true "用id查询SysDictionaryDetail"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /sysDictionaryDetail/findSysDictionaryDetail [get]
func (s *DictionaryDetailApi) FindSysDictionaryDetail(c *gin.Context) {
......@@ -98,7 +98,7 @@ func (s *DictionaryDetailApi) FindSysDictionaryDetail(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SysDictionaryDetailSearch true "页码, 每页大小, 搜索条件"
// @Param data query request.SysDictionaryDetailSearch true "页码, 每页大小, 搜索条件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /sysDictionaryDetail/getSysDictionaryDetailList [get]
func (s *DictionaryDetailApi) GetSysDictionaryDetailList(c *gin.Context) {
......
......@@ -76,7 +76,7 @@ func (s *OperationRecordApi) DeleteSysOperationRecordByIds(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysOperationRecord true "Id"
// @Param data query system.SysOperationRecord true "Id"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /sysOperationRecord/findSysOperationRecord [get]
func (s *OperationRecordApi) FindSysOperationRecord(c *gin.Context) {
......@@ -99,7 +99,7 @@ func (s *OperationRecordApi) FindSysOperationRecord(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SysOperationRecordSearch true "页码, 每页大小, 搜索条件"
// @Param data query request.SysOperationRecordSearch true "页码, 每页大小, 搜索条件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /sysOperationRecord/getSysOperationRecordList [get]
func (s *OperationRecordApi) GetSysOperationRecordList(c *gin.Context) {
......
......@@ -14,7 +14,7 @@ import (
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"github.com/go-redis/redis"
"github.com/go-redis/redis/v8"
"go.uber.org/zap"
)
......
此差异已折叠。
此差异已折叠。
......@@ -387,27 +387,6 @@ definitions:
$ref: '#/definitions/system.SysBaseMenu'
type: array
type: object
request.AutoCodeExampleSearch:
properties:
autoCodeExampleField:
description: 展示值
type: string
createdAt:
description: 创建时间
type: string
id:
description: 主键ID
type: integer
page:
description: 页码
type: integer
pageSize:
description: 每页大小
type: integer
updatedAt:
description: 更新时间
type: string
type: object
request.AutoHistoryByID:
properties:
id:
......@@ -588,123 +567,6 @@ definitions:
description: 每页大小
type: integer
type: object
request.SysDictionaryDetailSearch:
properties:
createdAt:
description: 创建时间
type: string
id:
description: 主键ID
type: integer
label:
description: 展示值
type: string
page:
description: 页码
type: integer
pageSize:
description: 每页大小
type: integer
sort:
description: 排序标记
type: integer
status:
description: 启用状态
type: boolean
sysDictionaryID:
description: 关联标记
type: integer
updatedAt:
description: 更新时间
type: string
value:
description: 字典值
type: integer
type: object
request.SysDictionarySearch:
properties:
createdAt:
description: 创建时间
type: string
desc:
description: 描述
type: string
id:
description: 主键ID
type: integer
name:
description: 字典名(中)
type: string
page:
description: 页码
type: integer
pageSize:
description: 每页大小
type: integer
status:
description: 状态
type: boolean
sysDictionaryDetails:
items:
$ref: '#/definitions/system.SysDictionaryDetail'
type: array
type:
description: 字典名(英)
type: string
updatedAt:
description: 更新时间
type: string
type: object
request.SysOperationRecordSearch:
properties:
agent:
description: 代理
type: string
body:
description: 请求Body
type: string
createdAt:
description: 创建时间
type: string
error_message:
description: 错误信息
type: string
id:
description: 主键ID
type: integer
ip:
description: 请求ip
type: string
latency:
description: 延迟
type: string
method:
description: 请求方法
type: string
page:
description: 页码
type: integer
pageSize:
description: 每页大小
type: integer
path:
description: 请求路径
type: string
resp:
description: 响应Body
type: string
status:
description: 请求状态
type: integer
updatedAt:
description: 更新时间
type: string
user:
$ref: '#/definitions/system.SysUser'
user_id:
description: 用户id
type: integer
type: object
response.SysAuthorityCopyResponse:
properties:
authority:
......@@ -1659,12 +1521,22 @@ paths:
consumes:
- application/json
parameters:
- description: 用id查询AutoCodeExample
in: body
name: data
required: true
schema:
$ref: '#/definitions/autocode.AutoCodeExample'
- description: 展示值
in: query
name: autoCodeExampleField
type: string
- description: 创建时间
in: query
name: createdAt
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 更新时间
in: query
name: updatedAt
type: string
produces:
- application/json
responses:
......@@ -1682,12 +1554,30 @@ paths:
consumes:
- application/json
parameters:
- description: 页码, 每页大小, 搜索条件
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.AutoCodeExampleSearch'
- description: 展示值
in: query
name: autoCodeExampleField
type: string
- description: 创建时间
in: query
name: createdAt
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 页码
in: query
name: page
type: integer
- description: 每页大小
in: query
name: pageSize
type: integer
- description: 更新时间
in: query
name: updatedAt
type: string
produces:
- application/json
responses:
......@@ -1831,12 +1721,34 @@ paths:
consumes:
- application/json
parameters:
- description: 客户ID
in: body
name: data
required: true
schema:
$ref: '#/definitions/example.ExaCustomer'
- description: 创建时间
in: query
name: createdAt
type: string
- description: 客户名
in: query
name: customerName
type: string
- description: 客户手机号
in: query
name: customerPhoneData
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 管理角色ID
in: query
name: sysUserAuthorityID
type: string
- description: 管理ID
in: query
name: sysUserId
type: integer
- description: 更新时间
in: query
name: updatedAt
type: string
produces:
- application/json
responses:
......@@ -1898,12 +1810,14 @@ paths:
consumes:
- application/json
parameters:
- description: 页码, 每页大小
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.PageInfo'
- description: 页码
in: query
name: page
type: integer
- description: 每页大小
in: query
name: pageSize
type: integer
produces:
- application/json
responses:
......@@ -2438,12 +2352,34 @@ paths:
consumes:
- application/json
parameters:
- description: ID或字典英名
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.SysDictionary'
- description: 创建时间
in: query
name: createdAt
type: string
- description: 描述
in: query
name: desc
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 字典名(中)
in: query
name: name
type: string
- description: 状态
in: query
name: status
type: boolean
- description: 字典名(英)
in: query
name: type
type: string
- description: 更新时间
in: query
name: updatedAt
type: string
produces:
- application/json
responses:
......@@ -2461,12 +2397,42 @@ paths:
consumes:
- application/json
parameters:
- description: 页码, 每页大小, 搜索条件
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.SysDictionarySearch'
- description: 创建时间
in: query
name: createdAt
type: string
- description: 描述
in: query
name: desc
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 字典名(中)
in: query
name: name
type: string
- description: 页码
in: query
name: page
type: integer
- description: 每页大小
in: query
name: pageSize
type: integer
- description: 状态
in: query
name: status
type: boolean
- description: 字典名(英)
in: query
name: type
type: string
- description: 更新时间
in: query
name: updatedAt
type: string
produces:
- application/json
responses:
......@@ -2553,12 +2519,38 @@ paths:
consumes:
- application/json
parameters:
- description: 用id查询SysDictionaryDetail
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.SysDictionaryDetail'
- description: 创建时间
in: query
name: createdAt
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 展示值
in: query
name: label
type: string
- description: 排序标记
in: query
name: sort
type: integer
- description: 启用状态
in: query
name: status
type: boolean
- description: 关联标记
in: query
name: sysDictionaryID
type: integer
- description: 更新时间
in: query
name: updatedAt
type: string
- description: 字典值
in: query
name: value
type: integer
produces:
- application/json
responses:
......@@ -2576,12 +2568,46 @@ paths:
consumes:
- application/json
parameters:
- description: 页码, 每页大小, 搜索条件
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.SysDictionaryDetailSearch'
- description: 创建时间
in: query
name: createdAt
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 展示值
in: query
name: label
type: string
- description: 页码
in: query
name: page
type: integer
- description: 每页大小
in: query
name: pageSize
type: integer
- description: 排序标记
in: query
name: sort
type: integer
- description: 启用状态
in: query
name: status
type: boolean
- description: 关联标记
in: query
name: sysDictionaryID
type: integer
- description: 更新时间
in: query
name: updatedAt
type: string
- description: 字典值
in: query
name: value
type: integer
produces:
- application/json
responses:
......@@ -2691,12 +2717,58 @@ paths:
consumes:
- application/json
parameters:
- description: Id
in: body
name: data
required: true
schema:
$ref: '#/definitions/system.SysOperationRecord'
- description: 代理
in: query
name: agent
type: string
- description: 请求Body
in: query
name: body
type: string
- description: 创建时间
in: query
name: createdAt
type: string
- description: 错误信息
in: query
name: error_message
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 请求ip
in: query
name: ip
type: string
- description: 延迟
in: query
name: latency
type: string
- description: 请求方法
in: query
name: method
type: string
- description: 请求路径
in: query
name: path
type: string
- description: 响应Body
in: query
name: resp
type: string
- description: 请求状态
in: query
name: status
type: integer
- description: 更新时间
in: query
name: updatedAt
type: string
- description: 用户id
in: query
name: user_id
type: integer
produces:
- application/json
responses:
......@@ -2714,12 +2786,66 @@ paths:
consumes:
- application/json
parameters:
- description: 页码, 每页大小, 搜索条件
in: body
name: data
required: true
schema:
$ref: '#/definitions/request.SysOperationRecordSearch'
- description: 代理
in: query
name: agent
type: string
- description: 请求Body
in: query
name: body
type: string
- description: 创建时间
in: query
name: createdAt
type: string
- description: 错误信息
in: query
name: error_message
type: string
- description: 主键ID
in: query
name: id
type: integer
- description: 请求ip
in: query
name: ip
type: string
- description: 延迟
in: query
name: latency
type: string
- description: 请求方法
in: query
name: method
type: string
- description: 页码
in: query
name: page
type: integer
- description: 每页大小
in: query
name: pageSize
type: integer
- description: 请求路径
in: query
name: path
type: string
- description: 响应Body
in: query
name: resp
type: string
- description: 请求状态
in: query
name: status
type: integer
- description: 更新时间
in: query
name: updatedAt
type: string
- description: 用户id
in: query
name: user_id
type: integer
produces:
- application/json
responses:
......
......@@ -10,7 +10,6 @@ require (
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
github.com/casbin/casbin/v2 v2.11.0
github.com/casbin/gorm-adapter/v3 v3.0.2
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/fsnotify/fsnotify v1.4.9
......@@ -37,7 +36,6 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/qiniu/api.v7/v7 v7.4.1
github.com/robfig/cron/v3 v3.0.1
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/satori/go.uuid v1.2.0
github.com/shirou/gopsutil v3.21.1+incompatible
github.com/spf13/afero v1.2.2 // indirect
......
......@@ -103,7 +103,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Con
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body autocode.{{.StructName}} true "用id查询{{.StructName}}"
// @Param data query autocode.{{.StructName}} true "用id查询{{.StructName}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /{{.Abbreviation}}/find{{.StructName}} [get]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Context) {
......@@ -123,7 +123,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Conte
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body autocodeReq.{{.StructName}}Search true "分页获取{{.StructName}}列表"
// @Param data query autocodeReq.{{.StructName}}Search true "分页获取{{.StructName}}列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /{{.Abbreviation}}/get{{.StructName}}List [get]
func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Context) {
......
......@@ -69,7 +69,7 @@ export const update{{.StructName}} = (data) => {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.{{.StructName}} true "用id查询{{.StructName}}"
// @Param data query model.{{.StructName}} true "用id查询{{.StructName}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /{{.Abbreviation}}/find{{.StructName}} [get]
export const find{{.StructName}} = (params) => {
......@@ -85,7 +85,7 @@ export const find{{.StructName}} = (params) => {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "分页获取{{.StructName}}列表"
// @Param data query request.PageInfo true "分页获取{{.StructName}}列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /{{.Abbreviation}}/get{{.StructName}}List [get]
export const get{{.StructName}}List = (params) => {
......
package system
import (
"fmt"
"gin-vue-admin/global"
"gin-vue-admin/model/common/request"
"gin-vue-admin/model/system"
"gin-vue-admin/utils"
"path/filepath"
"strings"
"time"
"go.uber.org/zap"
)
......@@ -55,8 +58,16 @@ func (autoCodeHistoryService *AutoCodeHistoryService) RollBack(id uint) error {
}
}
// 删除文件
for _, path := range strings.Split(md.AutoCodePath, ";") {
_ = utils.DeLFile(path)
// 迁移
nPath := filepath.Join(global.GVA_CONFIG.AutoCode.Root,
"rm_file", time.Now().Format("20060102"), filepath.Base(filepath.Dir(filepath.Dir(path))), filepath.Base(filepath.Dir(path)), filepath.Base(path))
err = utils.FileMove(path, nPath)
if err != nil {
fmt.Println(">>>>>>>>>>>>>>>>>>>", err)
}
//_ = utils.DeLFile(path)
}
// 清除注入
for _, v := range strings.Split(md.InjectionMeta, ";") {
......
package captcha
import (
"context"
"gin-vue-admin/global"
"time"
"github.com/mojocn/base64Captcha"
"go.uber.org/zap"
"time"
)
func NewDefaultRedisStore() base64Captcha.Store {
func NewDefaultRedisStore() *RedisStore {
return &RedisStore{
Expiration: time.Second * 180,
PreKey: "CAPTCHA_",
......@@ -18,23 +18,29 @@ func NewDefaultRedisStore() base64Captcha.Store {
type RedisStore struct {
Expiration time.Duration
PreKey string
Context context.Context
}
func (rs *RedisStore) UseWithCtx(ctx context.Context) base64Captcha.Store {
rs.Context = ctx
return rs
}
func (rs *RedisStore) Set(id string, value string) {
err := global.GVA_REDIS.Set(rs.PreKey+id, value, rs.Expiration).Err()
err := global.GVA_REDIS.Set(rs.Context, rs.PreKey+id, value, rs.Expiration).Err()
if err != nil {
global.GVA_LOG.Error("RedisStoreSetError!", zap.Error(err))
}
}
func (rs *RedisStore) Get(key string, clear bool) string {
val, err := global.GVA_REDIS.Get(key).Result()
val, err := global.GVA_REDIS.Get(rs.Context, key).Result()
if err != nil {
global.GVA_LOG.Error("RedisStoreGetError!", zap.Error(err))
return ""
}
if clear {
err := global.GVA_REDIS.Del(key).Err()
err := global.GVA_REDIS.Del(rs.Context, key).Err()
if err != nil {
global.GVA_LOG.Error("RedisStoreClearError!", zap.Error(err))
return ""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册