gf2版本同步升级到v2.0.4,修复验证器兼容问题

This commit is contained in:
孟帅 2022-03-22 09:49:17 +08:00
parent 4dc278f9cb
commit c9383334b4
45 changed files with 410 additions and 303 deletions

View File

@ -11,12 +11,10 @@ import (
"github.com/gogf/gf/v2/os/gcache" "github.com/gogf/gf/v2/os/gcache"
) )
type cache struct { // 缓存
} var Cache = new(cache)
var ( type cache struct{}
Cache = new(cache)
)
func (component *cache) New() *gcache.Cache { func (component *cache) New() *gcache.Cache {
c := gcache.New() c := gcache.New()

View File

@ -13,13 +13,14 @@ import (
"github.com/mojocn/base64Captcha" "github.com/mojocn/base64Captcha"
) )
// 验证码
var Captcha = new(captcha) var Captcha = new(captcha)
type captcha struct{} type captcha struct{}
// //
//  @Title  获取字母数字混合验证码 //  @Title  获取字母数字混合验证码
//  @Description  //  @Description
//  @Author  Ms <133814250@qq.com> //  @Author  Ms <133814250@qq.com>
//  @Param   ctx //  @Param   ctx
//  @Return  idKeyC //  @Return  idKeyC
@ -27,27 +28,27 @@ type captcha struct{}
// //
func (component *captcha) GetVerifyImgString(ctx context.Context) (idKeyC string, base64stringC string) { func (component *captcha) GetVerifyImgString(ctx context.Context) (idKeyC string, base64stringC string) {
driver := &base64Captcha.DriverString{ driver := &base64Captcha.DriverString{
Height: 80, Height: 80,
Width: 240, Width: 240,
//NoiseCount: 50, //NoiseCount: 50,
//ShowLineOptions: 20, //ShowLineOptions: 20,
Length: 4, Length: 4,
Source: "abcdefghjkmnpqrstuvwxyz23456789", Source: "abcdefghjkmnpqrstuvwxyz23456789",
Fonts: []string{"chromohv.ttf"}, Fonts: []string{"chromohv.ttf"},
} }
driver = driver.ConvertFonts() driver = driver.ConvertFonts()
store := base64Captcha.DefaultMemStore store := base64Captcha.DefaultMemStore
c := base64Captcha.NewCaptcha(driver, store) c := base64Captcha.NewCaptcha(driver, store)
idKeyC, base64stringC, err := c.Generate() idKeyC, base64stringC, err := c.Generate()
if err != nil { if err != nil {
g.Log().Error(ctx,err) g.Log().Error(ctx, err)
} }
return return
} }
// //
//  @Title  验证输入的验证码是否正确 //  @Title  验证输入的验证码是否正确
//  @Description  //  @Description
//  @Author  Ms <133814250@qq.com> //  @Author  Ms <133814250@qq.com>
//  @Param   id //  @Param   id
//  @Param   answer //  @Param   answer
@ -59,4 +60,4 @@ func (component *captcha) VerifyString(id, answer string) bool {
c := base64Captcha.NewCaptcha(driver, store) c := base64Captcha.NewCaptcha(driver, store)
answer = gstr.ToLower(answer) answer = gstr.ToLower(answer)
return c.Verify(id, answer, true) return c.Verify(id, answer, true)
} }

View File

@ -13,10 +13,11 @@ import (
"github.com/gogf/gf/v2/net/ghttp" "github.com/gogf/gf/v2/net/ghttp"
) )
type comContext struct{} // 上下文
var Context = new(comContext) var Context = new(comContext)
type comContext struct{}
// //
//  @Title  初始化上下文对象指针到上下文对象中,以便后续的请求流程中可以修改 //  @Title  初始化上下文对象指针到上下文对象中,以便后续的请求流程中可以修改
//  @Description //  @Description

View File

@ -19,6 +19,7 @@ import (
"time" "time"
) )
// IP归属地
var Ip = new(ip) var Ip = new(ip)
type ip struct{} type ip struct{}

View File

@ -21,6 +21,7 @@ import (
"time" "time"
) )
// jwt鉴权
type JWT struct{} type JWT struct{}
var Jwt = new(JWT) var Jwt = new(JWT)

View File

@ -14,6 +14,7 @@ import (
"time" "time"
) )
// 统一响应
var Response = new(response) var Response = new(response)
type response struct{} type response struct{}

View File

@ -8,8 +8,8 @@ package consts
// 开放API // 开放API
const ( const (
OpenAPITitle = `HotGo` OpenAPITitle = `HotGo`
OpenAPIDescription = `这是一个使用HotGo的简单演示HTTP服务器项目。 ` OpenAPIDescription = `这是一个使用HotGo的简单演示HTTP服务器项目。 `
OpenAPIName = `HotGo` OpenAPIName = `HotGo`
OpenAPIURL = `http://hotgo.bufanyun.cn` OpenAPIURL = `https://github.com/bufanyun/hotgo`
) )

View File

@ -6,9 +6,9 @@
// //
package consts package consts
// // 状态码
const ( const (
StatusEnabled = "1" // 启用 StatusEnabled = "1" // 启用
StatusDisable = "2" // 禁用 StatusDisable = "2" // 禁用
StatusDelete = "3" //已删除 StatusDelete = "3" // 已删除
) )

View File

@ -8,6 +8,7 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 配置
var Config = config{} var Config = config{}
type config struct{} type config struct{}

View File

@ -8,6 +8,7 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 部门
var Dept = dept{} var Dept = dept{}
type dept struct{} type dept struct{}

View File

@ -6,6 +6,7 @@ import (
"github.com/bufanyun/hotgo/app/service/sysService" "github.com/bufanyun/hotgo/app/service/sysService"
) )
// 字典
var Dict = dict{} var Dict = dict{}
type dict struct{} type dict struct{}

View File

@ -8,6 +8,7 @@ import (
"github.com/gogf/gf/v2/errors/gerror" "github.com/gogf/gf/v2/errors/gerror"
) )
// 日志
var Log = log{} var Log = log{}
type log struct{} type log struct{}

View File

@ -16,6 +16,7 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 会员
var Member = member{} var Member = member{}
type member struct{} type member struct{}

View File

@ -14,6 +14,7 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 菜单
var Menu = menu{} var Menu = menu{}
type menu struct{} type menu struct{}

View File

@ -8,6 +8,7 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 公告
var Notice = notice{} var Notice = notice{}
type notice struct{} type notice struct{}

View File

@ -8,6 +8,7 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 岗位
var Post = post{} var Post = post{}
type post struct{} type post struct{}

View File

@ -15,6 +15,7 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 角色
var Role = role{} var Role = role{}
type role struct{} type role struct{}

View File

@ -17,6 +17,7 @@ import (
"time" "time"
) )
// 基础
var Base = base{} var Base = base{}
type base struct{} type base struct{}

View File

@ -6,6 +6,7 @@ import (
"github.com/bufanyun/hotgo/app/service/sysService" "github.com/bufanyun/hotgo/app/service/sysService"
) )
// 字典
var Dict = dict{} var Dict = dict{}
type dict struct{} type dict struct{}

View File

@ -8,6 +8,7 @@ import (
"github.com/gogf/gf/v2/errors/gerror" "github.com/gogf/gf/v2/errors/gerror"
) )
// 日志
var Log = log{} var Log = log{}
type log struct{} type log struct{}

View File

@ -12,6 +12,7 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 登录
var Login = login{} var Login = login{}
type login struct{} type login struct{}

View File

@ -9,6 +9,7 @@ import (
"github.com/gogf/gf/v2/errors/gerror" "github.com/gogf/gf/v2/errors/gerror"
) )
// 会员
var Member = member{} var Member = member{}
type member struct{} type member struct{}

View File

@ -1,3 +1,9 @@
//
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package queue package queue
import ( import (
@ -7,7 +13,6 @@ import (
"github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gconv"
) )
// 消费日志 // 消费日志
func ConsumerLog(ctx context.Context, topic string, mqMsg MqMsg, err error) { func ConsumerLog(ctx context.Context, topic string, mqMsg MqMsg, err error) {
@ -33,7 +38,7 @@ func FatalLog(ctx context.Context, text string, err error) {
g.Log(consts.QueueLogPath).Fatal(ctx, text+":", err) g.Log(consts.QueueLogPath).Fatal(ctx, text+":", err)
} }
// 通用 // 通用日志
func Log(ctx context.Context, text string) { func Log(ctx context.Context, text string) {
g.Log(consts.QueueLogPath).Print(ctx, text) g.Log(consts.QueueLogPath).Print(ctx, text)
} }

View File

@ -1,3 +1,9 @@
//
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package queue package queue
import ( import (

View File

@ -1,3 +1,9 @@
//
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminForm package adminForm
import ( import (
@ -9,41 +15,41 @@ import (
// 获取指定配置键的值 // 获取指定配置键的值
type ConfigGetValueReq struct { type ConfigGetValueReq struct {
Key string `json:"key" v:"required#配置键不能为空" description:"配置键"`
g.Meta `path:"/config/get_value" method:"get" tags:"配置" summary:"获取指定配置键的值"` g.Meta `path:"/config/get_value" method:"get" tags:"配置" summary:"获取指定配置键的值"`
Key string `json:"key" v:"required#配置键不能为空" dc:"配置键"`
} }
type ConfigGetValueRes struct { type ConfigGetValueRes struct {
Value string `json:"value" description:"配置值"` Value string `json:"value" dc:"配置值"`
} }
// 名称是否唯一 // 名称是否唯一
type ConfigNameUniqueReq struct { type ConfigNameUniqueReq struct {
Name string `json:"name" v:"required#配置名称不能为空" description:"配置名称"`
Id int64 `json:"id" description:"配置ID"`
g.Meta `path:"/config/name_unique" method:"get" tags:"配置" summary:"配置名称是否唯一"` g.Meta `path:"/config/name_unique" method:"get" tags:"配置" summary:"配置名称是否唯一"`
Name string `json:"name" v:"required#配置名称不能为空" dc:"配置名称"`
Id int64 `json:"id" dc:"配置ID"`
} }
type ConfigNameUniqueRes struct { type ConfigNameUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 查询列表 // 查询列表
type ConfigListReq struct { type ConfigListReq struct {
g.Meta `path:"/config/list" method:"get" tags:"配置" summary:"获取配置列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
form.StatusReq form.StatusReq
Name string `json:"name" description:"配置名称"` Name string `json:"name" dc:"配置名称"`
g.Meta `path:"/config/list" method:"get" tags:"配置" summary:"获取配置列表"`
} }
type ConfigListRes struct { type ConfigListRes struct {
List []*input.SysConfigListModel `json:"list" description:"数据列表"` List []*input.SysConfigListModel `json:"list" dc:"数据列表"`
form.PageRes form.PageRes
} }
// 获取指定信息 // 获取指定信息
type ConfigViewReq struct { type ConfigViewReq struct {
Id string `json:"id" v:"required#配置ID不能为空" description:"配置ID"`
g.Meta `path:"/config/view" method:"get" tags:"配置" summary:"获取指定信息"` g.Meta `path:"/config/view" method:"get" tags:"配置" summary:"获取指定信息"`
Id string `json:"id" v:"required#配置ID不能为空" dc:"配置ID"`
} }
type ConfigViewRes struct { type ConfigViewRes struct {
*input.SysConfigViewModel *input.SysConfigViewModel
@ -51,23 +57,23 @@ type ConfigViewRes struct {
// 修改/新增 // 修改/新增
type ConfigEditReq struct { type ConfigEditReq struct {
entity.SysConfig
g.Meta `path:"/config/edit" method:"post" tags:"配置" summary:"修改/新增配置"` g.Meta `path:"/config/edit" method:"post" tags:"配置" summary:"修改/新增配置"`
entity.SysConfig
} }
type ConfigEditRes struct{} type ConfigEditRes struct{}
// 删除 // 删除
type ConfigDeleteReq struct { type ConfigDeleteReq struct {
Id interface{} `json:"id" v:"required#配置ID不能为空" description:"配置ID"`
g.Meta `path:"/config/delete" method:"post" tags:"配置" summary:"删除配置"` g.Meta `path:"/config/delete" method:"post" tags:"配置" summary:"删除配置"`
Id interface{} `json:"id" v:"required#配置ID不能为空" dc:"配置ID"`
} }
type ConfigDeleteRes struct{} type ConfigDeleteRes struct{}
// 最大排序 // 最大排序
type ConfigMaxSortReq struct { type ConfigMaxSortReq struct {
Id int64 `json:"id" description:"配置ID"`
g.Meta `path:"/config/max_sort" method:"get" tags:"配置" summary:"配置最大排序"` g.Meta `path:"/config/max_sort" method:"get" tags:"配置" summary:"配置最大排序"`
Id int64 `json:"id" dc:"配置ID"`
} }
type ConfigMaxSortRes struct { type ConfigMaxSortRes struct {
Sort int `json:"sort" description:"排序"` Sort int `json:"sort" dc:"排序"`
} }

View File

@ -1,3 +1,9 @@
//
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminForm package adminForm
import ( import (
@ -8,17 +14,17 @@ import (
// 名称是否唯一 // 名称是否唯一
type DeptNameUniqueReq struct { type DeptNameUniqueReq struct {
Name string `json:"name" v:"required#部门名称不能为空" description:"部门名称"` Name string `json:"name" v:"required#部门名称不能为空" dc:"部门名称"`
Id int64 `json:"id" description:"部门ID"` Id int64 `json:"id" dc:"部门ID"`
g.Meta `path:"/dept/name_unique" method:"get" tags:"部门" summary:"部门名称是否唯一"` g.Meta `path:"/dept/name_unique" method:"get" tags:"部门" summary:"部门名称是否唯一"`
} }
type DeptNameUniqueRes struct { type DeptNameUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 查询列表树 // 查询列表树
type DeptListTreeReq struct { type DeptListTreeReq struct {
Id int64 `json:"id" description:"部门ID"` Id int64 `json:"id" dc:"部门ID"`
g.Meta `path:"/dept/list_tree" method:"get" tags:"部门" summary:"获取部门列表树"` g.Meta `path:"/dept/list_tree" method:"get" tags:"部门" summary:"获取部门列表树"`
} }
@ -26,7 +32,7 @@ type DeptListTreeRes []*input.AdminDeptListTreeModel
// 查询列表 // 查询列表
type DeptListReq struct { type DeptListReq struct {
Name string `json:"name" description:"部门名称"` Name string `json:"name" dc:"部门名称"`
g.Meta `path:"/dept/list" method:"get" tags:"部门" summary:"获取部门列表"` g.Meta `path:"/dept/list" method:"get" tags:"部门" summary:"获取部门列表"`
} }
@ -34,7 +40,7 @@ type DeptListRes []*input.AdminDeptListModel
// 获取指定信息 // 获取指定信息
type DeptViewReq struct { type DeptViewReq struct {
Id int64 `json:"id" v:"required#部门ID不能为空" description:"部门ID"` Id int64 `json:"id" v:"required#部门ID不能为空" dc:"部门ID"`
g.Meta `path:"/dept/view" method:"get" tags:"部门" summary:"获取指定信息"` g.Meta `path:"/dept/view" method:"get" tags:"部门" summary:"获取指定信息"`
} }
type DeptViewRes struct { type DeptViewRes struct {
@ -50,16 +56,16 @@ type DeptEditRes struct{}
// 删除字典类型 // 删除字典类型
type DeptDeleteReq struct { type DeptDeleteReq struct {
Id interface{} `json:"id" v:"required#部门ID不能为空" description:"部门ID"` Id interface{} `json:"id" v:"required#部门ID不能为空" dc:"部门ID"`
g.Meta `path:"/dept/delete" method:"post" tags:"部门" summary:"删除部门"` g.Meta `path:"/dept/delete" method:"post" tags:"部门" summary:"删除部门"`
} }
type DeptDeleteRes struct{} type DeptDeleteRes struct{}
// 最大排序 // 最大排序
type DeptMaxSortReq struct { type DeptMaxSortReq struct {
Id int64 `json:"id" description:"部门ID"` Id int64 `json:"id" dc:"部门ID"`
g.Meta `path:"/dept/max_sort" method:"get" tags:"部门" summary:"部门最大排序"` g.Meta `path:"/dept/max_sort" method:"get" tags:"部门" summary:"部门最大排序"`
} }
type DeptMaxSortRes struct { type DeptMaxSortRes struct {
Sort int `json:"sort" description:"排序"` Sort int `json:"sort" dc:"排序"`
} }

View File

@ -1,3 +1,9 @@
//
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminForm package adminForm
import ( import (
@ -10,42 +16,42 @@ import (
// 数据键值是否唯一 // 数据键值是否唯一
type DictDataUniqueReq struct { type DictDataUniqueReq struct {
Value string `json:"value" v:"required#数据键值不能为空" description:"数据键值"`
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" description:"字典类型"`
Id int64 `json:"id" description:"字典数据ID"`
g.Meta `path:"/dict_data/unique" method:"get" tags:"字典" summary:"数据键值是否唯一"` g.Meta `path:"/dict_data/unique" method:"get" tags:"字典" summary:"数据键值是否唯一"`
Value string `json:"value" v:"required#数据键值不能为空" dc:"数据键值"`
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"`
Id int64 `json:"id" dc:"字典数据ID"`
} }
type DictDataUniqueRes struct { type DictDataUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 查询字典数据最大排序 // 查询字典数据最大排序
type DictDataMaxSortReq struct { type DictDataMaxSortReq struct {
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" description:"字典类型"`
g.Meta `path:"/dict_data/max_sort" method:"get" tags:"字典" summary:"查询字典数据最大排序"` g.Meta `path:"/dict_data/max_sort" method:"get" tags:"字典" summary:"查询字典数据最大排序"`
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"`
} }
type DictDataMaxSortRes struct { type DictDataMaxSortRes struct {
Sort int `json:"sort" description:"排序"` Sort int `json:"sort" dc:"排序"`
} }
// 修改/新增字典数据 // 修改/新增字典数据
type DictDataEditReq struct { type DictDataEditReq struct {
entity.SysDictData
g.Meta `path:"/dict_data/edit" method:"post" tags:"字典" summary:"修改/新增字典数据"` g.Meta `path:"/dict_data/edit" method:"post" tags:"字典" summary:"修改/新增字典数据"`
entity.SysDictData
} }
type DictDataEditRes struct{} type DictDataEditRes struct{}
// 删除字典类型 // 删除字典类型
type DictDataDeleteReq struct { type DictDataDeleteReq struct {
Id interface{} `json:"id" v:"required#字典数据ID不能为空" description:"字典数据ID"`
g.Meta `path:"/dict_data/delete" method:"post" tags:"字典" summary:"删除字典数据"` g.Meta `path:"/dict_data/delete" method:"post" tags:"字典" summary:"删除字典数据"`
Id interface{} `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"`
} }
type DictDataDeleteRes struct{} type DictDataDeleteRes struct{}
// 获取指定字典数据信息 // 获取指定字典数据信息
type DictDataViewReq struct { type DictDataViewReq struct {
Id string `json:"id" v:"required#字典数据ID不能为空" description:"字典数据ID"`
g.Meta `path:"/dict_data/view" method:"get" tags:"字典" summary:"获取指定字典数据信息"` g.Meta `path:"/dict_data/view" method:"get" tags:"字典" summary:"获取指定字典数据信息"`
Id string `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"`
} }
type DictDataViewRes struct { type DictDataViewRes struct {
*entity.SysDictData *entity.SysDictData
@ -53,19 +59,19 @@ type DictDataViewRes struct {
// 获取字典数据列表 // 获取字典数据列表
type DictDataListReq struct { type DictDataListReq struct {
form.PageReq
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" description:"字典类型"`
g.Meta `path:"/dict_data/list" method:"get" tags:"字典" summary:"获取字典数据列表"` g.Meta `path:"/dict_data/list" method:"get" tags:"字典" summary:"获取字典数据列表"`
form.PageReq
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"`
} }
type DictDataListRes struct { type DictDataListRes struct {
List []*entity.SysDictData `json:"list" description:"数据列表"` List []*entity.SysDictData `json:"list" dc:"数据列表"`
form.PageRes form.PageRes
} }
// 获取指定字典类型的属性数据 // 获取指定字典类型的属性数据
type DictAttributeReq struct { type DictAttributeReq struct {
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" description:"字典类型"`
g.Meta `path:"/dict/attribute" method:"get" tags:"字典" summary:"获取指定字典类型的属性数据"` g.Meta `path:"/dict/attribute" method:"get" tags:"字典" summary:"获取指定字典类型的属性数据"`
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"`
} }
type DictAttributeRes []*entity.SysDictData type DictAttributeRes []*entity.SysDictData
@ -73,12 +79,12 @@ type DictAttributeRes []*entity.SysDictData
// 修改/新增字典类型 // 修改/新增字典类型
type DictTypeExportReq struct { type DictTypeExportReq struct {
g.Meta `path:"/dict_type/export" method:"get" tags:"字典" summary:"导出字典类型"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
form.StatusReq form.StatusReq
Name string `json:"name" description:"字典名称"` Name string `json:"name" dc:"字典名称"`
Type string `json:"type" description:"字典类型"` Type string `json:"type" dc:"字典类型"`
g.Meta `path:"/dict_type/export" method:"get" tags:"字典" summary:"导出字典类型"`
} }
type DictTypeExportRes struct{} type DictTypeExportRes struct{}
@ -90,36 +96,36 @@ type DictTypeRefreshCacheRes struct{}
// 获取字典类型列表 // 获取字典类型列表
type DictTypeListReq struct { type DictTypeListReq struct {
g.Meta `path:"/dict_type/list" method:"get" tags:"字典" summary:"获取字典类型列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
form.StatusReq form.StatusReq
Name string `json:"name" description:"字典名称"` Name string `json:"name" dc:"字典名称"`
Type string `json:"type" description:"字典类型"` Type string `json:"type" dc:"字典类型"`
g.Meta `path:"/dict_type/list" method:"get" tags:"字典" summary:"获取字典类型列表"`
} }
type DictTypeListRes struct { type DictTypeListRes struct {
List []*entity.SysDictType `json:"list" description:"数据列表"` List []*entity.SysDictType `json:"list" dc:"数据列表"`
form.PageRes form.PageRes
} }
// 修改/新增字典类型 // 修改/新增字典类型
type DictTypeEditReq struct { type DictTypeEditReq struct {
entity.SysDictType
g.Meta `path:"/dict_type/edit" method:"post" tags:"字典" summary:"修改/新增字典类型"` g.Meta `path:"/dict_type/edit" method:"post" tags:"字典" summary:"修改/新增字典类型"`
entity.SysDictType
} }
type DictTypeEditRes struct{} type DictTypeEditRes struct{}
// 删除字典类型 // 删除字典类型
type DictTypeDeleteReq struct { type DictTypeDeleteReq struct {
Id interface{} `json:"id" v:"required#字典类型ID不能为空" description:"字典类型ID"`
g.Meta `path:"/dict_type/delete" method:"post" tags:"字典" summary:"删除字典类型"` g.Meta `path:"/dict_type/delete" method:"post" tags:"字典" summary:"删除字典类型"`
Id interface{} `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
} }
type DictTypeDeleteRes struct{} type DictTypeDeleteRes struct{}
// 获取指定字典类型信息 // 获取指定字典类型信息
type DictTypeViewReq struct { type DictTypeViewReq struct {
Id string `json:"id" v:"required#字典类型ID不能为空" description:"字典类型ID"`
g.Meta `path:"/dict_type/view" method:"get" tags:"字典" summary:"获取指定字典类型信息"` g.Meta `path:"/dict_type/view" method:"get" tags:"字典" summary:"获取指定字典类型信息"`
Id string `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
} }
type DictTypeViewRes struct { type DictTypeViewRes struct {
*entity.SysDictType *entity.SysDictType
@ -127,10 +133,10 @@ type DictTypeViewRes struct {
// 类型是否唯一 // 类型是否唯一
type DictTypeUniqueReq struct { type DictTypeUniqueReq struct {
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" description:"字典类型"`
Id int64 `json:"id" description:"字典类型ID"`
g.Meta `path:"/dict_type/unique" method:"get" tags:"字典" summary:"类型是否唯一"` g.Meta `path:"/dict_type/unique" method:"get" tags:"字典" summary:"类型是否唯一"`
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"`
Id int64 `json:"id" dc:"字典类型ID"`
} }
type DictTypeUniqueRes struct { type DictTypeUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }

View File

@ -1,3 +1,9 @@
//
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminForm package adminForm
import ( import (
@ -14,34 +20,34 @@ type LogClearRes struct{}
// 导出 // 导出
type LogExportReq struct { type LogExportReq struct {
g.Meta `path:"/log/export" method:"get" tags:"日志" summary:"导出日志"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
Module string `json:"module" description:"应用端口"` Module string `json:"module" dc:"应用端口"`
MemberId int `json:"member_id" description:"用户ID"` MemberId int `json:"member_id" dc:"用户ID"`
TakeUpTime int `json:"take_up_time" description:"请求耗时"` TakeUpTime int `json:"take_up_time" dc:"请求耗时"`
Method string `json:"method" description:"请求方式"` Method string `json:"method" dc:"请求方式"`
Url string `json:"url" description:"请求路径"` Url string `json:"url" dc:"请求路径"`
Ip string `json:"ip" description:"访问IP"` Ip string `json:"ip" dc:"访问IP"`
ErrorCode string `json:"error_code" description:"状态码"` ErrorCode string `json:"error_code" dc:"状态码"`
g.Meta `path:"/log/export" method:"get" tags:"日志" summary:"导出日志"`
} }
type LogExportRes struct{} type LogExportRes struct{}
// 获取菜单列表 // 获取菜单列表
type LogListReq struct { type LogListReq struct {
g.Meta `path:"/log/list" method:"get" tags:"日志" summary:"获取日志列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
Module string `json:"module" description:"应用端口"` Module string `json:"module" dc:"应用端口"`
MemberId int `json:"member_id" description:"用户ID"` MemberId int `json:"member_id" dc:"用户ID"`
TakeUpTime int `json:"take_up_time" description:"请求耗时"` TakeUpTime int `json:"take_up_time" dc:"请求耗时"`
Method string `json:"method" description:"请求方式"` Method string `json:"method" dc:"请求方式"`
Url string `json:"url" description:"请求路径"` Url string `json:"url" dc:"请求路径"`
Ip string `json:"ip" description:"访问IP"` Ip string `json:"ip" dc:"访问IP"`
ErrorCode string `json:"error_code" description:"状态码"` ErrorCode string `json:"error_code" dc:"状态码"`
g.Meta `path:"/log/list" method:"get" tags:"日志" summary:"获取日志列表"`
} }
type LogListRes struct { type LogListRes struct {
List []*input.LogListModel `json:"list" description:"数据列表"` List []*input.LogListModel `json:"list" dc:"数据列表"`
form.PageRes form.PageRes
} }

View File

@ -22,20 +22,20 @@ type LoginCaptchaReq struct {
g.Meta `path:"/login/captcha" method:"get" tags:"登录" summary:"获取登录验证码"` g.Meta `path:"/login/captcha" method:"get" tags:"登录" summary:"获取登录验证码"`
} }
type LoginCaptchaRes struct { type LoginCaptchaRes struct {
Cid string `json:"cid" v:"" description:"验证码ID"` Cid string `json:"cid" dc:"验证码ID"`
Base64 string `json:"base64" v:"" description:"验证码"` Base64 string `json:"base64" dc:"验证码"`
} }
// 提交登录 // 提交登录
type LoginReq struct { type LoginReq struct {
g.Meta `path:"/login/sign" method:"post" tags:"登录" summary:"提交登录"` g.Meta `path:"/login/sign" method:"post" tags:"登录" summary:"提交登录"`
Username string `json:"username" v:"required#用户名不能为空" description:"用户名"` Username string `json:"username" v:"required#用户名不能为空" dc:"用户名"`
Password string `json:"password" v:"required#密码不能为空" description:"密码"` Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
Cid string `json:"cid" v:"required#验证码ID不能为空" description:"验证码ID"` Cid string `json:"cid" v:"required#验证码ID不能为空" dc:"验证码ID"`
Code string `json:"code" v:"required#验证码不能为空" description:"验证码"` Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"`
Device string `json:"device" description:"登录设备"` Device string `json:"device" dc:"登录设备"`
} }
type LoginRes struct { type LoginRes struct {
model.Identity model.Identity
Token string `json:"token" v:"" description:"登录token"` Token string `json:"token" dc:"登录token"`
} }

View File

@ -17,18 +17,18 @@ import (
// 更新会员资料 // 更新会员资料
type MemberUpdateProfileReq struct { type MemberUpdateProfileReq struct {
Mobile int `json:"mobile" description:"手机号"`
Email string `json:"email" description:"邮箱"`
Realname string `json:"realname" description:"真实姓名"`
g.Meta `path:"/member/update_profile" method:"post" tags:"会员" summary:"更新会员资料"` g.Meta `path:"/member/update_profile" method:"post" tags:"会员" summary:"更新会员资料"`
Mobile int `json:"mobile" dc:"手机号"`
Email string `json:"email" dc:"邮箱"`
Realname string `json:"realname" dc:"真实姓名"`
} }
type MemberUpdateProfileRes struct{} type MemberUpdateProfileRes struct{}
// 修改登录密码 // 修改登录密码
type MemberUpdatePwdReq struct { type MemberUpdatePwdReq struct {
OldPassword string `json:"oldPassword" v:"required#原密码不能为空" description:"原密码"`
NewPassword string `json:"newPassword" v:"required|length:6,16#新密码不能为空#新密码需在6~16之间" description:"新密码"`
g.Meta `path:"/member/update_pwd" method:"post" tags:"会员" summary:"重置密码"` g.Meta `path:"/member/update_pwd" method:"post" tags:"会员" summary:"重置密码"`
OldPassword string `json:"oldPassword" v:"required#原密码不能为空" dc:"原密码"`
NewPassword string `json:"newPassword" v:"required|length:6,16#新密码不能为空#新密码需在6~16之间" dc:"新密码"`
} }
type MemberUpdatePwdRes struct{} type MemberUpdatePwdRes struct{}
@ -37,176 +37,176 @@ type MemberProfileReq struct {
g.Meta `path:"/member/profile" method:"get" tags:"会员" summary:"获取登录用户的基本信息"` g.Meta `path:"/member/profile" method:"get" tags:"会员" summary:"获取登录用户的基本信息"`
} }
type MemberProfileRes struct { type MemberProfileRes struct {
PostGroup string `json:"postGroup" description:"岗位名称"` PostGroup string `json:"postGroup" dc:"岗位名称"`
RoleGroup string `json:"roleGroup" description:"角色名称"` RoleGroup string `json:"roleGroup" dc:"角色名称"`
User *input.AdminMemberViewModel `json:"user" description:"用户基本信息"` User *input.AdminMemberViewModel `json:"user" dc:"用户基本信息"`
SysDept *input.AdminDeptViewModel `json:"sysDept" description:"部门信息"` SysDept *input.AdminDeptViewModel `json:"sysDept" dc:"部门信息"`
SysRoles []*input.AdminRoleListModel `json:"sysRoles" description:"角色列表"` SysRoles []*input.AdminRoleListModel `json:"sysRoles" dc:"角色列表"`
PostIds int64 `json:"postIds" description:"当前岗位"` PostIds int64 `json:"postIds" dc:"当前岗位"`
RoleIds int64 `json:"roleIds" description:"当前角色"` RoleIds int64 `json:"roleIds" dc:"当前角色"`
} }
// 重置密码 // 重置密码
type MemberResetPwdReq struct { type MemberResetPwdReq struct {
Password string `json:"password" v:"required#密码不能为空" description:"密码"`
Id int64 `json:"id" description:"会员ID"`
g.Meta `path:"/member/reset_pwd" method:"post" tags:"会员" summary:"重置密码"` g.Meta `path:"/member/reset_pwd" method:"post" tags:"会员" summary:"重置密码"`
Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
Id int64 `json:"id" dc:"会员ID"`
} }
type MemberResetPwdRes struct{} type MemberResetPwdRes struct{}
// 邮箱是否唯一 // 邮箱是否唯一
type MemberEmailUniqueReq struct { type MemberEmailUniqueReq struct {
Email string `json:"email" v:"required#邮箱不能为空" description:"邮箱"`
Id int64 `json:"id" description:"会员ID"`
g.Meta `path:"/member/email_unique" method:"get" tags:"会员" summary:"邮箱是否唯一"` g.Meta `path:"/member/email_unique" method:"get" tags:"会员" summary:"邮箱是否唯一"`
Email string `json:"email" v:"required#邮箱不能为空" dc:"邮箱"`
Id int64 `json:"id" dc:"会员ID"`
} }
type MemberEmailUniqueRes struct { type MemberEmailUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 手机号是否唯一 // 手机号是否唯一
type MemberMobileUniqueReq struct { type MemberMobileUniqueReq struct {
Mobile string `json:"mobile" v:"required#手机号不能为空" description:"手机号"`
Id int64 `json:"id" description:"会员ID"`
g.Meta `path:"/member/mobile_unique" method:"get" tags:"会员" summary:"手机号是否唯一"` g.Meta `path:"/member/mobile_unique" method:"get" tags:"会员" summary:"手机号是否唯一"`
Mobile string `json:"mobile" v:"required#手机号不能为空" dc:"手机号"`
Id int64 `json:"id" dc:"会员ID"`
} }
type MemberMobileUniqueRes struct { type MemberMobileUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 名称是否唯一 // 名称是否唯一
type MemberNameUniqueReq struct { type MemberNameUniqueReq struct {
Username string `json:"username" v:"required#会员名称不能为空" description:"会员名称"`
Id int64 `json:"id" description:"会员ID"`
g.Meta `path:"/member/name_unique" method:"get" tags:"会员" summary:"会员名称是否唯一"` g.Meta `path:"/member/name_unique" method:"get" tags:"会员" summary:"会员名称是否唯一"`
Username string `json:"username" v:"required#会员名称不能为空" dc:"会员名称"`
Id int64 `json:"id" dc:"会员ID"`
} }
type MemberNameUniqueRes struct { type MemberNameUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 查询列表 // 查询列表
type MemberListReq struct { type MemberListReq struct {
g.Meta `path:"/member/list" method:"get" tags:"会员" summary:"获取会员列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
form.StatusReq form.StatusReq
DeptId int `json:"dept_id" description:"部门ID"` DeptId int `json:"dept_id" dc:"部门ID"`
Mobile int `json:"mobile" description:"手机号"` Mobile int `json:"mobile" dc:"手机号"`
Username string `json:"username" description:"用户名"` Username string `json:"username" dc:"用户名"`
Realname string `json:"realname" description:"真实姓名"` Realname string `json:"realname" dc:"真实姓名"`
StartTime string `json:"start_time" description:"开始时间"` StartTime string `json:"start_time" dc:"开始时间"`
EndTime string `json:"end_time" description:"结束时间"` EndTime string `json:"end_time" dc:"结束时间"`
Name string `json:"name" description:"岗位名称"` Name string `json:"name" dc:"岗位名称"`
Code string `json:"code" description:"岗位编码"` Code string `json:"code" dc:"岗位编码"`
g.Meta `path:"/member/list" method:"get" tags:"会员" summary:"获取会员列表"`
} }
type MemberListRes struct { type MemberListRes struct {
List []*input.AdminMemberListModel `json:"list" description:"数据列表"` List []*input.AdminMemberListModel `json:"list" dc:"数据列表"`
form.PageRes form.PageRes
} }
// 获取指定信息 // 获取指定信息
type MemberViewReq struct { type MemberViewReq struct {
Id int64 `json:"id" description:"会员ID"` // v:"required#会员ID不能为空"
g.Meta `path:"/member/view" method:"get" tags:"会员" summary:"获取指定信息"` g.Meta `path:"/member/view" method:"get" tags:"会员" summary:"获取指定信息"`
Id int64 `json:"id" dc:"会员ID"` // v:"required#会员ID不能为空"
} }
type MemberViewRes struct { type MemberViewRes struct {
*input.AdminMemberViewModel *input.AdminMemberViewModel
Posts []*input.AdminPostListModel `json:"posts" description:"可选岗位"` Posts []*input.AdminPostListModel `json:"posts" dc:"可选岗位"`
PostIds []int64 `json:"postIds" description:"当前岗位"` PostIds []int64 `json:"postIds" dc:"当前岗位"`
Roles []*input.AdminRoleListModel `json:"roles" description:"可选角色"` Roles []*input.AdminRoleListModel `json:"roles" dc:"可选角色"`
RoleIds []int64 `json:"roleIds" description:"当前角色"` RoleIds []int64 `json:"roleIds" dc:"当前角色"`
DeptName string `json:"dept_name" description:"部门名称"` DeptName string `json:"dept_name" dc:"部门名称"`
} }
// 修改/新增 // 修改/新增
type MemberEditReq struct { type MemberEditReq struct {
input.AdminMemberEditInp
g.Meta `path:"/member/edit" method:"post" tags:"会员" summary:"修改/新增会员"` g.Meta `path:"/member/edit" method:"post" tags:"会员" summary:"修改/新增会员"`
input.AdminMemberEditInp
} }
type MemberEditRes struct{} type MemberEditRes struct{}
// 删除 // 删除
type MemberDeleteReq struct { type MemberDeleteReq struct {
Id interface{} `json:"id" v:"required#会员ID不能为空" description:"会员ID"`
g.Meta `path:"/member/delete" method:"post" tags:"会员" summary:"删除会员"` g.Meta `path:"/member/delete" method:"post" tags:"会员" summary:"删除会员"`
Id interface{} `json:"id" v:"required#会员ID不能为空" dc:"会员ID"`
} }
type MemberDeleteRes struct{} type MemberDeleteRes struct{}
// 最大排序 // 最大排序
type MemberMaxSortReq struct { type MemberMaxSortReq struct {
Id int64 `json:"id" description:"会员ID"`
g.Meta `path:"/member/max_sort" method:"get" tags:"会员" summary:"会员最大排序"` g.Meta `path:"/member/max_sort" method:"get" tags:"会员" summary:"会员最大排序"`
Id int64 `json:"id" dc:"会员ID"`
} }
type MemberMaxSortRes struct { type MemberMaxSortRes struct {
Sort int `json:"sort" description:"排序"` Sort int `json:"sort" dc:"排序"`
} }
// 获取登录用户信息 // 获取登录用户信息
type MemberInfoReq struct { type MemberInfoReq struct {
g.Meta `path:"/member/info" method:"get" tags:"会员" summary:"获取登录用户信息" description:"获取管理后台的登录用户信息"` g.Meta `path:"/member/info" method:"get" tags:"会员" summary:"获取登录用户信息" dc:"获取管理后台的登录用户信息"`
} }
type PortalConfigContentOptions struct { type PortalConfigContentOptions struct {
TitleRequired bool `json:"titleRequired" titleRequired:""` TitleRequired bool `json:"titleRequired" titleRequired:""`
MoreUrl string `json:"moreUrl" description:"模块地址"` MoreUrl string `json:"moreUrl" dc:"模块地址"`
Refresh int `json:"refresh" description:"刷新"` Refresh int `json:"refresh" dc:"刷新"`
} }
type PortalConfigContent struct { type PortalConfigContent struct {
Id int `json:"id" description:"内容ID"` Id int `json:"id" dc:"内容ID"`
X int `json:"x" description:""` X int `json:"x" dc:""`
Y int `json:"y" description:""` Y int `json:"y" dc:""`
W int `json:"w" description:"宽"` W int `json:"w" dc:"宽"`
H int `json:"h" description:"高"` H int `json:"h" dc:"高"`
I int `json:"i" description:""` I int `json:"i" dc:""`
Key string `json:"key" description:""` Key string `json:"key" dc:""`
IsShowTitle string `json:"isShowTitle" description:""` IsShowTitle string `json:"isShowTitle" dc:""`
IsAllowDrag bool `json:"isAllowDrag" description:""` IsAllowDrag bool `json:"isAllowDrag" dc:""`
Name string `json:"name" description:""` Name string `json:"name" dc:""`
Type string `json:"type" description:""` Type string `json:"type" dc:""`
Url string `json:"url" description:""` Url string `json:"url" dc:""`
Options []*PortalConfigContentOptions `json:"options" description:""` Options []*PortalConfigContentOptions `json:"options" dc:""`
Moved bool `json:"moved" description:""` Moved bool `json:"moved" dc:""`
} }
type PortalConfig struct { type PortalConfig struct {
CreateByName string `json:"createByName" description:"创建者名称"` CreateByName string `json:"createByName" dc:"创建者名称"`
CreateDeptName string `json:"createDeptName" description:"创建部门名称"` CreateDeptName string `json:"createDeptName" dc:"创建部门名称"`
ImportErrInfo string `json:"importErrInfo" description:"导出错误信息"` ImportErrInfo string `json:"importErrInfo" dc:"导出错误信息"`
Id string `json:"id" description:"用户ID"` Id string `json:"id" dc:"用户ID"`
SearchValue string `json:"searchValue" description:"搜索内容"` SearchValue string `json:"searchValue" dc:"搜索内容"`
CreateBy string `json:"createBy" description:"创建者名称"` CreateBy string `json:"createBy" dc:"创建者名称"`
CreateDept string `json:"createDept" description:"创建部门名称"` CreateDept string `json:"createDept" dc:"创建部门名称"`
CreateTime *gtime.Time `json:"createTime" description:"创建时间"` CreateTime *gtime.Time `json:"createTime" dc:"创建时间"`
UpdateBy string `json:"updateBy" description:"更新者名称"` UpdateBy string `json:"updateBy" dc:"更新者名称"`
UpdateTime *gtime.Time `json:"updateTime" description:"更新时间"` UpdateTime *gtime.Time `json:"updateTime" dc:"更新时间"`
UpdateIp string `json:"updateIp" description:"更新iP"` UpdateIp string `json:"updateIp" dc:"更新iP"`
Remark string `json:"remark" description:"备注"` Remark string `json:"remark" dc:"备注"`
Version string `json:"version" description:"版本号"` Version string `json:"version" dc:"版本号"`
DelFlag string `json:"delFlag" description:"删除标签"` DelFlag string `json:"delFlag" dc:"删除标签"`
HandleType string `json:"handleType" description:""` HandleType string `json:"handleType" dc:""`
Params string `json:"params" description:""` Params string `json:"params" dc:""`
Name string `json:"name" description:"配置名称"` Name string `json:"name" dc:"配置名称"`
Code string `json:"code" description:"配置代码"` Code string `json:"code" dc:"配置代码"`
ApplicationRange string `json:"applicationRange" description:""` ApplicationRange string `json:"applicationRange" dc:""`
IsDefault string `json:"isDefault" description:"是否默认"` IsDefault string `json:"isDefault" dc:"是否默认"`
ResourceId string `json:"resourceId" description:""` ResourceId string `json:"resourceId" dc:""`
ResourceName string `json:"resourceName" description:""` ResourceName string `json:"resourceName" dc:""`
SystemDefinedId string `json:"systemDefinedId" description:""` SystemDefinedId string `json:"systemDefinedId" dc:""`
Sort string `json:"sort" description:"排序"` Sort string `json:"sort" dc:"排序"`
SaveType string `json:"saveType" description:""` SaveType string `json:"saveType" dc:""`
Status string `json:"status" description:"状态"` Status string `json:"status" dc:"状态"`
RecordLog string `json:"recordLog" description:""` RecordLog string `json:"recordLog" dc:""`
PortalConfigContent string `json:"content" description:"配置内容"` PortalConfigContent string `json:"content" dc:"配置内容"`
} }
type MemberInfoRes struct { type MemberInfoRes struct {
DefaultPortalConfig []*PortalConfig `json:"defaultPortalConfig" description:"默认用户配置"` DefaultPortalConfig []*PortalConfig `json:"defaultPortalConfig" dc:"默认用户配置"`
LincenseInfo string `json:"lincenseInfo" description:"应用版本号"` LincenseInfo string `json:"lincenseInfo" dc:"应用版本号"`
Permissions []string `json:"permissions"description:"权限"` Permissions []string `json:"permissions"dc:"权限"`
Roles []string `json:"roles" description:"角色"` Roles []string `json:"roles" dc:"角色"`
SysNoticeList []*entity.AdminNotice `json:"sysNoticeList" description:"系统公告"` SysNoticeList []*entity.AdminNotice `json:"sysNoticeList" dc:"系统公告"`
UserPortalConfig []*PortalConfig `json:"userPortalConfig" description:"用户配置"` UserPortalConfig []*PortalConfig `json:"userPortalConfig" dc:"用户配置"`
User model.Identity `json:"user" description:"用户信息"` User model.Identity `json:"user" dc:"用户信息"`
} }

View File

@ -1,3 +1,9 @@
//
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminForm package adminForm
import ( import (
@ -9,51 +15,51 @@ import (
// 菜单最大排序 // 菜单最大排序
type MenuMaxSortReq struct { type MenuMaxSortReq struct {
Id int64 `json:"id" description:"菜单ID"`
g.Meta `path:"/menu/max_sort" method:"get" tags:"菜单" summary:"菜单最大排序"` g.Meta `path:"/menu/max_sort" method:"get" tags:"菜单" summary:"菜单最大排序"`
Id int64 `json:"id" dc:"菜单ID"`
} }
type MenuMaxSortRes struct { type MenuMaxSortRes struct {
Sort int `json:"sort" description:"排序"` Sort int `json:"sort" dc:"排序"`
} }
// 菜单编码是否唯一 // 菜单编码是否唯一
type MenuCodeUniqueReq struct { type MenuCodeUniqueReq struct {
Code string `json:"code" v:"required#菜单编码不能为空" description:"菜单编码"`
Id int64 `json:"id" description:"菜单ID"`
g.Meta `path:"/menu/code_unique" method:"get" tags:"菜单" summary:"菜单编码是否唯一"` g.Meta `path:"/menu/code_unique" method:"get" tags:"菜单" summary:"菜单编码是否唯一"`
Code string `json:"code" v:"required#菜单编码不能为空" dc:"菜单编码"`
Id int64 `json:"id" dc:"菜单ID"`
} }
type MenuCodeUniqueRes struct { type MenuCodeUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 菜单名称是否唯一 // 菜单名称是否唯一
type MenuNameUniqueReq struct { type MenuNameUniqueReq struct {
Name string `json:"name" v:"required#菜单名称不能为空" description:"菜单名称"`
Id int64 `json:"id" description:"菜单ID"`
g.Meta `path:"/menu/name_unique" method:"get" tags:"菜单" summary:"菜单名称是否唯一"` g.Meta `path:"/menu/name_unique" method:"get" tags:"菜单" summary:"菜单名称是否唯一"`
Name string `json:"name" v:"required#菜单名称不能为空" dc:"菜单名称"`
Id int64 `json:"id" dc:"菜单ID"`
} }
type MenuNameUniqueRes struct { type MenuNameUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 修改/新增字典数据 // 修改/新增字典数据
type MenuEditReq struct { type MenuEditReq struct {
entity.AdminMenu
g.Meta `path:"/menu/edit" method:"post" tags:"菜单" summary:"修改/新增菜单"` g.Meta `path:"/menu/edit" method:"post" tags:"菜单" summary:"修改/新增菜单"`
entity.AdminMenu
} }
type MenuEditRes struct{} type MenuEditRes struct{}
// 删除字典类型 // 删除字典类型
type MenuDeleteReq struct { type MenuDeleteReq struct {
Id interface{} `json:"id" v:"required#菜单ID不能为空" description:"菜单ID"`
g.Meta `path:"/menu/delete" method:"post" tags:"菜单" summary:"删除菜单"` g.Meta `path:"/menu/delete" method:"post" tags:"菜单" summary:"删除菜单"`
Id interface{} `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
} }
type MenuDeleteRes struct{} type MenuDeleteRes struct{}
// 获取指定字典数据信息 // 获取指定字典数据信息
type MenuViewReq struct { type MenuViewReq struct {
Id string `json:"id" v:"required#菜单ID不能为空" description:"菜单ID"`
g.Meta `path:"/menu/view" method:"get" tags:"菜单" summary:"获取指定菜单信息"` g.Meta `path:"/menu/view" method:"get" tags:"菜单" summary:"获取指定菜单信息"`
Id string `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
} }
type MenuViewRes struct { type MenuViewRes struct {
*entity.AdminMenu *entity.AdminMenu
@ -61,32 +67,32 @@ type MenuViewRes struct {
// 获取菜单列表 // 获取菜单列表
type MenuListReq struct { type MenuListReq struct {
form.PageReq
Pid int64 `json:"pid" description:"父ID"`
g.Meta `path:"/menu/list" method:"get" tags:"菜单" summary:"获取菜单列表"` g.Meta `path:"/menu/list" method:"get" tags:"菜单" summary:"获取菜单列表"`
form.PageReq
Pid int64 `json:"pid" dc:"父ID"`
} }
type MenuListRes struct { type MenuListRes struct {
List []*entity.AdminMenu `json:"list" description:"数据列表"` List []*entity.AdminMenu `json:"list" dc:"数据列表"`
form.PageRes form.PageRes
} }
// 查询菜单列表 // 查询菜单列表
type MenuSearchListReq struct { type MenuSearchListReq struct {
Name string `json:"name" description:"菜单名称"`
form.StatusReq
g.Meta `path:"/menu/search_list" method:"get" tags:"菜单" summary:"获取菜单列表"` g.Meta `path:"/menu/search_list" method:"get" tags:"菜单" summary:"获取菜单列表"`
Name string `json:"name" dc:"菜单名称"`
form.StatusReq
} }
type MenuSearchListRes []*model.TreeMenu type MenuSearchListRes []*model.TreeMenu
// 查询角色菜单列表 // 查询角色菜单列表
type MenuRoleListReq struct { type MenuRoleListReq struct {
RoleId string `json:"role_id" description:"角色ID"`
g.Meta `path:"/menu/role_list" method:"get" tags:"菜单" summary:"查询角色菜单列表"` g.Meta `path:"/menu/role_list" method:"get" tags:"菜单" summary:"查询角色菜单列表"`
RoleId string `json:"role_id" dc:"角色ID"`
} }
type MenuRoleListRes struct { type MenuRoleListRes struct {
Menus []*model.LabelTreeMenu `json:"menus" description:"菜单列表"` Menus []*model.LabelTreeMenu `json:"menus" dc:"菜单列表"`
CheckedKeys []int64 `json:"checkedKeys" description:"选择的菜单ID"` CheckedKeys []int64 `json:"checkedKeys" dc:"选择的菜单ID"`
} }

View File

@ -1,3 +1,9 @@
//
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminForm package adminForm
import ( import (
@ -9,32 +15,32 @@ import (
// 名称是否唯一 // 名称是否唯一
type NoticeNameUniqueReq struct { type NoticeNameUniqueReq struct {
Title string `json:"name" v:"required#公告名称不能为空" description:"公告名称"`
Id int64 `json:"id" description:"公告ID"`
g.Meta `path:"/notice/name_unique" method:"get" tags:"公告" summary:"公告名称是否唯一"` g.Meta `path:"/notice/name_unique" method:"get" tags:"公告" summary:"公告名称是否唯一"`
Title string `json:"name" v:"required#公告名称不能为空" dc:"公告名称"`
Id int64 `json:"id" dc:"公告ID"`
} }
type NoticeNameUniqueRes struct { type NoticeNameUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" dc:"是否唯一"`
} }
// 查询列表 // 查询列表
type NoticeListReq struct { type NoticeListReq struct {
g.Meta `path:"/notice/list" method:"get" tags:"公告" summary:"获取公告列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
form.StatusReq form.StatusReq
Name string `json:"name" description:"公告名称"` Name string `json:"name" dc:"公告名称"`
g.Meta `path:"/notice/list" method:"get" tags:"公告" summary:"获取公告列表"`
} }
type NoticeListRes struct { type NoticeListRes struct {
List []*input.AdminNoticeListModel `json:"list" description:"数据列表"` List []*input.AdminNoticeListModel `json:"list" dc:"数据列表"`
form.PageRes form.PageRes
} }
// 获取指定信息 // 获取指定信息
type NoticeViewReq struct { type NoticeViewReq struct {
Id string `json:"id" v:"required#公告ID不能为空" description:"公告ID"`
g.Meta `path:"/notice/view" method:"get" tags:"公告" summary:"获取指定信息"` g.Meta `path:"/notice/view" method:"get" tags:"公告" summary:"获取指定信息"`
Id string `json:"id" v:"required#公告ID不能为空" dc:"公告ID"`
} }
type NoticeViewRes struct { type NoticeViewRes struct {
*input.AdminNoticeViewModel *input.AdminNoticeViewModel
@ -42,23 +48,23 @@ type NoticeViewRes struct {
// 修改/新增 // 修改/新增
type NoticeEditReq struct { type NoticeEditReq struct {
entity.AdminNotice
g.Meta `path:"/notice/edit" method:"post" tags:"公告" summary:"修改/新增公告"` g.Meta `path:"/notice/edit" method:"post" tags:"公告" summary:"修改/新增公告"`
entity.AdminNotice
} }
type NoticeEditRes struct{} type NoticeEditRes struct{}
// 删除 // 删除
type NoticeDeleteReq struct { type NoticeDeleteReq struct {
Id interface{} `json:"id" v:"required#公告ID不能为空" description:"公告ID"`
g.Meta `path:"/notice/delete" method:"post" tags:"公告" summary:"删除公告"` g.Meta `path:"/notice/delete" method:"post" tags:"公告" summary:"删除公告"`
Id interface{} `json:"id" v:"required#公告ID不能为空" dc:"公告ID"`
} }
type NoticeDeleteRes struct{} type NoticeDeleteRes struct{}
// 最大排序 // 最大排序
type NoticeMaxSortReq struct { type NoticeMaxSortReq struct {
Id int64 `json:"id" description:"公告ID"`
g.Meta `path:"/notice/max_sort" method:"get" tags:"公告" summary:"公告最大排序"` g.Meta `path:"/notice/max_sort" method:"get" tags:"公告" summary:"公告最大排序"`
Id int64 `json:"id" dc:"公告ID"`
} }
type NoticeMaxSortRes struct { type NoticeMaxSortRes struct {
Sort int `json:"sort" description:"排序"` Sort int `json:"sort" dc:"排序"`
} }

View File

@ -1,3 +1,9 @@
//
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package adminForm package adminForm
import ( import (
@ -9,22 +15,22 @@ import (
// 修改/新增字典数据 // 修改/新增字典数据
type PostEditReq struct { type PostEditReq struct {
entity.AdminPost
g.Meta `path:"/post/edit" method:"post" tags:"岗位" summary:"修改/新增岗位"` g.Meta `path:"/post/edit" method:"post" tags:"岗位" summary:"修改/新增岗位"`
entity.AdminPost
} }
type PostEditRes struct{} type PostEditRes struct{}
// 删除字典类型 // 删除字典类型
type PostDeleteReq struct { type PostDeleteReq struct {
Id interface{} `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"`
g.Meta `path:"/post/delete" method:"post" tags:"岗位" summary:"删除岗位"` g.Meta `path:"/post/delete" method:"post" tags:"岗位" summary:"删除岗位"`
Id interface{} `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"`
} }
type PostDeleteRes struct{} type PostDeleteRes struct{}
// 最大排序 // 最大排序
type PostMaxSortReq struct { type PostMaxSortReq struct {
Id int64 `json:"id" description:"岗位ID"`
g.Meta `path:"/post/max_sort" method:"get" tags:"岗位" summary:"岗位最大排序"` g.Meta `path:"/post/max_sort" method:"get" tags:"岗位" summary:"岗位最大排序"`
Id int64 `json:"id" description:"岗位ID"`
} }
type PostMaxSortRes struct { type PostMaxSortRes struct {
Sort int `json:"sort" description:"排序"` Sort int `json:"sort" description:"排序"`
@ -32,12 +38,12 @@ type PostMaxSortRes struct {
// 获取列表 // 获取列表
type PostListReq struct { type PostListReq struct {
g.Meta `path:"/post/list" method:"get" tags:"岗位" summary:"获取岗位列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
form.StatusReq form.StatusReq
Name string `json:"name" description:"岗位名称"` Name string `json:"name" description:"岗位名称"`
Code string `json:"code" description:"岗位编码"` Code string `json:"code" description:"岗位编码"`
g.Meta `path:"/post/list" method:"get" tags:"岗位" summary:"获取岗位列表"`
} }
type PostListRes struct { type PostListRes struct {
@ -47,8 +53,8 @@ type PostListRes struct {
// 获取指定信息 // 获取指定信息
type PostViewReq struct { type PostViewReq struct {
Id string `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"`
g.Meta `path:"/post/view" method:"get" tags:"岗位" summary:"获取指定信息"` g.Meta `path:"/post/view" method:"get" tags:"岗位" summary:"获取指定信息"`
Id string `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"`
} }
type PostViewRes struct { type PostViewRes struct {
*input.AdminPostViewModel *input.AdminPostViewModel
@ -56,9 +62,9 @@ type PostViewRes struct {
// 编码是否唯一 // 编码是否唯一
type PostCodeUniqueReq struct { type PostCodeUniqueReq struct {
g.Meta `path:"/post/code_unique" method:"get" tags:"岗位" summary:"岗位编码是否唯一"`
Code string `json:"code" v:"required#岗位编码不能为空" description:"岗位编码"` Code string `json:"code" v:"required#岗位编码不能为空" description:"岗位编码"`
Id int64 `json:"id" description:"岗位ID"` Id int64 `json:"id" description:"岗位ID"`
g.Meta `path:"/post/code_unique" method:"get" tags:"岗位" summary:"岗位编码是否唯一"`
} }
type PostCodeUniqueRes struct { type PostCodeUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" description:"是否唯一"`
@ -66,9 +72,9 @@ type PostCodeUniqueRes struct {
// 名称是否唯一 // 名称是否唯一
type PostNameUniqueReq struct { type PostNameUniqueReq struct {
g.Meta `path:"/post/name_unique" method:"get" tags:"岗位" summary:"岗位名称是否唯一"`
Name string `json:"name" v:"required#岗位名称不能为空" description:"岗位名称"` Name string `json:"name" v:"required#岗位名称不能为空" description:"岗位名称"`
Id int64 `json:"id" description:"岗位ID"` Id int64 `json:"id" description:"岗位ID"`
g.Meta `path:"/post/name_unique" method:"get" tags:"岗位" summary:"岗位名称是否唯一"`
} }
type PostNameUniqueRes struct { type PostNameUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"` IsUnique bool `json:"is_unique" description:"是否唯一"`

View File

@ -14,6 +14,7 @@ import (
// 查询列表 // 查询列表
type RoleMemberListReq struct { type RoleMemberListReq struct {
g.Meta `path:"/role/member_list" method:"get" tags:"角色" summary:"获取角色下的会员列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
form.StatusReq form.StatusReq
@ -26,7 +27,6 @@ type RoleMemberListReq struct {
EndTime string `json:"end_time" description:"结束时间"` EndTime string `json:"end_time" description:"结束时间"`
Name string `json:"name" description:"岗位名称"` Name string `json:"name" description:"岗位名称"`
Code string `json:"code" description:"岗位编码"` Code string `json:"code" description:"岗位编码"`
g.Meta `path:"/role/member_list" method:"get" tags:"角色" summary:"获取角色下的会员列表"`
} }
type RoleMemberListRes struct { type RoleMemberListRes struct {
@ -36,6 +36,7 @@ type RoleMemberListRes struct {
// 查询列表 // 查询列表
type RoleListReq struct { type RoleListReq struct {
g.Meta `path:"/role/list" method:"get" tags:"角色" summary:"获取角色列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
form.StatusReq form.StatusReq
@ -47,7 +48,6 @@ type RoleListReq struct {
EndTime string `json:"end_time" description:"结束时间"` EndTime string `json:"end_time" description:"结束时间"`
Name string `json:"name" description:"岗位名称"` Name string `json:"name" description:"岗位名称"`
Code string `json:"code" description:"岗位编码"` Code string `json:"code" description:"岗位编码"`
g.Meta `path:"/role/list" method:"get" tags:"角色" summary:"获取角色列表"`
} }
type RoleListRes struct { type RoleListRes struct {

View File

@ -13,22 +13,22 @@ import (
// 获取lang信息 // 获取lang信息
type BaseLangReq struct { type BaseLangReq struct {
g.Meta `path:"/base/lang" method:"get" tags:"基础" summary:"获取lang信息"` g.Meta `path:"/base/lang" method:"get" tags:"基础接口" summary:"获取lang信息"`
L string `json:"l" v:"required#语言不能为空" description:"语言"` L string `json:"l" v:"required#语言不能为空" dc:"语言"`
} }
type BaseLangRes struct { type BaseLangRes struct {
} }
// 获取登录验证码 // 获取登录验证码
type IpLocationReq struct { type IpLocationReq struct {
g.Meta `path:"/base/ip_location" method:"get" tags:"基础" summary:"获取IP归属地信息"` g.Meta `path:"/base/ip_location" method:"get" tags:"基础接口" summary:"获取IP归属地信息"`
Ip string `json:"ip" v:"required#ip不能为空" description:"ipv4地址"` Ip string `json:"ip" v:"required#ip不能为空" dc:"ipv4地址"`
} }
type IpLocationRes struct { type IpLocationRes struct {
com.IpLocationData com.IpLocationData
} }
type ExportReq struct { type ExportReq struct {
g.Meta `path:"/base/export" method:"get" tags:"字典" summary:"导出字典类型"` g.Meta `path:"/base/export" method:"get" tags:"字典接口" summary:"导出字典类型"`
} }
type ExportRes struct{} type ExportRes struct{}

View File

@ -1,3 +1,9 @@
//
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package apiForm package apiForm
import ( import (
@ -7,7 +13,7 @@ import (
// 获取指定字典类型的属性数据 // 获取指定字典类型的属性数据
type DictAttributeReq struct { type DictAttributeReq struct {
Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" description:"字典类型"` g.Meta `path:"/dict/attribute" method:"get" tags:"字典接口" summary:"获取指定字典类型的属性数据"`
g.Meta `path:"/dict/attribute" method:"get" tags:"字典" summary:"获取指定字典类型的属性数据"` Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"`
} }
type DictAttributeRes []*entity.SysDictData type DictAttributeRes []*entity.SysDictData

View File

@ -1,3 +1,9 @@
//
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package apiForm package apiForm
import ( import (
@ -8,40 +14,40 @@ import (
// 清空日志 // 清空日志
type LogClearReq struct { type LogClearReq struct {
g.Meta `path:"/log/clear" method:"post" tags:"日志" summary:"清空日志"` g.Meta `path:"/log/clear" method:"post" tags:"日志接口" summary:"清空日志"`
} }
type LogClearRes struct{} type LogClearRes struct{}
// 导出 // 导出
type LogExportReq struct { type LogExportReq struct {
g.Meta `path:"/log/export" method:"get" tags:"日志接口" summary:"导出日志"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
Module string `json:"module" description:"应用端口"` Module string `json:"module" dc:"应用端口"`
MemberId int `json:"member_id" description:"用户ID"` MemberId int `json:"member_id" dc:"用户ID"`
TakeUpTime int `json:"take_up_time" description:"请求耗时"` TakeUpTime int `json:"take_up_time" dc:"请求耗时"`
Method string `json:"method" description:"请求方式"` Method string `json:"method" dc:"请求方式"`
Url string `json:"url" description:"请求路径"` Url string `json:"url" dc:"请求路径"`
Ip string `json:"ip" description:"访问IP"` Ip string `json:"ip" dc:"访问IP"`
ErrorCode string `json:"error_code" description:"状态码"` ErrorCode string `json:"error_code" dc:"状态码"`
g.Meta `path:"/log/export" method:"get" tags:"日志" summary:"导出日志"`
} }
type LogExportRes struct{} type LogExportRes struct{}
// 获取菜单列表 // 获取菜单列表
type LogListReq struct { type LogListReq struct {
g.Meta `path:"/log/list" method:"get" tags:"日志接口" summary:"获取日志列表"`
form.PageReq form.PageReq
form.RangeDateReq form.RangeDateReq
Module string `json:"module" description:"应用端口"` Module string `json:"module" dc:"应用端口"`
MemberId int `json:"member_id" description:"用户ID"` MemberId int `json:"member_id" dc:"用户ID"`
TakeUpTime int `json:"take_up_time" description:"请求耗时"` TakeUpTime int `json:"take_up_time" dc:"请求耗时"`
Method string `json:"method" description:"请求方式"` Method string `json:"method" dc:"请求方式"`
Url string `json:"url" description:"请求路径"` Url string `json:"url" dc:"请求路径"`
Ip string `json:"ip" description:"访问IP"` Ip string `json:"ip" dc:"访问IP"`
ErrorCode string `json:"error_code" description:"状态码"` ErrorCode string `json:"error_code" dc:"状态码"`
g.Meta `path:"/log/list" method:"get" tags:"日志" summary:"获取日志列表"`
} }
type LogListRes struct { type LogListRes struct {
List []*input.LogListModel `json:"list" description:"数据列表"` List []*input.LogListModel `json:"list" dc:"数据列表"`
form.PageRes form.PageRes
} }

View File

@ -1,3 +1,9 @@
//
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package apiForm package apiForm
import ( import (
@ -7,31 +13,31 @@ import (
// 注销登录 // 注销登录
type LoginLogoutReq struct { type LoginLogoutReq struct {
g.Meta `path:"/login/logout" method:"get" tags:"登录" summary:"注销登录"` g.Meta `path:"/login/logout" method:"get" tags:"登录接口" summary:"注销登录"`
} }
type LoginLogoutRes struct{} type LoginLogoutRes struct{}
// 登录效验 // 登录效验
type LoginCheckReq struct { type LoginCheckReq struct {
g.Meta `path:"/login/check" method:"get" tags:"登录" summary:"登录效验"` g.Meta `path:"/login/check" method:"get" tags:"登录接口" summary:"登录效验"`
} }
type LoginCheckRes struct { type LoginCheckRes struct {
IsValidCodeLogin bool `json:"isValidCodeLogin" description:"是否验证码"` IsValidCodeLogin bool `json:"isValidCodeLogin" dc:"是否验证码"`
Message string `json:"message" description:"消息"` Message string `json:"message" dc:"消息"`
Result string `json:"result" description:"响应"` Result string `json:"result" dc:"响应"`
// Sessionid string `json:"sessionid" description:"sessionid"` // Sessionid string `json:"sessionid" dc:"sessionid"`
} }
// 提交登录 // 提交登录
type LoginReq struct { type LoginReq struct {
g.Meta `path:"/login/sign" method:"post" tags:"登录" summary:"提交登录"` g.Meta `path:"/login/sign" method:"post" tags:"登录接口" summary:"提交登录"`
Username string `json:"username" v:"required#用户名不能为空" description:"用户名"` Username string `json:"username" v:"required#用户名不能为空" dc:"用户名"`
Password string `json:"password" v:"required#密码不能为空" description:"密码"` Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
Cid string `json:"cid" v:"required#验证码ID不能为空" description:"验证码ID"` Cid string `json:"cid" v:"required#验证码ID不能为空" dc:"验证码ID"`
Code string `json:"code" v:"required#验证码不能为空" description:"验证码"` Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"`
Device string `json:"device" description:"登录设备"` Device string `json:"device" dc:"登录设备"`
} }
type LoginRes struct { type LoginRes struct {
model.Identity model.Identity
Token string `json:"token" v:"" description:"登录token"` Token string `json:"token" dc:"登录token"`
} }

View File

@ -1,3 +1,9 @@
//
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package apiForm package apiForm
import ( import (
@ -7,14 +13,14 @@ import (
// 获取登录用户的基本信息 // 获取登录用户的基本信息
type MemberProfileReq struct { type MemberProfileReq struct {
g.Meta `path:"/member/profile" method:"get" tags:"会员" summary:"获取登录用户的基本信息"` g.Meta `path:"/member/profile" method:"get" tags:"会员接口" summary:"获取登录用户的基本信息"`
} }
type MemberProfileRes struct { type MemberProfileRes struct {
PostGroup string `json:"postGroup" description:"岗位名称"` PostGroup string `json:"postGroup" dc:"岗位名称"`
RoleGroup string `json:"roleGroup" description:"角色名称"` RoleGroup string `json:"roleGroup" dc:"角色名称"`
User *input.AdminMemberViewModel `json:"user" description:"用户基本信息"` User *input.AdminMemberViewModel `json:"user" dc:"用户基本信息"`
SysDept *input.AdminDeptViewModel `json:"sysDept" description:"部门信息"` SysDept *input.AdminDeptViewModel `json:"sysDept" dc:"部门信息"`
SysRoles []*input.AdminRoleListModel `json:"sysRoles" description:"角色列表"` SysRoles []*input.AdminRoleListModel `json:"sysRoles" dc:"角色列表"`
PostIds int64 `json:"postIds" description:"当前岗位"` PostIds int64 `json:"postIds" dc:"当前岗位"`
RoleIds int64 `json:"roleIds" description:"当前角色"` RoleIds int64 `json:"roleIds" dc:"当前角色"`
} }

View File

@ -8,21 +8,21 @@ package form
// 分页 // 分页
type PageReq struct { type PageReq struct {
Page int `json:"page" example:"10" d:"1" v:"min:1#页码最小值不能低于1" description:"当前页码"` Page int `json:"page" example:"10" d:"1" v:"min:1#页码最小值不能低于1" dc:"当前页码"`
Limit int `json:"limit" example:"1" d:"10" v:"min:1|max:100#|每页数量最小值不能低于1|最大值不能大于100" description:"每页数量"` Limit int `json:"limit" example:"1" d:"10" v:"min:1|max:100#|每页数量最小值不能低于1|最大值不能大于100" dc:"每页数量"`
} }
type PageRes struct { type PageRes struct {
PageReq PageReq
TotalCount int `json:"total_count" example:"0" description:"全部数据量"` TotalCount int `json:"total_count" example:"0" dc:"全部数据量"`
} }
// 时间查询 // 时间查询
type RangeDateReq struct { type RangeDateReq struct {
StartTime string `json:"start_time" v:"date#开始日期格式不正确" description:"开始日期"` StartTime string `json:"start_time" v:"date#开始日期格式不正确" dc:"开始日期"`
EndTime string `json:"end_time" v:"date#结束日期格式不正确" description:"结束日期"` EndTime string `json:"end_time" v:"date#结束日期格式不正确" dc:"结束日期"`
} }
// 状态查询 // 状态查询
type StatusReq struct { type StatusReq struct {
Status int `json:"status" v:"in:0,1,2,3#状态可选范围0~3" description:"状态"` Status int `json:"status" v:"in:0,1,2,3#状态可选范围0~3" dc:"状态"`
} }

View File

@ -39,6 +39,13 @@ func (s *sHook) GlobalLog(r *ghttp.Request) {
ctx = r.Context() ctx = r.Context()
) )
// 没有上下文的请求不记录doc、favicon.ico等非服务类业务
modelCtx := com.Context.Get(ctx)
if modelCtx == nil {
return
}
// 计算运行耗时
com.Context.SetTakeUpTime(ctx, gtime.TimestampMilli()-r.EnterTime) com.Context.SetTakeUpTime(ctx, gtime.TimestampMilli()-r.EnterTime)
go sysService.Log.AutoLog(ctx) go sysService.Log.AutoLog(ctx)

View File

@ -11,7 +11,6 @@ import (
"github.com/bufanyun/hotgo/app/consts" "github.com/bufanyun/hotgo/app/consts"
"github.com/bufanyun/hotgo/app/utils" "github.com/bufanyun/hotgo/app/utils"
"github.com/gogf/gf/v2/errors/gcode" "github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp" "github.com/gogf/gf/v2/net/ghttp"
) )
@ -60,13 +59,17 @@ func (s *sMiddleware) HandlerResponse(r *ghttp.Request) {
data = utils.Charset.GetStack(err) data = utils.Charset.GetStack(err)
} }
} else if data, err = r.GetHandlerResponse(); err != nil { //} else if data, err = r.GetHandlerResponse(); err != nil {
errCode := gerror.Code(err) // errCode := gerror.Code(err)
if errCode == gcode.CodeNil { // if errCode == gcode.CodeNil {
errCode = gcode.CodeInternalError // errCode = gcode.CodeInternalError
} // }
code = errCode.Code() // code = errCode.Code()
message = err.Error() // message = err.Error()
//}
} else {
data = r.GetHandlerResponse()
} }
// TODO 返回固定的友好信息 // TODO 返回固定的友好信息

View File

@ -8,6 +8,7 @@ hotgo:
module: ["admin", "api"] # 需要记录的模块 module: ["admin", "api"] # 需要记录的模块
skipCode: [] # 不记录的状态码 ["0", "-1"] skipCode: [] # 不记录的状态码 ["0", "-1"]
# 路由配置 # 路由配置
router: router:
# 后台 # 后台
@ -65,6 +66,7 @@ logger:
level: "all" level: "all"
file: "{Y-m-d}.log" file: "{Y-m-d}.log"
#JWT #JWT
jwt: jwt:
version: "1.0" # 版本号 version: "1.0" # 版本号
@ -72,26 +74,28 @@ jwt:
sign: "hotgo" # 秘钥考虑安全问题请修改默认值 sign: "hotgo" # 秘钥考虑安全问题请修改默认值
multiPort: true # 是否允许多端登录默认为true multiPort: true # 是否允许多端登录默认为true
#消息队列 #消息队列
queue: queue:
switch: true # 队列开关默认为true switch: false # 队列开关默认为false
driver: "redis" # 队列驱动可选redis|rocketmq|kafka driver: "redis" # 队列驱动可选redis|rocketmq|kafka
retry: 2 # 重试次数 retry: 2 # 重试次数
multiComsumer: true # 是否支持创建多个消费者 multiComsumer: true # 是否支持创建多个消费者
groupName: "hotgo" # mq群组名称 groupName: "hotgo" # mq群组名称
redis: redis:
address: "127.0.0.1:6379" # redis服务地址默认为127.0.0.1:6379 address: "127.0.0.1:6379" # redis服务地址默认为127.0.0.1:6379
db: 5 # 指定redis库 db: 5 # 指定redis库
pass: "meng133814250" # redis密码 pass: "meng133814250" # redis密码
timeout: 0 # 队列超时时间(s) 0为永不超时当队列一直没有被消费到达超时时间则队列会被销毁 timeout: 0 # 队列超时时间(s) 0为永不超时当队列一直没有被消费到达超时时间则队列会被销毁
rocketmq: rocketmq:
address: "127.0.0.1:9876" # brocker地址+端口 address: "127.0.0.1:9876" # brocker地址+端口
logLevel: "all" # 系统日志级别可选all|close|debug|info|warn|error|fatal logLevel: "all" # 系统日志级别可选all|close|debug|info|warn|error|fatal
kafka: kafka:
address: "127.0.0.1:9092" # kafka地址+端口 address: "127.0.0.1:9092" # kafka地址+端口
version: "2.0.0.0" # kafka专属配置默认2.0.0.0 version: "2.0.0.0" # kafka专属配置默认2.0.0.0
randClient: true # 开启随机生成clientID可以实现启动多实例同时一起消费相同topic加速消费能力的特性默认为true randClient: true # 开启随机生成clientID可以实现启动多实例同时一起消费相同topic加速消费能力的特性默认为true
# Redis数据库配置 # Redis数据库配置
redis: redis:
default: default:
@ -105,6 +109,7 @@ redis:
# pass: "hg123456." # pass: "hg123456."
# idleTimeout: "20" # idleTimeout: "20"
# Database. # Database.
database: database:
logger: logger:
@ -116,6 +121,7 @@ database:
debug: true debug: true
Prefix: "hg_" Prefix: "hg_"
# CLI. # CLI.
gfcli: gfcli:
build: build:

View File

@ -8,10 +8,9 @@ require (
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394
github.com/bufanyun/pool v0.2.1 github.com/bufanyun/pool v0.2.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gogf/gf/v2 v2.0.0-rc2 github.com/gogf/gf/v2 v2.0.4
github.com/gomodule/redigo v2.0.0+incompatible github.com/gomodule/redigo v2.0.0+incompatible
github.com/google/btree v1.0.1 // indirect github.com/google/btree v1.0.1 // indirect
github.com/ip2location/ip2location-go v8.3.0+incompatible
github.com/json-iterator/go v1.1.10 // indirect github.com/json-iterator/go v1.1.10 // indirect
github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794 github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect

View File

@ -47,8 +47,8 @@ github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Px
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/gogf/gf/v2 v2.0.0-rc2 h1:WznHd6sGOQ0ef1r4UdejUnXHT4058b1R/cumQL5tooE= github.com/gogf/gf/v2 v2.0.4 h1:m5F/f2lX+etXhI6rAQCR6szQoHE1ulAYlIvH0UXa2wM=
github.com/gogf/gf/v2 v2.0.0-rc2/go.mod h1:apktt6TleWtCIwpz63vBqUnw8MX8gWKoZyxgDpXFtgM= github.com/gogf/gf/v2 v2.0.4/go.mod h1:apktt6TleWtCIwpz63vBqUnw8MX8gWKoZyxgDpXFtgM=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= 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/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s=
@ -91,8 +91,6 @@ github.com/grokify/html-strip-tags-go v0.0.1/go.mod h1:2Su6romC5/1VXOQMaWL2yb618
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ip2location/ip2location-go v8.3.0+incompatible h1:QwUE+FlSbo6bjOWZpv2Grb57vJhWYFNPyBj2KCvfWaM=
github.com/ip2location/ip2location-go v8.3.0+incompatible/go.mod h1:3JUY1TBjTx1GdA7oRT7Zeqfc0bg3lMMuU5lXmzdpuME=
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=