diff --git a/hotgo-server/app/com/cache_com.go b/hotgo-server/app/com/cache_com.go index 972bdaa..1c8ac0e 100644 --- a/hotgo-server/app/com/cache_com.go +++ b/hotgo-server/app/com/cache_com.go @@ -11,12 +11,10 @@ import ( "github.com/gogf/gf/v2/os/gcache" ) -type cache struct { -} +// 缓存 +var Cache = new(cache) -var ( - Cache = new(cache) -) +type cache struct{} func (component *cache) New() *gcache.Cache { c := gcache.New() diff --git a/hotgo-server/app/com/captcha_com.go b/hotgo-server/app/com/captcha_com.go index 965189f..e6a3b62 100644 --- a/hotgo-server/app/com/captcha_com.go +++ b/hotgo-server/app/com/captcha_com.go @@ -13,13 +13,14 @@ import ( "github.com/mojocn/base64Captcha" ) +// 验证码 var Captcha = new(captcha) type captcha struct{} // //  @Title  获取字母数字混合验证码 -//  @Description  +//  @Description //  @Author  Ms <133814250@qq.com> //  @Param   ctx //  @Return  idKeyC @@ -27,27 +28,27 @@ type captcha struct{} // func (component *captcha) GetVerifyImgString(ctx context.Context) (idKeyC string, base64stringC string) { driver := &base64Captcha.DriverString{ - Height: 80, - Width: 240, + Height: 80, + Width: 240, //NoiseCount: 50, //ShowLineOptions: 20, - Length: 4, - Source: "abcdefghjkmnpqrstuvwxyz23456789", - Fonts: []string{"chromohv.ttf"}, + Length: 4, + Source: "abcdefghjkmnpqrstuvwxyz23456789", + Fonts: []string{"chromohv.ttf"}, } driver = driver.ConvertFonts() store := base64Captcha.DefaultMemStore c := base64Captcha.NewCaptcha(driver, store) idKeyC, base64stringC, err := c.Generate() if err != nil { - g.Log().Error(ctx,err) + g.Log().Error(ctx, err) } return } // //  @Title  验证输入的验证码是否正确 -//  @Description  +//  @Description //  @Author  Ms <133814250@qq.com> //  @Param   id //  @Param   answer @@ -59,4 +60,4 @@ func (component *captcha) VerifyString(id, answer string) bool { c := base64Captcha.NewCaptcha(driver, store) answer = gstr.ToLower(answer) return c.Verify(id, answer, true) -} \ No newline at end of file +} diff --git a/hotgo-server/app/com/context_com.go b/hotgo-server/app/com/context_com.go index 622e512..8f9cb4f 100644 --- a/hotgo-server/app/com/context_com.go +++ b/hotgo-server/app/com/context_com.go @@ -13,10 +13,11 @@ import ( "github.com/gogf/gf/v2/net/ghttp" ) -type comContext struct{} - +// 上下文 var Context = new(comContext) +type comContext struct{} + // //  @Title  初始化上下文对象指针到上下文对象中,以便后续的请求流程中可以修改 //  @Description diff --git a/hotgo-server/app/com/ip_com.go b/hotgo-server/app/com/ip_com.go index 1506bbc..54e1022 100644 --- a/hotgo-server/app/com/ip_com.go +++ b/hotgo-server/app/com/ip_com.go @@ -19,6 +19,7 @@ import ( "time" ) +// IP归属地 var Ip = new(ip) type ip struct{} diff --git a/hotgo-server/app/com/jwt_com.go b/hotgo-server/app/com/jwt_com.go index 9bd1275..4495023 100644 --- a/hotgo-server/app/com/jwt_com.go +++ b/hotgo-server/app/com/jwt_com.go @@ -21,6 +21,7 @@ import ( "time" ) +// jwt鉴权 type JWT struct{} var Jwt = new(JWT) diff --git a/hotgo-server/app/com/response_com.go b/hotgo-server/app/com/response_com.go index f21fc2c..782a690 100644 --- a/hotgo-server/app/com/response_com.go +++ b/hotgo-server/app/com/response_com.go @@ -14,6 +14,7 @@ import ( "time" ) +// 统一响应 var Response = new(response) type response struct{} diff --git a/hotgo-server/app/consts/openapi_consts.go b/hotgo-server/app/consts/openapi_consts.go index 886dc49..4c3fc65 100644 --- a/hotgo-server/app/consts/openapi_consts.go +++ b/hotgo-server/app/consts/openapi_consts.go @@ -8,8 +8,8 @@ package consts // 开放API const ( - OpenAPITitle = `HotGo` - OpenAPIDescription = `这是一个使用HotGo的简单演示HTTP服务器项目。 ` - OpenAPIName = `HotGo` - OpenAPIURL = `http://hotgo.bufanyun.cn` + OpenAPITitle = `HotGo` + OpenAPIDescription = `这是一个使用HotGo的简单演示HTTP服务器项目。 ` + OpenAPIName = `HotGo` + OpenAPIURL = `https://github.com/bufanyun/hotgo` ) diff --git a/hotgo-server/app/consts/status_consts.go b/hotgo-server/app/consts/status_consts.go index cdcaf22..bb6c116 100644 --- a/hotgo-server/app/consts/status_consts.go +++ b/hotgo-server/app/consts/status_consts.go @@ -6,9 +6,9 @@ // package consts -// +// 状态码 const ( StatusEnabled = "1" // 启用 StatusDisable = "2" // 禁用 - StatusDelete = "3" //已删除 + StatusDelete = "3" // 已删除 ) diff --git a/hotgo-server/app/controller/adminController/config_controller.go b/hotgo-server/app/controller/adminController/config_controller.go index cb100ea..4788395 100644 --- a/hotgo-server/app/controller/adminController/config_controller.go +++ b/hotgo-server/app/controller/adminController/config_controller.go @@ -8,6 +8,7 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) +// 配置 var Config = config{} type config struct{} diff --git a/hotgo-server/app/controller/adminController/dept_controller.go b/hotgo-server/app/controller/adminController/dept_controller.go index 7f615be..47dc548 100644 --- a/hotgo-server/app/controller/adminController/dept_controller.go +++ b/hotgo-server/app/controller/adminController/dept_controller.go @@ -8,6 +8,7 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) +// 部门 var Dept = dept{} type dept struct{} diff --git a/hotgo-server/app/controller/adminController/dict_controller.go b/hotgo-server/app/controller/adminController/dict_controller.go index cecf3f6..6b286fa 100644 --- a/hotgo-server/app/controller/adminController/dict_controller.go +++ b/hotgo-server/app/controller/adminController/dict_controller.go @@ -6,6 +6,7 @@ import ( "github.com/bufanyun/hotgo/app/service/sysService" ) +// 字典 var Dict = dict{} type dict struct{} diff --git a/hotgo-server/app/controller/adminController/log_controller.go b/hotgo-server/app/controller/adminController/log_controller.go index b934841..b400f1e 100644 --- a/hotgo-server/app/controller/adminController/log_controller.go +++ b/hotgo-server/app/controller/adminController/log_controller.go @@ -8,6 +8,7 @@ import ( "github.com/gogf/gf/v2/errors/gerror" ) +// 日志 var Log = log{} type log struct{} diff --git a/hotgo-server/app/controller/adminController/member_controller.go b/hotgo-server/app/controller/adminController/member_controller.go index b15b415..31f6042 100644 --- a/hotgo-server/app/controller/adminController/member_controller.go +++ b/hotgo-server/app/controller/adminController/member_controller.go @@ -16,6 +16,7 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) +// 会员 var Member = member{} type member struct{} diff --git a/hotgo-server/app/controller/adminController/menu_controller.go b/hotgo-server/app/controller/adminController/menu_controller.go index 84357bd..713293d 100644 --- a/hotgo-server/app/controller/adminController/menu_controller.go +++ b/hotgo-server/app/controller/adminController/menu_controller.go @@ -14,6 +14,7 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) +// 菜单 var Menu = menu{} type menu struct{} diff --git a/hotgo-server/app/controller/adminController/notice_controller.go b/hotgo-server/app/controller/adminController/notice_controller.go index 36ab285..08d23c5 100644 --- a/hotgo-server/app/controller/adminController/notice_controller.go +++ b/hotgo-server/app/controller/adminController/notice_controller.go @@ -8,6 +8,7 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) +// 公告 var Notice = notice{} type notice struct{} diff --git a/hotgo-server/app/controller/adminController/post_controller.go b/hotgo-server/app/controller/adminController/post_controller.go index c955910..856ef38 100644 --- a/hotgo-server/app/controller/adminController/post_controller.go +++ b/hotgo-server/app/controller/adminController/post_controller.go @@ -8,6 +8,7 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) +// 岗位 var Post = post{} type post struct{} diff --git a/hotgo-server/app/controller/adminController/role_controller.go b/hotgo-server/app/controller/adminController/role_controller.go index 16d59c5..ddb66e1 100644 --- a/hotgo-server/app/controller/adminController/role_controller.go +++ b/hotgo-server/app/controller/adminController/role_controller.go @@ -15,6 +15,7 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) +// 角色 var Role = role{} type role struct{} diff --git a/hotgo-server/app/controller/apiController/base_controller.go b/hotgo-server/app/controller/apiController/base_controller.go index 77c7ad5..a41462b 100644 --- a/hotgo-server/app/controller/apiController/base_controller.go +++ b/hotgo-server/app/controller/apiController/base_controller.go @@ -17,6 +17,7 @@ import ( "time" ) +// 基础 var Base = base{} type base struct{} diff --git a/hotgo-server/app/controller/apiController/dict_controller.go b/hotgo-server/app/controller/apiController/dict_controller.go index 7d22a59..3ad8ba2 100644 --- a/hotgo-server/app/controller/apiController/dict_controller.go +++ b/hotgo-server/app/controller/apiController/dict_controller.go @@ -6,6 +6,7 @@ import ( "github.com/bufanyun/hotgo/app/service/sysService" ) +// 字典 var Dict = dict{} type dict struct{} diff --git a/hotgo-server/app/controller/apiController/log_controller.go b/hotgo-server/app/controller/apiController/log_controller.go index 685599e..dcd7b37 100644 --- a/hotgo-server/app/controller/apiController/log_controller.go +++ b/hotgo-server/app/controller/apiController/log_controller.go @@ -8,6 +8,7 @@ import ( "github.com/gogf/gf/v2/errors/gerror" ) +// 日志 var Log = log{} type log struct{} diff --git a/hotgo-server/app/controller/apiController/login_controller.go b/hotgo-server/app/controller/apiController/login_controller.go index fc14477..e187048 100644 --- a/hotgo-server/app/controller/apiController/login_controller.go +++ b/hotgo-server/app/controller/apiController/login_controller.go @@ -12,6 +12,7 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) +// 登录 var Login = login{} type login struct{} diff --git a/hotgo-server/app/controller/apiController/member_controller.go b/hotgo-server/app/controller/apiController/member_controller.go index e10ed47..8e6e7c2 100644 --- a/hotgo-server/app/controller/apiController/member_controller.go +++ b/hotgo-server/app/controller/apiController/member_controller.go @@ -9,6 +9,7 @@ import ( "github.com/gogf/gf/v2/errors/gerror" ) +// 会员 var Member = member{} type member struct{} diff --git a/hotgo-server/app/factory/queue/logger.go b/hotgo-server/app/factory/queue/logger.go index 1f61a76..6f458a8 100644 --- a/hotgo-server/app/factory/queue/logger.go +++ b/hotgo-server/app/factory/queue/logger.go @@ -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 import ( @@ -7,7 +13,6 @@ import ( "github.com/gogf/gf/v2/util/gconv" ) - // 消费日志 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) } -// 通用 +// 通用日志 func Log(ctx context.Context, text string) { g.Log(consts.QueueLogPath).Print(ctx, text) } diff --git a/hotgo-server/app/factory/queue/rocketmq_rewrite_logger.go b/hotgo-server/app/factory/queue/rocketmq_rewrite_logger.go index 262c609..0af8f51 100644 --- a/hotgo-server/app/factory/queue/rocketmq_rewrite_logger.go +++ b/hotgo-server/app/factory/queue/rocketmq_rewrite_logger.go @@ -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 import ( diff --git a/hotgo-server/app/form/adminForm/config_form.go b/hotgo-server/app/form/adminForm/config_form.go index 5fbe83c..f819dd0 100644 --- a/hotgo-server/app/form/adminForm/config_form.go +++ b/hotgo-server/app/form/adminForm/config_form.go @@ -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 import ( @@ -9,41 +15,41 @@ import ( // 获取指定配置键的值 type ConfigGetValueReq struct { - Key string `json:"key" v:"required#配置键不能为空" description:"配置键"` g.Meta `path:"/config/get_value" method:"get" tags:"配置" summary:"获取指定配置键的值"` + Key string `json:"key" v:"required#配置键不能为空" dc:"配置键"` } type ConfigGetValueRes struct { - Value string `json:"value" description:"配置值"` + Value string `json:"value" dc:"配置值"` } // 名称是否唯一 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:"配置名称是否唯一"` + Name string `json:"name" v:"required#配置名称不能为空" dc:"配置名称"` + Id int64 `json:"id" dc:"配置ID"` } type ConfigNameUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 查询列表 type ConfigListReq struct { + g.Meta `path:"/config/list" method:"get" tags:"配置" summary:"获取配置列表"` form.PageReq form.RangeDateReq form.StatusReq - Name string `json:"name" description:"配置名称"` - g.Meta `path:"/config/list" method:"get" tags:"配置" summary:"获取配置列表"` + Name string `json:"name" dc:"配置名称"` } type ConfigListRes struct { - List []*input.SysConfigListModel `json:"list" description:"数据列表"` + List []*input.SysConfigListModel `json:"list" dc:"数据列表"` form.PageRes } // 获取指定信息 type ConfigViewReq struct { - Id string `json:"id" v:"required#配置ID不能为空" description:"配置ID"` g.Meta `path:"/config/view" method:"get" tags:"配置" summary:"获取指定信息"` + Id string `json:"id" v:"required#配置ID不能为空" dc:"配置ID"` } type ConfigViewRes struct { *input.SysConfigViewModel @@ -51,23 +57,23 @@ type ConfigViewRes struct { // 修改/新增 type ConfigEditReq struct { - entity.SysConfig g.Meta `path:"/config/edit" method:"post" tags:"配置" summary:"修改/新增配置"` + entity.SysConfig } type ConfigEditRes struct{} // 删除 type ConfigDeleteReq struct { - Id interface{} `json:"id" v:"required#配置ID不能为空" description:"配置ID"` g.Meta `path:"/config/delete" method:"post" tags:"配置" summary:"删除配置"` + Id interface{} `json:"id" v:"required#配置ID不能为空" dc:"配置ID"` } type ConfigDeleteRes struct{} // 最大排序 type ConfigMaxSortReq struct { - Id int64 `json:"id" description:"配置ID"` g.Meta `path:"/config/max_sort" method:"get" tags:"配置" summary:"配置最大排序"` + Id int64 `json:"id" dc:"配置ID"` } type ConfigMaxSortRes struct { - Sort int `json:"sort" description:"排序"` + Sort int `json:"sort" dc:"排序"` } diff --git a/hotgo-server/app/form/adminForm/dept_form.go b/hotgo-server/app/form/adminForm/dept_form.go index bda2890..de15dce 100644 --- a/hotgo-server/app/form/adminForm/dept_form.go +++ b/hotgo-server/app/form/adminForm/dept_form.go @@ -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 import ( @@ -8,17 +14,17 @@ import ( // 名称是否唯一 type DeptNameUniqueReq struct { - Name string `json:"name" v:"required#部门名称不能为空" description:"部门名称"` - Id int64 `json:"id" description:"部门ID"` + Name string `json:"name" v:"required#部门名称不能为空" dc:"部门名称"` + Id int64 `json:"id" dc:"部门ID"` g.Meta `path:"/dept/name_unique" method:"get" tags:"部门" summary:"部门名称是否唯一"` } type DeptNameUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 查询列表树 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:"获取部门列表树"` } @@ -26,7 +32,7 @@ type DeptListTreeRes []*input.AdminDeptListTreeModel // 查询列表 type DeptListReq struct { - Name string `json:"name" description:"部门名称"` + Name string `json:"name" dc:"部门名称"` g.Meta `path:"/dept/list" method:"get" tags:"部门" summary:"获取部门列表"` } @@ -34,7 +40,7 @@ type DeptListRes []*input.AdminDeptListModel // 获取指定信息 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:"获取指定信息"` } type DeptViewRes struct { @@ -50,16 +56,16 @@ type DeptEditRes 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:"删除部门"` } type DeptDeleteRes 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:"部门最大排序"` } type DeptMaxSortRes struct { - Sort int `json:"sort" description:"排序"` + Sort int `json:"sort" dc:"排序"` } diff --git a/hotgo-server/app/form/adminForm/dict_form.go b/hotgo-server/app/form/adminForm/dict_form.go index b2df2a8..60e39b1 100644 --- a/hotgo-server/app/form/adminForm/dict_form.go +++ b/hotgo-server/app/form/adminForm/dict_form.go @@ -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 import ( @@ -10,42 +16,42 @@ import ( // 数据键值是否唯一 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:"数据键值是否唯一"` + 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 { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 查询字典数据最大排序 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:"查询字典数据最大排序"` + Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"` } type DictDataMaxSortRes struct { - Sort int `json:"sort" description:"排序"` + Sort int `json:"sort" dc:"排序"` } // 修改/新增字典数据 type DictDataEditReq struct { - entity.SysDictData g.Meta `path:"/dict_data/edit" method:"post" tags:"字典" summary:"修改/新增字典数据"` + entity.SysDictData } type DictDataEditRes struct{} // 删除字典类型 type DictDataDeleteReq struct { - Id interface{} `json:"id" v:"required#字典数据ID不能为空" description:"字典数据ID"` g.Meta `path:"/dict_data/delete" method:"post" tags:"字典" summary:"删除字典数据"` + Id interface{} `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"` } type DictDataDeleteRes struct{} // 获取指定字典数据信息 type DictDataViewReq struct { - Id string `json:"id" v:"required#字典数据ID不能为空" description:"字典数据ID"` g.Meta `path:"/dict_data/view" method:"get" tags:"字典" summary:"获取指定字典数据信息"` + Id string `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"` } type DictDataViewRes struct { *entity.SysDictData @@ -53,19 +59,19 @@ type DictDataViewRes 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:"获取字典数据列表"` + form.PageReq + Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"` } type DictDataListRes struct { - List []*entity.SysDictData `json:"list" description:"数据列表"` + List []*entity.SysDictData `json:"list" dc:"数据列表"` form.PageRes } // 获取指定字典类型的属性数据 type DictAttributeReq struct { - Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" description:"字典类型"` g.Meta `path:"/dict/attribute" method:"get" tags:"字典" summary:"获取指定字典类型的属性数据"` + Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"` } type DictAttributeRes []*entity.SysDictData @@ -73,12 +79,12 @@ type DictAttributeRes []*entity.SysDictData // 修改/新增字典类型 type DictTypeExportReq struct { + g.Meta `path:"/dict_type/export" method:"get" tags:"字典" summary:"导出字典类型"` form.PageReq form.RangeDateReq form.StatusReq - Name string `json:"name" description:"字典名称"` - Type string `json:"type" description:"字典类型"` - g.Meta `path:"/dict_type/export" method:"get" tags:"字典" summary:"导出字典类型"` + Name string `json:"name" dc:"字典名称"` + Type string `json:"type" dc:"字典类型"` } type DictTypeExportRes struct{} @@ -90,36 +96,36 @@ type DictTypeRefreshCacheRes struct{} // 获取字典类型列表 type DictTypeListReq struct { + g.Meta `path:"/dict_type/list" method:"get" tags:"字典" summary:"获取字典类型列表"` form.PageReq form.RangeDateReq form.StatusReq - Name string `json:"name" description:"字典名称"` - Type string `json:"type" description:"字典类型"` - g.Meta `path:"/dict_type/list" method:"get" tags:"字典" summary:"获取字典类型列表"` + Name string `json:"name" dc:"字典名称"` + Type string `json:"type" dc:"字典类型"` } type DictTypeListRes struct { - List []*entity.SysDictType `json:"list" description:"数据列表"` + List []*entity.SysDictType `json:"list" dc:"数据列表"` form.PageRes } // 修改/新增字典类型 type DictTypeEditReq struct { - entity.SysDictType g.Meta `path:"/dict_type/edit" method:"post" tags:"字典" summary:"修改/新增字典类型"` + entity.SysDictType } type DictTypeEditRes struct{} // 删除字典类型 type DictTypeDeleteReq struct { - Id interface{} `json:"id" v:"required#字典类型ID不能为空" description:"字典类型ID"` g.Meta `path:"/dict_type/delete" method:"post" tags:"字典" summary:"删除字典类型"` + Id interface{} `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"` } type DictTypeDeleteRes struct{} // 获取指定字典类型信息 type DictTypeViewReq struct { - Id string `json:"id" v:"required#字典类型ID不能为空" description:"字典类型ID"` g.Meta `path:"/dict_type/view" method:"get" tags:"字典" summary:"获取指定字典类型信息"` + Id string `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"` } type DictTypeViewRes struct { *entity.SysDictType @@ -127,10 +133,10 @@ type DictTypeViewRes 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:"类型是否唯一"` + Type string `json:"type" example:"sys_common_status" v:"required#字典类型不能为空" dc:"字典类型"` + Id int64 `json:"id" dc:"字典类型ID"` } type DictTypeUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } diff --git a/hotgo-server/app/form/adminForm/log_form.go b/hotgo-server/app/form/adminForm/log_form.go index dcba676..ab727ac 100644 --- a/hotgo-server/app/form/adminForm/log_form.go +++ b/hotgo-server/app/form/adminForm/log_form.go @@ -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 import ( @@ -14,34 +20,34 @@ type LogClearRes struct{} // 导出 type LogExportReq struct { + g.Meta `path:"/log/export" method:"get" tags:"日志" summary:"导出日志"` form.PageReq form.RangeDateReq - Module string `json:"module" description:"应用端口"` - MemberId int `json:"member_id" description:"用户ID"` - TakeUpTime int `json:"take_up_time" description:"请求耗时"` - Method string `json:"method" description:"请求方式"` - Url string `json:"url" description:"请求路径"` - Ip string `json:"ip" description:"访问IP"` - ErrorCode string `json:"error_code" description:"状态码"` - g.Meta `path:"/log/export" method:"get" tags:"日志" summary:"导出日志"` + Module string `json:"module" dc:"应用端口"` + MemberId int `json:"member_id" dc:"用户ID"` + TakeUpTime int `json:"take_up_time" dc:"请求耗时"` + Method string `json:"method" dc:"请求方式"` + Url string `json:"url" dc:"请求路径"` + Ip string `json:"ip" dc:"访问IP"` + ErrorCode string `json:"error_code" dc:"状态码"` } type LogExportRes struct{} // 获取菜单列表 type LogListReq struct { + g.Meta `path:"/log/list" method:"get" tags:"日志" summary:"获取日志列表"` form.PageReq form.RangeDateReq - Module string `json:"module" description:"应用端口"` - MemberId int `json:"member_id" description:"用户ID"` - TakeUpTime int `json:"take_up_time" description:"请求耗时"` - Method string `json:"method" description:"请求方式"` - Url string `json:"url" description:"请求路径"` - Ip string `json:"ip" description:"访问IP"` - ErrorCode string `json:"error_code" description:"状态码"` - g.Meta `path:"/log/list" method:"get" tags:"日志" summary:"获取日志列表"` + Module string `json:"module" dc:"应用端口"` + MemberId int `json:"member_id" dc:"用户ID"` + TakeUpTime int `json:"take_up_time" dc:"请求耗时"` + Method string `json:"method" dc:"请求方式"` + Url string `json:"url" dc:"请求路径"` + Ip string `json:"ip" dc:"访问IP"` + ErrorCode string `json:"error_code" dc:"状态码"` } type LogListRes struct { - List []*input.LogListModel `json:"list" description:"数据列表"` + List []*input.LogListModel `json:"list" dc:"数据列表"` form.PageRes } diff --git a/hotgo-server/app/form/adminForm/login_form.go b/hotgo-server/app/form/adminForm/login_form.go index 5904a93..b9e04a1 100644 --- a/hotgo-server/app/form/adminForm/login_form.go +++ b/hotgo-server/app/form/adminForm/login_form.go @@ -22,20 +22,20 @@ type LoginCaptchaReq struct { g.Meta `path:"/login/captcha" method:"get" tags:"登录" summary:"获取登录验证码"` } type LoginCaptchaRes struct { - Cid string `json:"cid" v:"" description:"验证码ID"` - Base64 string `json:"base64" v:"" description:"验证码"` + Cid string `json:"cid" dc:"验证码ID"` + Base64 string `json:"base64" dc:"验证码"` } // 提交登录 type LoginReq struct { g.Meta `path:"/login/sign" method:"post" tags:"登录" summary:"提交登录"` - Username string `json:"username" v:"required#用户名不能为空" description:"用户名"` - Password string `json:"password" v:"required#密码不能为空" description:"密码"` - Cid string `json:"cid" v:"required#验证码ID不能为空" description:"验证码ID"` - Code string `json:"code" v:"required#验证码不能为空" description:"验证码"` - Device string `json:"device" description:"登录设备"` + Username string `json:"username" v:"required#用户名不能为空" dc:"用户名"` + Password string `json:"password" v:"required#密码不能为空" dc:"密码"` + Cid string `json:"cid" v:"required#验证码ID不能为空" dc:"验证码ID"` + Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"` + Device string `json:"device" dc:"登录设备"` } type LoginRes struct { model.Identity - Token string `json:"token" v:"" description:"登录token"` + Token string `json:"token" dc:"登录token"` } diff --git a/hotgo-server/app/form/adminForm/member_form.go b/hotgo-server/app/form/adminForm/member_form.go index 3fb8e53..7d37583 100644 --- a/hotgo-server/app/form/adminForm/member_form.go +++ b/hotgo-server/app/form/adminForm/member_form.go @@ -17,18 +17,18 @@ import ( // 更新会员资料 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:"更新会员资料"` + Mobile int `json:"mobile" dc:"手机号"` + Email string `json:"email" dc:"邮箱"` + Realname string `json:"realname" dc:"真实姓名"` } type MemberUpdateProfileRes 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:"重置密码"` + OldPassword string `json:"oldPassword" v:"required#原密码不能为空" dc:"原密码"` + NewPassword string `json:"newPassword" v:"required|length:6,16#新密码不能为空#新密码需在6~16之间" dc:"新密码"` } type MemberUpdatePwdRes struct{} @@ -37,176 +37,176 @@ type MemberProfileReq struct { g.Meta `path:"/member/profile" method:"get" tags:"会员" summary:"获取登录用户的基本信息"` } type MemberProfileRes struct { - PostGroup string `json:"postGroup" description:"岗位名称"` - RoleGroup string `json:"roleGroup" description:"角色名称"` - User *input.AdminMemberViewModel `json:"user" description:"用户基本信息"` - SysDept *input.AdminDeptViewModel `json:"sysDept" description:"部门信息"` - SysRoles []*input.AdminRoleListModel `json:"sysRoles" description:"角色列表"` - PostIds int64 `json:"postIds" description:"当前岗位"` - RoleIds int64 `json:"roleIds" description:"当前角色"` + PostGroup string `json:"postGroup" dc:"岗位名称"` + RoleGroup string `json:"roleGroup" dc:"角色名称"` + User *input.AdminMemberViewModel `json:"user" dc:"用户基本信息"` + SysDept *input.AdminDeptViewModel `json:"sysDept" dc:"部门信息"` + SysRoles []*input.AdminRoleListModel `json:"sysRoles" dc:"角色列表"` + PostIds int64 `json:"postIds" dc:"当前岗位"` + RoleIds int64 `json:"roleIds" dc:"当前角色"` } // 重置密码 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:"重置密码"` + Password string `json:"password" v:"required#密码不能为空" dc:"密码"` + Id int64 `json:"id" dc:"会员ID"` } type MemberResetPwdRes 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:"邮箱是否唯一"` + Email string `json:"email" v:"required#邮箱不能为空" dc:"邮箱"` + Id int64 `json:"id" dc:"会员ID"` } type MemberEmailUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 手机号是否唯一 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:"手机号是否唯一"` + Mobile string `json:"mobile" v:"required#手机号不能为空" dc:"手机号"` + Id int64 `json:"id" dc:"会员ID"` } type MemberMobileUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 名称是否唯一 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:"会员名称是否唯一"` + Username string `json:"username" v:"required#会员名称不能为空" dc:"会员名称"` + Id int64 `json:"id" dc:"会员ID"` } type MemberNameUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 查询列表 type MemberListReq struct { + g.Meta `path:"/member/list" method:"get" tags:"会员" summary:"获取会员列表"` form.PageReq form.RangeDateReq form.StatusReq - DeptId int `json:"dept_id" description:"部门ID"` - Mobile int `json:"mobile" description:"手机号"` - Username string `json:"username" description:"用户名"` - Realname string `json:"realname" description:"真实姓名"` - StartTime string `json:"start_time" description:"开始时间"` - EndTime string `json:"end_time" description:"结束时间"` - Name string `json:"name" description:"岗位名称"` - Code string `json:"code" description:"岗位编码"` - g.Meta `path:"/member/list" method:"get" tags:"会员" summary:"获取会员列表"` + DeptId int `json:"dept_id" dc:"部门ID"` + Mobile int `json:"mobile" dc:"手机号"` + Username string `json:"username" dc:"用户名"` + Realname string `json:"realname" dc:"真实姓名"` + StartTime string `json:"start_time" dc:"开始时间"` + EndTime string `json:"end_time" dc:"结束时间"` + Name string `json:"name" dc:"岗位名称"` + Code string `json:"code" dc:"岗位编码"` } type MemberListRes struct { - List []*input.AdminMemberListModel `json:"list" description:"数据列表"` + List []*input.AdminMemberListModel `json:"list" dc:"数据列表"` form.PageRes } // 获取指定信息 type MemberViewReq struct { - Id int64 `json:"id" description:"会员ID"` // v:"required#会员ID不能为空" g.Meta `path:"/member/view" method:"get" tags:"会员" summary:"获取指定信息"` + Id int64 `json:"id" dc:"会员ID"` // v:"required#会员ID不能为空" } type MemberViewRes struct { *input.AdminMemberViewModel - Posts []*input.AdminPostListModel `json:"posts" description:"可选岗位"` - PostIds []int64 `json:"postIds" description:"当前岗位"` - Roles []*input.AdminRoleListModel `json:"roles" description:"可选角色"` - RoleIds []int64 `json:"roleIds" description:"当前角色"` - DeptName string `json:"dept_name" description:"部门名称"` + Posts []*input.AdminPostListModel `json:"posts" dc:"可选岗位"` + PostIds []int64 `json:"postIds" dc:"当前岗位"` + Roles []*input.AdminRoleListModel `json:"roles" dc:"可选角色"` + RoleIds []int64 `json:"roleIds" dc:"当前角色"` + DeptName string `json:"dept_name" dc:"部门名称"` } // 修改/新增 type MemberEditReq struct { - input.AdminMemberEditInp g.Meta `path:"/member/edit" method:"post" tags:"会员" summary:"修改/新增会员"` + input.AdminMemberEditInp } type MemberEditRes struct{} // 删除 type MemberDeleteReq struct { - Id interface{} `json:"id" v:"required#会员ID不能为空" description:"会员ID"` g.Meta `path:"/member/delete" method:"post" tags:"会员" summary:"删除会员"` + Id interface{} `json:"id" v:"required#会员ID不能为空" dc:"会员ID"` } type MemberDeleteRes struct{} // 最大排序 type MemberMaxSortReq struct { - Id int64 `json:"id" description:"会员ID"` g.Meta `path:"/member/max_sort" method:"get" tags:"会员" summary:"会员最大排序"` + Id int64 `json:"id" dc:"会员ID"` } type MemberMaxSortRes struct { - Sort int `json:"sort" description:"排序"` + Sort int `json:"sort" dc:"排序"` } // 获取登录用户信息 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 { TitleRequired bool `json:"titleRequired" titleRequired:""` - MoreUrl string `json:"moreUrl" description:"模块地址"` - Refresh int `json:"refresh" description:"刷新"` + MoreUrl string `json:"moreUrl" dc:"模块地址"` + Refresh int `json:"refresh" dc:"刷新"` } type PortalConfigContent struct { - Id int `json:"id" description:"内容ID"` - X int `json:"x" description:""` - Y int `json:"y" description:""` - W int `json:"w" description:"宽"` - H int `json:"h" description:"高"` - I int `json:"i" description:""` - Key string `json:"key" description:""` - IsShowTitle string `json:"isShowTitle" description:""` - IsAllowDrag bool `json:"isAllowDrag" description:""` - Name string `json:"name" description:""` - Type string `json:"type" description:""` - Url string `json:"url" description:""` - Options []*PortalConfigContentOptions `json:"options" description:""` - Moved bool `json:"moved" description:""` + Id int `json:"id" dc:"内容ID"` + X int `json:"x" dc:""` + Y int `json:"y" dc:""` + W int `json:"w" dc:"宽"` + H int `json:"h" dc:"高"` + I int `json:"i" dc:""` + Key string `json:"key" dc:""` + IsShowTitle string `json:"isShowTitle" dc:""` + IsAllowDrag bool `json:"isAllowDrag" dc:""` + Name string `json:"name" dc:""` + Type string `json:"type" dc:""` + Url string `json:"url" dc:""` + Options []*PortalConfigContentOptions `json:"options" dc:""` + Moved bool `json:"moved" dc:""` } type PortalConfig struct { - CreateByName string `json:"createByName" description:"创建者名称"` - CreateDeptName string `json:"createDeptName" description:"创建部门名称"` - ImportErrInfo string `json:"importErrInfo" description:"导出错误信息"` - Id string `json:"id" description:"用户ID"` - SearchValue string `json:"searchValue" description:"搜索内容"` - CreateBy string `json:"createBy" description:"创建者名称"` - CreateDept string `json:"createDept" description:"创建部门名称"` - CreateTime *gtime.Time `json:"createTime" description:"创建时间"` - UpdateBy string `json:"updateBy" description:"更新者名称"` - UpdateTime *gtime.Time `json:"updateTime" description:"更新时间"` - UpdateIp string `json:"updateIp" description:"更新iP"` - Remark string `json:"remark" description:"备注"` - Version string `json:"version" description:"版本号"` - DelFlag string `json:"delFlag" description:"删除标签"` - HandleType string `json:"handleType" description:""` - Params string `json:"params" description:""` - Name string `json:"name" description:"配置名称"` - Code string `json:"code" description:"配置代码"` - ApplicationRange string `json:"applicationRange" description:""` - IsDefault string `json:"isDefault" description:"是否默认"` - ResourceId string `json:"resourceId" description:""` - ResourceName string `json:"resourceName" description:""` - SystemDefinedId string `json:"systemDefinedId" description:""` - Sort string `json:"sort" description:"排序"` - SaveType string `json:"saveType" description:""` - Status string `json:"status" description:"状态"` - RecordLog string `json:"recordLog" description:""` - PortalConfigContent string `json:"content" description:"配置内容"` + CreateByName string `json:"createByName" dc:"创建者名称"` + CreateDeptName string `json:"createDeptName" dc:"创建部门名称"` + ImportErrInfo string `json:"importErrInfo" dc:"导出错误信息"` + Id string `json:"id" dc:"用户ID"` + SearchValue string `json:"searchValue" dc:"搜索内容"` + CreateBy string `json:"createBy" dc:"创建者名称"` + CreateDept string `json:"createDept" dc:"创建部门名称"` + CreateTime *gtime.Time `json:"createTime" dc:"创建时间"` + UpdateBy string `json:"updateBy" dc:"更新者名称"` + UpdateTime *gtime.Time `json:"updateTime" dc:"更新时间"` + UpdateIp string `json:"updateIp" dc:"更新iP"` + Remark string `json:"remark" dc:"备注"` + Version string `json:"version" dc:"版本号"` + DelFlag string `json:"delFlag" dc:"删除标签"` + HandleType string `json:"handleType" dc:""` + Params string `json:"params" dc:""` + Name string `json:"name" dc:"配置名称"` + Code string `json:"code" dc:"配置代码"` + ApplicationRange string `json:"applicationRange" dc:""` + IsDefault string `json:"isDefault" dc:"是否默认"` + ResourceId string `json:"resourceId" dc:""` + ResourceName string `json:"resourceName" dc:""` + SystemDefinedId string `json:"systemDefinedId" dc:""` + Sort string `json:"sort" dc:"排序"` + SaveType string `json:"saveType" dc:""` + Status string `json:"status" dc:"状态"` + RecordLog string `json:"recordLog" dc:""` + PortalConfigContent string `json:"content" dc:"配置内容"` } type MemberInfoRes struct { - DefaultPortalConfig []*PortalConfig `json:"defaultPortalConfig" description:"默认用户配置"` - LincenseInfo string `json:"lincenseInfo" description:"应用版本号"` - Permissions []string `json:"permissions"description:"权限"` - Roles []string `json:"roles" description:"角色"` - SysNoticeList []*entity.AdminNotice `json:"sysNoticeList" description:"系统公告"` - UserPortalConfig []*PortalConfig `json:"userPortalConfig" description:"用户配置"` - User model.Identity `json:"user" description:"用户信息"` + DefaultPortalConfig []*PortalConfig `json:"defaultPortalConfig" dc:"默认用户配置"` + LincenseInfo string `json:"lincenseInfo" dc:"应用版本号"` + Permissions []string `json:"permissions"dc:"权限"` + Roles []string `json:"roles" dc:"角色"` + SysNoticeList []*entity.AdminNotice `json:"sysNoticeList" dc:"系统公告"` + UserPortalConfig []*PortalConfig `json:"userPortalConfig" dc:"用户配置"` + User model.Identity `json:"user" dc:"用户信息"` } diff --git a/hotgo-server/app/form/adminForm/menu_form.go b/hotgo-server/app/form/adminForm/menu_form.go index 131f8c6..52b13bf 100644 --- a/hotgo-server/app/form/adminForm/menu_form.go +++ b/hotgo-server/app/form/adminForm/menu_form.go @@ -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 import ( @@ -9,51 +15,51 @@ import ( // 菜单最大排序 type MenuMaxSortReq struct { - Id int64 `json:"id" description:"菜单ID"` g.Meta `path:"/menu/max_sort" method:"get" tags:"菜单" summary:"菜单最大排序"` + Id int64 `json:"id" dc:"菜单ID"` } type MenuMaxSortRes struct { - Sort int `json:"sort" description:"排序"` + Sort int `json:"sort" dc:"排序"` } // 菜单编码是否唯一 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:"菜单编码是否唯一"` + Code string `json:"code" v:"required#菜单编码不能为空" dc:"菜单编码"` + Id int64 `json:"id" dc:"菜单ID"` } type MenuCodeUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 菜单名称是否唯一 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:"菜单名称是否唯一"` + Name string `json:"name" v:"required#菜单名称不能为空" dc:"菜单名称"` + Id int64 `json:"id" dc:"菜单ID"` } type MenuNameUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 修改/新增字典数据 type MenuEditReq struct { - entity.AdminMenu g.Meta `path:"/menu/edit" method:"post" tags:"菜单" summary:"修改/新增菜单"` + entity.AdminMenu } type MenuEditRes struct{} // 删除字典类型 type MenuDeleteReq struct { - Id interface{} `json:"id" v:"required#菜单ID不能为空" description:"菜单ID"` g.Meta `path:"/menu/delete" method:"post" tags:"菜单" summary:"删除菜单"` + Id interface{} `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"` } type MenuDeleteRes struct{} // 获取指定字典数据信息 type MenuViewReq struct { - Id string `json:"id" v:"required#菜单ID不能为空" description:"菜单ID"` g.Meta `path:"/menu/view" method:"get" tags:"菜单" summary:"获取指定菜单信息"` + Id string `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"` } type MenuViewRes struct { *entity.AdminMenu @@ -61,32 +67,32 @@ type MenuViewRes struct { // 获取菜单列表 type MenuListReq struct { - form.PageReq - Pid int64 `json:"pid" description:"父ID"` g.Meta `path:"/menu/list" method:"get" tags:"菜单" summary:"获取菜单列表"` + form.PageReq + Pid int64 `json:"pid" dc:"父ID"` } type MenuListRes struct { - List []*entity.AdminMenu `json:"list" description:"数据列表"` + List []*entity.AdminMenu `json:"list" dc:"数据列表"` form.PageRes } // 查询菜单列表 type MenuSearchListReq struct { - Name string `json:"name" description:"菜单名称"` - form.StatusReq g.Meta `path:"/menu/search_list" method:"get" tags:"菜单" summary:"获取菜单列表"` + Name string `json:"name" dc:"菜单名称"` + form.StatusReq } type MenuSearchListRes []*model.TreeMenu // 查询角色菜单列表 type MenuRoleListReq struct { - RoleId string `json:"role_id" description:"角色ID"` g.Meta `path:"/menu/role_list" method:"get" tags:"菜单" summary:"查询角色菜单列表"` + RoleId string `json:"role_id" dc:"角色ID"` } type MenuRoleListRes struct { - Menus []*model.LabelTreeMenu `json:"menus" description:"菜单列表"` - CheckedKeys []int64 `json:"checkedKeys" description:"选择的菜单ID"` + Menus []*model.LabelTreeMenu `json:"menus" dc:"菜单列表"` + CheckedKeys []int64 `json:"checkedKeys" dc:"选择的菜单ID"` } diff --git a/hotgo-server/app/form/adminForm/notice_form.go b/hotgo-server/app/form/adminForm/notice_form.go index 8aed408..91ceadf 100644 --- a/hotgo-server/app/form/adminForm/notice_form.go +++ b/hotgo-server/app/form/adminForm/notice_form.go @@ -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 import ( @@ -9,32 +15,32 @@ import ( // 名称是否唯一 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:"公告名称是否唯一"` + Title string `json:"name" v:"required#公告名称不能为空" dc:"公告名称"` + Id int64 `json:"id" dc:"公告ID"` } type NoticeNameUniqueRes struct { - IsUnique bool `json:"is_unique" description:"是否唯一"` + IsUnique bool `json:"is_unique" dc:"是否唯一"` } // 查询列表 type NoticeListReq struct { + g.Meta `path:"/notice/list" method:"get" tags:"公告" summary:"获取公告列表"` form.PageReq form.RangeDateReq form.StatusReq - Name string `json:"name" description:"公告名称"` - g.Meta `path:"/notice/list" method:"get" tags:"公告" summary:"获取公告列表"` + Name string `json:"name" dc:"公告名称"` } type NoticeListRes struct { - List []*input.AdminNoticeListModel `json:"list" description:"数据列表"` + List []*input.AdminNoticeListModel `json:"list" dc:"数据列表"` form.PageRes } // 获取指定信息 type NoticeViewReq struct { - Id string `json:"id" v:"required#公告ID不能为空" description:"公告ID"` g.Meta `path:"/notice/view" method:"get" tags:"公告" summary:"获取指定信息"` + Id string `json:"id" v:"required#公告ID不能为空" dc:"公告ID"` } type NoticeViewRes struct { *input.AdminNoticeViewModel @@ -42,23 +48,23 @@ type NoticeViewRes struct { // 修改/新增 type NoticeEditReq struct { - entity.AdminNotice g.Meta `path:"/notice/edit" method:"post" tags:"公告" summary:"修改/新增公告"` + entity.AdminNotice } type NoticeEditRes struct{} // 删除 type NoticeDeleteReq struct { - Id interface{} `json:"id" v:"required#公告ID不能为空" description:"公告ID"` g.Meta `path:"/notice/delete" method:"post" tags:"公告" summary:"删除公告"` + Id interface{} `json:"id" v:"required#公告ID不能为空" dc:"公告ID"` } type NoticeDeleteRes struct{} // 最大排序 type NoticeMaxSortReq struct { - Id int64 `json:"id" description:"公告ID"` g.Meta `path:"/notice/max_sort" method:"get" tags:"公告" summary:"公告最大排序"` + Id int64 `json:"id" dc:"公告ID"` } type NoticeMaxSortRes struct { - Sort int `json:"sort" description:"排序"` + Sort int `json:"sort" dc:"排序"` } diff --git a/hotgo-server/app/form/adminForm/post_form.go b/hotgo-server/app/form/adminForm/post_form.go index 27f830e..7240695 100644 --- a/hotgo-server/app/form/adminForm/post_form.go +++ b/hotgo-server/app/form/adminForm/post_form.go @@ -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 import ( @@ -9,22 +15,22 @@ import ( // 修改/新增字典数据 type PostEditReq struct { - entity.AdminPost g.Meta `path:"/post/edit" method:"post" tags:"岗位" summary:"修改/新增岗位"` + entity.AdminPost } type PostEditRes struct{} // 删除字典类型 type PostDeleteReq struct { - Id interface{} `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"` g.Meta `path:"/post/delete" method:"post" tags:"岗位" summary:"删除岗位"` + Id interface{} `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"` } type PostDeleteRes struct{} // 最大排序 type PostMaxSortReq struct { - Id int64 `json:"id" description:"岗位ID"` g.Meta `path:"/post/max_sort" method:"get" tags:"岗位" summary:"岗位最大排序"` + Id int64 `json:"id" description:"岗位ID"` } type PostMaxSortRes struct { Sort int `json:"sort" description:"排序"` @@ -32,12 +38,12 @@ type PostMaxSortRes struct { // 获取列表 type PostListReq struct { + g.Meta `path:"/post/list" method:"get" tags:"岗位" summary:"获取岗位列表"` form.PageReq form.RangeDateReq form.StatusReq - Name string `json:"name" description:"岗位名称"` - Code string `json:"code" description:"岗位编码"` - g.Meta `path:"/post/list" method:"get" tags:"岗位" summary:"获取岗位列表"` + Name string `json:"name" description:"岗位名称"` + Code string `json:"code" description:"岗位编码"` } type PostListRes struct { @@ -47,8 +53,8 @@ type PostListRes struct { // 获取指定信息 type PostViewReq struct { - Id string `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"` g.Meta `path:"/post/view" method:"get" tags:"岗位" summary:"获取指定信息"` + Id string `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"` } type PostViewRes struct { *input.AdminPostViewModel @@ -56,9 +62,9 @@ type PostViewRes struct { // 编码是否唯一 type PostCodeUniqueReq struct { + g.Meta `path:"/post/code_unique" method:"get" tags:"岗位" summary:"岗位编码是否唯一"` Code string `json:"code" v:"required#岗位编码不能为空" description:"岗位编码"` Id int64 `json:"id" description:"岗位ID"` - g.Meta `path:"/post/code_unique" method:"get" tags:"岗位" summary:"岗位编码是否唯一"` } type PostCodeUniqueRes struct { IsUnique bool `json:"is_unique" description:"是否唯一"` @@ -66,9 +72,9 @@ type PostCodeUniqueRes struct { // 名称是否唯一 type PostNameUniqueReq struct { + g.Meta `path:"/post/name_unique" method:"get" tags:"岗位" summary:"岗位名称是否唯一"` Name string `json:"name" v:"required#岗位名称不能为空" description:"岗位名称"` Id int64 `json:"id" description:"岗位ID"` - g.Meta `path:"/post/name_unique" method:"get" tags:"岗位" summary:"岗位名称是否唯一"` } type PostNameUniqueRes struct { IsUnique bool `json:"is_unique" description:"是否唯一"` diff --git a/hotgo-server/app/form/adminForm/role_form.go b/hotgo-server/app/form/adminForm/role_form.go index 20a06aa..6d303fd 100644 --- a/hotgo-server/app/form/adminForm/role_form.go +++ b/hotgo-server/app/form/adminForm/role_form.go @@ -14,6 +14,7 @@ import ( // 查询列表 type RoleMemberListReq struct { + g.Meta `path:"/role/member_list" method:"get" tags:"角色" summary:"获取角色下的会员列表"` form.PageReq form.RangeDateReq form.StatusReq @@ -26,7 +27,6 @@ type RoleMemberListReq struct { EndTime string `json:"end_time" description:"结束时间"` Name string `json:"name" description:"岗位名称"` Code string `json:"code" description:"岗位编码"` - g.Meta `path:"/role/member_list" method:"get" tags:"角色" summary:"获取角色下的会员列表"` } type RoleMemberListRes struct { @@ -36,6 +36,7 @@ type RoleMemberListRes struct { // 查询列表 type RoleListReq struct { + g.Meta `path:"/role/list" method:"get" tags:"角色" summary:"获取角色列表"` form.PageReq form.RangeDateReq form.StatusReq @@ -47,7 +48,6 @@ type RoleListReq struct { EndTime string `json:"end_time" description:"结束时间"` Name string `json:"name" description:"岗位名称"` Code string `json:"code" description:"岗位编码"` - g.Meta `path:"/role/list" method:"get" tags:"角色" summary:"获取角色列表"` } type RoleListRes struct { diff --git a/hotgo-server/app/form/apiForm/base_form.go b/hotgo-server/app/form/apiForm/base_form.go index 332ca3c..8618d43 100644 --- a/hotgo-server/app/form/apiForm/base_form.go +++ b/hotgo-server/app/form/apiForm/base_form.go @@ -13,22 +13,22 @@ import ( // 获取lang信息 type BaseLangReq struct { - g.Meta `path:"/base/lang" method:"get" tags:"基础" summary:"获取lang信息"` - L string `json:"l" v:"required#语言不能为空" description:"语言"` + g.Meta `path:"/base/lang" method:"get" tags:"基础接口" summary:"获取lang信息"` + L string `json:"l" v:"required#语言不能为空" dc:"语言"` } type BaseLangRes struct { } // 获取登录验证码 type IpLocationReq struct { - g.Meta `path:"/base/ip_location" method:"get" tags:"基础" summary:"获取IP归属地信息"` - Ip string `json:"ip" v:"required#ip不能为空" description:"ipv4地址"` + g.Meta `path:"/base/ip_location" method:"get" tags:"基础接口" summary:"获取IP归属地信息"` + Ip string `json:"ip" v:"required#ip不能为空" dc:"ipv4地址"` } type IpLocationRes struct { com.IpLocationData } type ExportReq struct { - g.Meta `path:"/base/export" method:"get" tags:"字典" summary:"导出字典类型"` + g.Meta `path:"/base/export" method:"get" tags:"字典接口" summary:"导出字典类型"` } type ExportRes struct{} diff --git a/hotgo-server/app/form/apiForm/dict_form.go b/hotgo-server/app/form/apiForm/dict_form.go index dd8df5a..2a45c7f 100644 --- a/hotgo-server/app/form/apiForm/dict_form.go +++ b/hotgo-server/app/form/apiForm/dict_form.go @@ -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 import ( @@ -7,7 +13,7 @@ import ( // 获取指定字典类型的属性数据 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 diff --git a/hotgo-server/app/form/apiForm/log_form.go b/hotgo-server/app/form/apiForm/log_form.go index 0a48f87..ec7bf82 100644 --- a/hotgo-server/app/form/apiForm/log_form.go +++ b/hotgo-server/app/form/apiForm/log_form.go @@ -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 import ( @@ -8,40 +14,40 @@ import ( // 清空日志 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 LogExportReq struct { + g.Meta `path:"/log/export" method:"get" tags:"日志接口" summary:"导出日志"` form.PageReq form.RangeDateReq - Module string `json:"module" description:"应用端口"` - MemberId int `json:"member_id" description:"用户ID"` - TakeUpTime int `json:"take_up_time" description:"请求耗时"` - Method string `json:"method" description:"请求方式"` - Url string `json:"url" description:"请求路径"` - Ip string `json:"ip" description:"访问IP"` - ErrorCode string `json:"error_code" description:"状态码"` - g.Meta `path:"/log/export" method:"get" tags:"日志" summary:"导出日志"` + Module string `json:"module" dc:"应用端口"` + MemberId int `json:"member_id" dc:"用户ID"` + TakeUpTime int `json:"take_up_time" dc:"请求耗时"` + Method string `json:"method" dc:"请求方式"` + Url string `json:"url" dc:"请求路径"` + Ip string `json:"ip" dc:"访问IP"` + ErrorCode string `json:"error_code" dc:"状态码"` } type LogExportRes struct{} // 获取菜单列表 type LogListReq struct { + g.Meta `path:"/log/list" method:"get" tags:"日志接口" summary:"获取日志列表"` form.PageReq form.RangeDateReq - Module string `json:"module" description:"应用端口"` - MemberId int `json:"member_id" description:"用户ID"` - TakeUpTime int `json:"take_up_time" description:"请求耗时"` - Method string `json:"method" description:"请求方式"` - Url string `json:"url" description:"请求路径"` - Ip string `json:"ip" description:"访问IP"` - ErrorCode string `json:"error_code" description:"状态码"` - g.Meta `path:"/log/list" method:"get" tags:"日志" summary:"获取日志列表"` + Module string `json:"module" dc:"应用端口"` + MemberId int `json:"member_id" dc:"用户ID"` + TakeUpTime int `json:"take_up_time" dc:"请求耗时"` + Method string `json:"method" dc:"请求方式"` + Url string `json:"url" dc:"请求路径"` + Ip string `json:"ip" dc:"访问IP"` + ErrorCode string `json:"error_code" dc:"状态码"` } type LogListRes struct { - List []*input.LogListModel `json:"list" description:"数据列表"` + List []*input.LogListModel `json:"list" dc:"数据列表"` form.PageRes } diff --git a/hotgo-server/app/form/apiForm/login_form.go b/hotgo-server/app/form/apiForm/login_form.go index 1a14f68..4f7c624 100644 --- a/hotgo-server/app/form/apiForm/login_form.go +++ b/hotgo-server/app/form/apiForm/login_form.go @@ -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 import ( @@ -7,31 +13,31 @@ import ( // 注销登录 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 LoginCheckReq struct { - g.Meta `path:"/login/check" method:"get" tags:"登录" summary:"登录效验"` + g.Meta `path:"/login/check" method:"get" tags:"登录接口" summary:"登录效验"` } type LoginCheckRes struct { - IsValidCodeLogin bool `json:"isValidCodeLogin" description:"是否验证码"` - Message string `json:"message" description:"消息"` - Result string `json:"result" description:"响应"` - // Sessionid string `json:"sessionid" description:"sessionid"` + IsValidCodeLogin bool `json:"isValidCodeLogin" dc:"是否验证码"` + Message string `json:"message" dc:"消息"` + Result string `json:"result" dc:"响应"` + // Sessionid string `json:"sessionid" dc:"sessionid"` } // 提交登录 type LoginReq struct { - g.Meta `path:"/login/sign" method:"post" tags:"登录" summary:"提交登录"` - Username string `json:"username" v:"required#用户名不能为空" description:"用户名"` - Password string `json:"password" v:"required#密码不能为空" description:"密码"` - Cid string `json:"cid" v:"required#验证码ID不能为空" description:"验证码ID"` - Code string `json:"code" v:"required#验证码不能为空" description:"验证码"` - Device string `json:"device" description:"登录设备"` + g.Meta `path:"/login/sign" method:"post" tags:"登录接口" summary:"提交登录"` + Username string `json:"username" v:"required#用户名不能为空" dc:"用户名"` + Password string `json:"password" v:"required#密码不能为空" dc:"密码"` + Cid string `json:"cid" v:"required#验证码ID不能为空" dc:"验证码ID"` + Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"` + Device string `json:"device" dc:"登录设备"` } type LoginRes struct { model.Identity - Token string `json:"token" v:"" description:"登录token"` + Token string `json:"token" dc:"登录token"` } diff --git a/hotgo-server/app/form/apiForm/member_form.go b/hotgo-server/app/form/apiForm/member_form.go index b150ac6..255dd79 100644 --- a/hotgo-server/app/form/apiForm/member_form.go +++ b/hotgo-server/app/form/apiForm/member_form.go @@ -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 import ( @@ -7,14 +13,14 @@ import ( // 获取登录用户的基本信息 type MemberProfileReq struct { - g.Meta `path:"/member/profile" method:"get" tags:"会员" summary:"获取登录用户的基本信息"` + g.Meta `path:"/member/profile" method:"get" tags:"会员接口" summary:"获取登录用户的基本信息"` } type MemberProfileRes struct { - PostGroup string `json:"postGroup" description:"岗位名称"` - RoleGroup string `json:"roleGroup" description:"角色名称"` - User *input.AdminMemberViewModel `json:"user" description:"用户基本信息"` - SysDept *input.AdminDeptViewModel `json:"sysDept" description:"部门信息"` - SysRoles []*input.AdminRoleListModel `json:"sysRoles" description:"角色列表"` - PostIds int64 `json:"postIds" description:"当前岗位"` - RoleIds int64 `json:"roleIds" description:"当前角色"` + PostGroup string `json:"postGroup" dc:"岗位名称"` + RoleGroup string `json:"roleGroup" dc:"角色名称"` + User *input.AdminMemberViewModel `json:"user" dc:"用户基本信息"` + SysDept *input.AdminDeptViewModel `json:"sysDept" dc:"部门信息"` + SysRoles []*input.AdminRoleListModel `json:"sysRoles" dc:"角色列表"` + PostIds int64 `json:"postIds" dc:"当前岗位"` + RoleIds int64 `json:"roleIds" dc:"当前角色"` } diff --git a/hotgo-server/app/form/common.go b/hotgo-server/app/form/common.go index 6e51118..c3a4eaa 100644 --- a/hotgo-server/app/form/common.go +++ b/hotgo-server/app/form/common.go @@ -8,21 +8,21 @@ package form // 分页 type PageReq struct { - Page int `json:"page" example:"10" d:"1" v:"min:1#页码最小值不能低于1" description:"当前页码"` - Limit int `json:"limit" example:"1" d:"10" v:"min:1|max:100#|每页数量最小值不能低于1|最大值不能大于100" 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" dc:"每页数量"` } type PageRes struct { PageReq - TotalCount int `json:"total_count" example:"0" description:"全部数据量"` + TotalCount int `json:"total_count" example:"0" dc:"全部数据量"` } // 时间查询 type RangeDateReq struct { - StartTime string `json:"start_time" v:"date#开始日期格式不正确" description:"开始日期"` - EndTime string `json:"end_time" v:"date#结束日期格式不正确" description:"结束日期"` + StartTime string `json:"start_time" v:"date#开始日期格式不正确" dc:"开始日期"` + EndTime string `json:"end_time" v:"date#结束日期格式不正确" dc:"结束日期"` } // 状态查询 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:"状态"` } diff --git a/hotgo-server/app/hook/hook.go b/hotgo-server/app/hook/hook.go index b705720..637d416 100644 --- a/hotgo-server/app/hook/hook.go +++ b/hotgo-server/app/hook/hook.go @@ -39,6 +39,13 @@ func (s *sHook) GlobalLog(r *ghttp.Request) { ctx = r.Context() ) + // 没有上下文的请求不记录,如:doc、favicon.ico等非服务类业务 + modelCtx := com.Context.Get(ctx) + if modelCtx == nil { + return + } + + // 计算运行耗时 com.Context.SetTakeUpTime(ctx, gtime.TimestampMilli()-r.EnterTime) go sysService.Log.AutoLog(ctx) diff --git a/hotgo-server/app/middleware/handler_response.go b/hotgo-server/app/middleware/handler_response.go index 4c8a4ab..8d6b8e2 100644 --- a/hotgo-server/app/middleware/handler_response.go +++ b/hotgo-server/app/middleware/handler_response.go @@ -11,7 +11,6 @@ import ( "github.com/bufanyun/hotgo/app/consts" "github.com/bufanyun/hotgo/app/utils" "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/net/ghttp" ) @@ -60,13 +59,17 @@ func (s *sMiddleware) HandlerResponse(r *ghttp.Request) { data = utils.Charset.GetStack(err) } - } else if data, err = r.GetHandlerResponse(); err != nil { - errCode := gerror.Code(err) - if errCode == gcode.CodeNil { - errCode = gcode.CodeInternalError - } - code = errCode.Code() - message = err.Error() + //} else if data, err = r.GetHandlerResponse(); err != nil { + // errCode := gerror.Code(err) + // if errCode == gcode.CodeNil { + // errCode = gcode.CodeInternalError + // } + // code = errCode.Code() + // message = err.Error() + //} + + } else { + data = r.GetHandlerResponse() } // TODO 返回固定的友好信息 diff --git a/hotgo-server/config/config.example.yaml b/hotgo-server/config/config.example.yaml index 470c493..99e549e 100644 --- a/hotgo-server/config/config.example.yaml +++ b/hotgo-server/config/config.example.yaml @@ -8,6 +8,7 @@ hotgo: module: ["admin", "api"] # 需要记录的模块 skipCode: [] # 不记录的状态码,如: ["0", "-1"] + # 路由配置 router: # 后台 @@ -65,6 +66,7 @@ logger: level: "all" file: "{Y-m-d}.log" + #JWT jwt: version: "1.0" # 版本号 @@ -72,26 +74,28 @@ jwt: sign: "hotgo" # 秘钥,考虑安全问题请修改默认值 multiPort: true # 是否允许多端登录,默认为true + #消息队列 queue: - switch: true # 队列开关,默认为true + switch: false # 队列开关,默认为false driver: "redis" # 队列驱动,可选:redis|rocketmq|kafka retry: 2 # 重试次数 multiComsumer: true # 是否支持创建多个消费者 groupName: "hotgo" # mq群组名称 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库 pass: "meng133814250" # redis密码 timeout: 0 # 队列超时时间(s) ,0为永不超时,当队列一直没有被消费到达超时时间则队列会被销毁 rocketmq: - address: "127.0.0.1:9876" # brocker地址+端口 + address: "127.0.0.1:9876" # brocker地址+端口 logLevel: "all" # 系统日志级别,可选:all|close|debug|info|warn|error|fatal 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 randClient: true # 开启随机生成clientID,可以实现启动多实例同时一起消费相同topic,加速消费能力的特性,默认为true + # Redis数据库配置 redis: default: @@ -105,6 +109,7 @@ redis: # pass: "hg123456." # idleTimeout: "20" + # Database. database: logger: @@ -116,6 +121,7 @@ database: debug: true Prefix: "hg_" + # CLI. gfcli: build: diff --git a/hotgo-server/go.mod b/hotgo-server/go.mod index 255b5b9..ea0406e 100644 --- a/hotgo-server/go.mod +++ b/hotgo-server/go.mod @@ -8,10 +8,9 @@ require ( github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394 github.com/bufanyun/pool v0.2.1 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/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/kayon/iploc v0.0.0-20200312105652-bda3e968a794 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect diff --git a/hotgo-server/go.sum b/hotgo-server/go.sum index 3f5a422..42bd5fa 100644 --- a/hotgo-server/go.sum +++ b/hotgo-server/go.sum @@ -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/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= 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.0-rc2/go.mod h1:apktt6TleWtCIwpz63vBqUnw8MX8gWKoZyxgDpXFtgM= +github.com/gogf/gf/v2 v2.0.4 h1:m5F/f2lX+etXhI6rAQCR6szQoHE1ulAYlIvH0UXa2wM= +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/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= 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/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 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/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=