im 管理后台

This commit is contained in:
richjohnrambo
2026-08-11 23:13:51 +08:00
parent 0397fe5f22
commit 331a55751d
1407 changed files with 162069 additions and 2 deletions
@@ -0,0 +1,64 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/text/gregex"
"hotgo/internal/library/addons"
"hotgo/internal/model/input/form"
)
// AddonsListInp 获取列表
type AddonsListInp struct {
form.PageReq
Name string `json:"name" dc:"插件名称"`
Group int `json:"group" dc:"分组"`
Status int `json:"status" dc:"安装状态"`
}
type AddonsListModel struct {
addons.Skeleton
GroupName string `json:"groupName" dc:"分组名称"`
InstallVersion string `json:"installVersion" dc:"安装版本"`
InstallStatus int `json:"installStatus" dc:"安装状态"`
CanSave bool `json:"canSave" dc:"是否可以更新"`
}
// AddonsBuildInp 提交生成
type AddonsBuildInp struct {
addons.Skeleton
Extend []string `json:"extend" dc:"扩展功能"`
}
func (in *AddonsBuildInp) Filter(ctx context.Context) (err error) {
if in.Name == "" {
err = gerror.New("插件名称不能为空")
return
}
if !gregex.IsMatchString(`^[a-zA-Z]{1}\w{1,23}$`, in.Name) {
err = gerror.New("插件名称格式不正确,字母开头,只能包含字母、数字和下划线,长度在2~24之间")
return
}
return
}
// AddonsInstallInp 安装模块
type AddonsInstallInp struct {
addons.Skeleton
}
// AddonsUpgradeInp 更新模块
type AddonsUpgradeInp struct {
addons.Skeleton
}
// AddonsUnInstallInp 卸载模块
type AddonsUnInstallInp struct {
addons.Skeleton
}
@@ -0,0 +1,26 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"github.com/gogf/gf/v2/frame/g"
)
// UpdateAddonsConfigInp 更新指定插件的配置
type UpdateAddonsConfigInp struct {
AddonName string `json:"addonName"`
Group string `json:"group"`
List g.Map `json:"list"`
}
// GetAddonsConfigInp 获取指定插件的配置
type GetAddonsConfigInp struct {
AddonName string `json:"addonName"`
Group string `json:"group"`
}
type GetAddonsConfigModel struct {
List g.Map `json:"list"`
}
@@ -0,0 +1,106 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/library/storager"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/validate"
)
// AttachmentDeleteInp 删除附件
type AttachmentDeleteInp struct {
Id interface{} `json:"id" v:"required#附件ID不能为空" dc:"附件ID"`
}
type AttachmentDeleteModel struct{}
// AttachmentViewInp 获取附件信息
type AttachmentViewInp struct {
Id int64 `json:"id" v:"required#附件ID不能为空" dc:"附件ID"`
}
type AttachmentViewModel struct {
entity.SysAttachment
}
// AttachmentClearKindInp 清空上传类型
type AttachmentClearKindInp struct {
Kind string `json:"kind" v:"required#上传类型不能为空" dc:"上传类型"`
}
func (in *AttachmentClearKindInp) Filter(ctx context.Context) (err error) {
if !validate.InSlice(storager.KindSlice, in.Kind) {
err = gerror.New("上传类型是无效的")
return
}
return
}
// AttachmentListInp 获取附件列表
type AttachmentListInp struct {
form.PageReq
form.StatusReq
MemberId int64 `json:"member_id" dc:"用户ID"`
Name string `json:"name" dc:"文件名称"`
Drive string `json:"drive" dc:"驱动"`
Kind string `json:"kind" dc:"上传类型"`
UpdatedAt []*gtime.Time `json:"updatedAt" dc:"更新时间"`
}
type AttachmentListModel struct {
entity.SysAttachment
SizeFormat string `json:"sizeFormat" dc:"大小"`
}
// AttachmentChooserListInp 获取附件列表
type AttachmentChooserListInp struct {
form.PageReq
Drive string `json:"drive" dc:"驱动"`
Kind string `json:"kind" dc:"上传类型"`
UpdatedAt []int64 `json:"updatedAt" dc:"更新时间"`
}
type AttachmentChooserListModel struct {
entity.SysAttachment
SizeFormat string `json:"sizeFormat" dc:"大小"`
}
// AttachmentClearInp 清空分类
type AttachmentClearInp struct {
Kind string `json:"kind" dc:"上传类型"`
}
// CheckMultipartInp 检查文件分片
type CheckMultipartInp struct {
*storager.CheckMultipartParams
}
type CheckMultipartModel struct {
*storager.CheckMultipartModel
}
// UploadPartInp 上传分片
type UploadPartInp struct {
*storager.UploadPartParams
}
type UploadPartModel struct {
*storager.UploadPartModel
}
// ImageTransferStorageInp 图片链接转存
type ImageTransferStorageInp struct {
Url string `json:"url" v:"required#图片链接不能为空" dc:"图片链接"`
}
type ImageTransferStorageModel struct {
*AttachmentListModel
}
@@ -0,0 +1,81 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"hotgo/internal/consts"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/validate"
)
// BlacklistEditInp 修改/新增黑名单数据
type BlacklistEditInp struct {
entity.SysBlacklist
}
type BlacklistEditModel struct{}
// BlacklistDeleteInp 删除黑名单类型
type BlacklistDeleteInp struct {
Id interface{} `json:"id" v:"required#黑名单ID不能为空" dc:"黑名单ID"`
}
type BlacklistDeleteModel struct{}
// BlacklistViewInp 获取信息
type BlacklistViewInp struct {
Id int64 `json:"id" v:"required#黑名单ID不能为空" dc:"黑名单ID"`
}
type BlacklistViewModel struct {
entity.SysBlacklist
}
// BlacklistListInp 获取列表
type BlacklistListInp struct {
form.PageReq
form.StatusReq
Ip string `json:"ip" dc:"IP"`
Remark string `json:"remark" dc:"备注"`
CreatedAt []int64 `json:"createdAt" dc:"创建时间"`
}
func (in *BlacklistListInp) Filter(ctx context.Context) (err error) {
return
}
type BlacklistListModel struct {
entity.SysBlacklist
}
// BlacklistStatusInp 更新状态
type BlacklistStatusInp struct {
entity.SysBlacklist
}
func (in *BlacklistStatusInp) Filter(ctx context.Context) (err error) {
if in.Id <= 0 {
err = gerror.New("ID不能为空")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSlice(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
return
}
type BlacklistStatusModel struct{}
@@ -0,0 +1,25 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"github.com/gogf/gf/v2/frame/g"
)
// UpdateConfigInp 更新指定分组的配置
type UpdateConfigInp struct {
Group string `json:"group"`
List g.Map `json:"list"`
}
// GetConfigInp 获取指定分组的配置
type GetConfigInp struct {
Group string `json:"group"`
}
type GetConfigModel struct {
List g.Map `json:"list"`
}
+75
View File
@@ -0,0 +1,75 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"hotgo/internal/library/cron"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// CronMaxSortInp 最大排序
type CronMaxSortInp struct {
Id int64
}
type CronMaxSortModel struct {
Sort int
}
// CronEditInp 修改/新增
type CronEditInp struct {
entity.SysCron
}
type CronEditModel struct{}
// CronDeleteInp 删除
type CronDeleteInp struct {
Id interface{}
}
type CronDeleteModel struct{}
// CronViewInp 获取信息
type CronViewInp struct {
Id int64
}
type CronViewModel struct {
entity.SysCron
}
// CronListInp 获取列表
type CronListInp struct {
form.PageReq
form.StatusReq
GroupId int64 `json:"groupId" description:"分组ID"`
Name string `json:"name" description:"任务名称"`
}
type CronListModel struct {
entity.SysCron
GroupName string `json:"groupName"`
}
// CronStatusInp 更新状态
type CronStatusInp struct {
entity.SysCron
}
type CronStatusModel struct{}
// OnlineExecInp 在线执行
type OnlineExecInp struct {
entity.SysCron
}
type OnlineExecModel struct{}
// DispatchLogInp 查看指定任务的调度日志
type DispatchLogInp struct {
entity.SysCron
}
type DispatchLogModel struct {
*cron.Log
}
@@ -0,0 +1,134 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"hotgo/internal/consts"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/validate"
)
// CronGroupMaxSortInp 最大排序
type CronGroupMaxSortInp struct {
Id int64
}
type CronGroupMaxSortModel struct {
Sort int
}
// CronGroupEditInp 修改/新增字典数据
type CronGroupEditInp struct {
entity.SysCronGroup
}
func (in *CronGroupEditInp) Filter(ctx context.Context) (err error) {
if in.Name == "" {
err = gerror.New("名称不能为空")
return
}
if in.Id > 0 && in.Id == in.Pid {
err = gerror.New("上级分组不能是自己")
return
}
return
}
type CronGroupEditModel struct{}
// CronGroupUpdateFields 修改数据字段过滤
type CronGroupUpdateFields struct {
Id int64 `json:"id" description:"任务分组ID"`
Pid int64 `json:"pid" description:"父类字典类型ID"`
Name string `json:"name" description:"字典类型名称"`
Type string `json:"type" description:"字典类型"`
Sort int `json:"sort" description:"排序"`
Remark string `json:"remark" description:"备注"`
Status int `json:"status" description:"字典类型状态"`
}
// CronGroupInsertFields 新增数据字段过滤
type CronGroupInsertFields struct {
Pid int64 `json:"pid" description:"父类任务分组ID"`
Name string `json:"name" description:"分组名称"`
IsDefault int `json:"isDefault" description:"是否默认"`
Sort int `json:"sort" description:"排序"`
Remark string `json:"remark" description:"备注"`
Status int `json:"status" description:"分组状态"`
}
// CronGroupDeleteInp 删除字典类型
type CronGroupDeleteInp struct {
Id interface{}
}
type CronGroupDeleteModel struct{}
// CronGroupViewInp 获取信息
type CronGroupViewInp struct {
Id int64
}
type CronGroupViewModel struct {
entity.SysCronGroup
}
// CronGroupListInp 获取列表
type CronGroupListInp struct {
form.PageReq
form.StatusReq
Name string
}
type CronGroupListModel struct {
entity.SysCronGroup
SupName string `json:"supName" description:"上级分组名称"`
}
// CronGroupStatusInp 更新状态
type CronGroupStatusInp struct {
entity.SysCronGroup
}
func (in *CronGroupStatusInp) Filter(ctx context.Context) (err error) {
if in.Id <= 0 {
err = gerror.New("ID不能为空")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSlice(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
return
}
type CronGroupStatusModel struct{}
// CronGroupSelectInp 选项
type CronGroupSelectInp struct {
}
type CronGroupSelectModel struct {
List []*CronGroupTree `json:"list"`
}
type CronGroupTree struct {
entity.SysCronGroup
Disabled bool `json:"disabled" dc:"是否禁用"`
Label string `json:"label" dc:"标签"`
Value int64 `json:"value" dc:"键值"`
Key int64 `json:"key" dc:"键名"`
Children []*CronGroupTree `json:"children" dc:"子级"`
}
@@ -0,0 +1,201 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2025 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.18.6
package sysin
import (
"context"
"hotgo/internal/consts"
"hotgo/internal/library/hgorm/hook"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/validate"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// CurdDemoUpdateFields 修改CURD列表字段过滤
type CurdDemoUpdateFields struct {
Title string `json:"title" dc:"标题"`
Description string `json:"description" dc:"描述"`
Content string `json:"content" dc:"内容"`
Image string `json:"image" dc:"单图"`
Attachfile string `json:"attachfile" dc:"附件"`
CityId int64 `json:"cityId" dc:"所在城市"`
Switch int `json:"switch" dc:"显示开关"`
Sort int `json:"sort" dc:"排序"`
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
}
// CurdDemoInsertFields 新增CURD列表字段过滤
type CurdDemoInsertFields struct {
Title string `json:"title" dc:"标题"`
Description string `json:"description" dc:"描述"`
Content string `json:"content" dc:"内容"`
Image string `json:"image" dc:"单图"`
Attachfile string `json:"attachfile" dc:"附件"`
CityId int64 `json:"cityId" dc:"所在城市"`
Switch int `json:"switch" dc:"显示开关"`
Sort int `json:"sort" dc:"排序"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
}
// CurdDemoEditInp 修改/新增CURD列表
type CurdDemoEditInp struct {
entity.SysGenCurdDemo
}
func (in *CurdDemoEditInp) Filter(ctx context.Context) (err error) {
// 验证标题
if err := g.Validator().Rules("required").Data(in.Title).Messages("标题不能为空").Run(ctx); err != nil {
return err.Current()
}
// 验证描述
if err := g.Validator().Rules("required").Data(in.Description).Messages("描述不能为空").Run(ctx); err != nil {
return err.Current()
}
// 验证内容
if err := g.Validator().Rules("required").Data(in.Content).Messages("内容不能为空").Run(ctx); err != nil {
return err.Current()
}
// 验证排序
if err := g.Validator().Rules("required").Data(in.Sort).Messages("排序不能为空").Run(ctx); err != nil {
return err.Current()
}
return
}
type CurdDemoEditModel struct{}
// CurdDemoDeleteInp 删除CURD列表
type CurdDemoDeleteInp struct {
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *CurdDemoDeleteInp) Filter(ctx context.Context) (err error) {
return
}
type CurdDemoDeleteModel struct{}
// CurdDemoViewInp 获取指定CURD列表信息
type CurdDemoViewInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *CurdDemoViewInp) Filter(ctx context.Context) (err error) {
return
}
type CurdDemoViewModel struct {
entity.SysGenCurdDemo
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者摘要信息"`
DeletedBySumma *hook.MemberSumma `json:"deletedBySumma" dc:"删除者摘要信息"`
}
// CurdDemoListInp 获取CURD列表列表
type CurdDemoListInp struct {
form.PageReq
Id int64 `json:"id" dc:"ID"`
Title string `json:"title" dc:"标题"`
Description string `json:"description" dc:"描述"`
CreatedBy string `json:"createdBy" dc:"创建者"`
DeletedBy string `json:"deletedBy" dc:"删除者"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
TestCategoryName string `json:"testCategoryName" dc:"关联分类"`
}
func (in *CurdDemoListInp) Filter(ctx context.Context) (err error) {
return
}
type CurdDemoListModel struct {
Id int64 `json:"id" dc:"ID"`
Title string `json:"title" dc:"标题"`
Description string `json:"description" dc:"描述"`
Image string `json:"image" dc:"单图"`
Attachfile string `json:"attachfile" dc:"附件"`
Switch int `json:"switch" dc:"显示开关"`
Sort int `json:"sort" dc:"排序"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者摘要信息"`
DeletedBy int64 `json:"deletedBy" dc:"删除者"`
DeletedBySumma *hook.MemberSumma `json:"deletedBySumma" dc:"删除者摘要信息"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
TestCategoryName string `json:"testCategoryName" dc:"关联分类"`
}
// CurdDemoExportModel 导出CURD列表
type CurdDemoExportModel struct {
Id int64 `json:"id" dc:"ID"`
Title string `json:"title" dc:"标题"`
Description string `json:"description" dc:"描述"`
Image string `json:"image" dc:"单图"`
Attachfile string `json:"attachfile" dc:"附件"`
CityId int64 `json:"cityId" dc:"所在城市"`
Switch int `json:"switch" dc:"显示开关"`
Sort int `json:"sort" dc:"排序"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
DeletedBy int64 `json:"deletedBy" dc:"删除者"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
TestCategoryName string `json:"testCategoryName" dc:"关联分类"`
}
// CurdDemoMaxSortInp 获取CURD列表最大排序
type CurdDemoMaxSortInp struct{}
func (in *CurdDemoMaxSortInp) Filter(ctx context.Context) (err error) {
return
}
type CurdDemoMaxSortModel struct {
Sort int `json:"sort" description:"排序"`
}
// CurdDemoStatusInp 更新CURD列表状态
type CurdDemoStatusInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
Status int `json:"status" dc:"状态"`
}
func (in *CurdDemoStatusInp) Filter(ctx context.Context) (err error) {
if in.Id <= 0 {
err = gerror.New("ID不能为空")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSlice(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
return
}
type CurdDemoStatusModel struct{}
// CurdDemoSwitchInp 更新CURD列表开关状态
type CurdDemoSwitchInp struct {
form.SwitchReq
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *CurdDemoSwitchInp) Filter(ctx context.Context) (err error) {
return
}
type CurdDemoSwitchModel struct{}
@@ -0,0 +1,92 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"hotgo/internal/model"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// DictDataEditInp 修改/新增字典数据
type DictDataEditInp struct {
entity.SysDictData
TypeID int64 `json:"typeID" dc:"字典类型ID"`
}
func (in *DictDataEditInp) Filter(ctx context.Context) (err error) {
if in.Label == "" {
err = gerror.New("字典标签不能为空")
return
}
if in.Id > 0 && in.TypeID <= 0 {
err = gerror.New("字典类型不能为空")
return
}
return
}
type DictDataEditModel struct{}
// DictDataUpdateFields 修改数据字段过滤
type DictDataUpdateFields struct {
Id int64 `json:"id" description:"字典数据ID"`
Label string `json:"label" description:"字典标签"`
Value string `json:"value" description:"字典键值"`
ValueType string `json:"valueType" description:"键值数据类型:string,int,uint,bool,datetime,date"`
Type string `json:"type" description:"字典类型"`
ListClass string `json:"listClass" description:"表格回显样式"`
IsDefault int `json:"isDefault" description:"是否为系统默认"`
Sort int `json:"sort" description:"字典排序"`
Remark string `json:"remark" description:"备注"`
Status int `json:"status" description:"状态"`
}
// DictDataInsertFields 新增数据字段过滤
type DictDataInsertFields struct {
Label string `json:"label" description:"字典标签"`
Value string `json:"value" description:"字典键值"`
ValueType string `json:"valueType" description:"键值数据类型:string,int,uint,bool,datetime,date"`
Type string `json:"type" description:"字典类型"`
ListClass string `json:"listClass" description:"表格回显样式"`
IsDefault int `json:"isDefault" description:"是否为系统默认"`
Sort int `json:"sort" description:"字典排序"`
Remark string `json:"remark" description:"备注"`
Status int `json:"status" description:"状态"`
}
// DictDataDeleteInp 删除字典数据
type DictDataDeleteInp struct {
Id interface{} `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"`
}
type DictDataDeleteModel struct{}
// DictDataListInp 获取列表
type DictDataListInp struct {
form.PageReq
form.StatusReq
TypeID int64 `json:"typeId" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
Type string `json:"type" dc:"字典类型"`
Label string `json:"label" dc:"字典标签"`
Value string `json:"value" dc:"字典键值"`
}
type DictDataListModel struct {
TypeID int64 `json:"typeId"`
Key string `json:"key"`
entity.SysDictData
}
// DataSelectInp 获取指定字典选项
type DataSelectInp struct {
Type string `in:"path" v:"required#字典类型不能为空" dc:"字典类型"`
}
type DataSelectModel []*model.Option
@@ -0,0 +1,76 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
)
// DictTypeEditInp 修改/新增字典数据
type DictTypeEditInp struct {
entity.SysDictType
}
func (in *DictTypeEditInp) Filter(ctx context.Context) (err error) {
if in.Name == "" {
err = gerror.New("名称不能为空")
return
}
if in.Id > 0 && in.Id == in.Pid {
err = gerror.New("上级字典不能是自己")
return
}
return
}
type DictTypeEditModel struct{}
// DictTypeUpdateFields 修改数据字段过滤
type DictTypeUpdateFields struct {
Id int64 `json:"id" description:"字典类型ID"`
Pid int64 `json:"pid" description:"父类字典类型ID"`
Name string `json:"name" description:"字典类型名称"`
Type string `json:"type" description:"字典类型"`
Sort int `json:"sort" description:"排序"`
Remark string `json:"remark" description:"备注"`
Status int `json:"status" description:"字典类型状态"`
}
// DictTypeInsertFields 新增数据字段过滤
type DictTypeInsertFields struct {
Pid int64 `json:"pid" description:"父类字典类型ID"`
Name string `json:"name" description:"字典类型名称"`
Type string `json:"type" description:"字典类型"`
Sort int `json:"sort" description:"排序"`
Remark string `json:"remark" description:"备注"`
Status int `json:"status" description:"字典类型状态"`
}
// DictTypeDeleteInp 删除字典类型
type DictTypeDeleteInp struct {
Id interface{} `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
}
type DictTypeDeleteModel struct{}
// DictTreeSelectInp 获取类型关系树选项
type DictTreeSelectInp struct {
}
type DictTreeSelectModel []g.Map
type DictTypeTree struct {
entity.SysDictType
Disabled bool `json:"disabled" dc:"是否禁用"`
Label string `json:"label" dc:"标签"`
Value int64 `json:"value" dc:"键值"`
Key int64 `json:"key" dc:"键名"`
Children []*DictTypeTree `json:"children" dc:"子级"`
}
@@ -0,0 +1,72 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// EmsLogEditInp 修改/新增数据
type EmsLogEditInp struct {
entity.SysEmsLog
}
type EmsLogEditModel struct{}
// EmsLogDeleteInp 删除
type EmsLogDeleteInp struct {
Id interface{} `json:"id" v:"required#邮件记录ID不能为空" dc:"邮件记录ID"`
}
type EmsLogDeleteModel struct{}
// EmsLogViewInp 获取信息
type EmsLogViewInp struct {
Id int64 `json:"id" v:"required#邮件记录ID不能为空" dc:"邮件记录ID"`
}
type EmsLogViewModel struct {
entity.SysEmsLog
}
// EmsLogListInp 获取列表
type EmsLogListInp struct {
form.PageReq
form.StatusReq
Title string `json:"title"`
Content string `json:"content"`
}
type EmsLogListModel struct {
entity.SysEmsLog
}
// EmsLogStatusInp 更新状态
type EmsLogStatusInp struct {
entity.SysSmsLog
}
type EmsLogStatusModel struct{}
// SendEmsInp 发送邮件
type SendEmsInp struct {
Event string `json:"event" v:"required#邮件事件不能为空" description:"事件"`
Email string `json:"email" v:"required#邮箱地址不能为空" description:"邮箱地址"`
Code string `json:"code" description:"验证码或短信内容"`
Content string `json:"content" description:"邮件内容"`
Template string `json:"-" description:"发信模板"`
TplData g.Map `json:"-" description:"模板变量"`
}
// VerifyEmsCodeInp 效验验证码
type VerifyEmsCodeInp struct {
Event string `json:"event" v:"required#邮件事件不能为空" description:"事件"`
Email string `json:"email" v:"required#邮箱地址不能为空" description:"邮箱地址"`
Code string `json:"code" description:"验证码"`
}
@@ -0,0 +1,235 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/text/gregex"
"github.com/gogf/gf/v2/util/gconv"
"hotgo/internal/consts"
"hotgo/internal/model"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// GenCodesMaxSortInp 最大排序
type GenCodesMaxSortInp struct {
Id int64 `json:"id" dc:"生成代码ID"`
}
type GenCodesMaxSortModel struct {
Sort int `json:"sort" dc:"排序"`
}
// GenCodesEditInp 修改/新增数据
type GenCodesEditInp struct {
entity.SysGenCodes
}
func (in *GenCodesEditInp) Filter(ctx context.Context) (err error) {
return genFilter(ctx, in.SysGenCodes)
}
type GenCodesEditModel struct {
entity.SysGenCodes
}
// GenCodesDeleteInp 删除
type GenCodesDeleteInp struct {
Id interface{} `json:"id" v:"required#生成代码ID不能为空" dc:"生成代码ID"`
}
type GenCodesDeleteModel struct{}
// GenCodesViewInp 获取信息
type GenCodesViewInp struct {
Id int64 `json:"id" v:"required#生成代码ID不能为空" dc:"生成代码ID"`
}
type GenCodesViewModel struct {
entity.SysGenCodes
}
// GenCodesListInp 获取列表
type GenCodesListInp struct {
form.PageReq
form.StatusReq
GenType int `json:"genType" dc:"生成类型"`
VarName string `json:"varName" dc:"实体"`
}
type GenCodesListModel struct {
entity.SysGenCodes
GenTemplateGroup string `json:"genTemplateGroup" dc:"生成模板组名"`
}
// GenCodesStatusInp 更新状态
type GenCodesStatusInp struct {
Id int64 `json:"id" description:"生成ID"`
Status int `json:"status" description:"生成状态"`
}
type GenCodesStatusModel struct{}
// GenCodesSelectsInp 选项
type GenCodesSelectsInp struct {
}
type GenCodesSelectsModel struct {
GenType GenTypeSelects `json:"genType" dc:"生成类型"`
Db form.Selects `json:"db" dc:"数据库选项"`
Status form.Selects `json:"status" dc:"生成状态"`
LinkMode form.Selects `json:"linkMode" dc:"关联表方式"`
BuildMeth form.Selects `json:"buildMeth" dc:"生成方式"`
// 字段表格选项
FormMode form.Selects `json:"formMode" dc:"表单组件"`
FormRole form.Selects `json:"formRole" dc:"表单验证"`
DictMode []*DictTypeTree `json:"dictMode" dc:"字典类型"`
WhereMode form.Selects `json:"whereMode" dc:"查询条件"`
Addons form.Selects `json:"addons" dc:"插件选项"`
TableAlign form.Selects `json:"tableAlign" dc:"表格排列方式"`
TreeStyleType []*model.Option `json:"treeStyleType" dc:"树表样式选项"`
}
type GenTypeSelects []*GenTypeSelect
type GenTypeSelect struct {
Value int `json:"value"`
Label string `json:"label"`
Name string `json:"name"`
Templates GenTemplateSelects `json:"templates"`
}
type GenTemplateSelects []*GenTemplateSelect
type GenTemplateSelect struct {
Value interface{} `json:"value"`
Label string `json:"label"`
Name string `json:"name"`
IsAddon bool `json:"isAddon"`
}
func (p GenTemplateSelects) Len() int {
return len(p)
}
func (p GenTemplateSelects) Swap(i, j int) {
p[i], p[j] = p[j], p[i]
}
func (p GenTemplateSelects) Less(i, j int) bool {
return gconv.Int64(p[j].Value) > gconv.Int64(p[i].Value)
}
func (p GenTypeSelects) Len() int {
return len(p)
}
func (p GenTypeSelects) Swap(i, j int) {
p[i], p[j] = p[j], p[i]
}
func (p GenTypeSelects) Less(i, j int) bool {
return gconv.Int64(p[j].Value) > gconv.Int64(p[i].Value)
}
// GenCodesTableSelectInp 数据库表选项
type GenCodesTableSelectInp struct {
Name string `json:"name" dc:"数据库配置名称"`
}
type GenCodesTableSelectModel struct {
Value string `json:"value"`
Label string `json:"label"`
Name string `json:"name"`
DaoName string `json:"daoName" dc:"orm模型名称"`
DefVarName string `json:"defVarName" dc:"默认实体名称"`
DefAlias string `json:"defAlias" dc:"默认关联表别名"`
DefTableComment string `json:"defTableComment" dc:"默认菜单名称"`
}
// GenCodesColumnSelectInp 表字段选项
type GenCodesColumnSelectInp struct {
Name string `json:"name" dc:"数据库配置名称"`
Table string `json:"table" dc:"表名称"`
}
type GenCodesColumnSelectModel struct {
Value string `json:"value"`
Label string `json:"label"`
Name string `json:"name"`
}
// GenCodesColumnListInp 表字段列表
type GenCodesColumnListInp struct {
Name string `json:"name" dc:"数据库配置名称"`
Table string `json:"table" dc:"表名称"`
IsLink int64 `json:"isLink" dc:"是否是关联表"`
Alias string `json:"alias" dc:"关联表别名"`
}
type GenCodesColumnListModel struct {
model.GenCodesColumn
}
// GenCodesPreviewInp 生成预览
type GenCodesPreviewInp struct {
entity.SysGenCodes
}
func (in *GenCodesPreviewInp) Filter(ctx context.Context) (err error) {
return genFilter(ctx, in.SysGenCodes)
}
// GenFile 生成文件配置
type GenFile struct {
Content string `json:"content" dc:"页面内容"`
Path string `json:"path" dc:"生成路径"`
Meth int `json:"meth" dc:"生成方式"`
Required bool `json:"required" dc:"是否是必要构建文件"`
}
type GenCodesPreviewModel struct {
Config *model.GenerateConfig `json:"config"`
Views map[string]*GenFile `json:"views" dc:"页面"`
}
// GenCodesBuildInp 提交生成
type GenCodesBuildInp struct {
entity.SysGenCodes
}
func (in *GenCodesBuildInp) Filter(ctx context.Context) (err error) {
return genFilter(ctx, in.SysGenCodes)
}
func genFilter(ctx context.Context, in entity.SysGenCodes) (err error) {
if in.VarName == "" {
err = gerror.New("实体命名不能为空")
return
}
if !gregex.IsMatchString(`^[a-zA-Z]{1}\w{1,23}$`, in.VarName) {
err = gerror.New("实体命名格式不正确,字母开头,只能包含字母、数字和下划线,长度在2~24之间")
return
}
if in.GenType == consts.GenCodesTypeCurd || in.GenType == consts.GenCodesTypeTree {
if in.DbName == "" {
err = gerror.New("数据库不能为空")
return
}
if in.TableName == "" {
err = gerror.New("数据库表不能为空")
return
}
if in.TableComment == "" {
err = gerror.New("菜单名称不能为空")
return
}
}
return
}
+58
View File
@@ -0,0 +1,58 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// LogListInp 获取菜单列表
type LogListInp struct {
form.PageReq
form.StatusReq
ReqId string `json:"reqId" dc:"对外ID"`
Module string `json:"module" dc:"应用端口"`
MemberId int `json:"memberId" dc:"用户ID"`
TakeUpTime string `json:"takeUpTime" dc:"请求耗时"`
Method string `json:"method" dc:"请求方式"`
Url string `json:"url" dc:"请求路径"`
Ip string `json:"ip" dc:"访问IP"`
ErrorCode string `json:"errorCode" dc:"状态码"`
CreatedAt []int64 `json:"createdAt" dc:"创建时间"`
Keyword string `json:"keyword" dc:"关键词"`
ComplexMemberId []string `json:"complexMemberId" dc:"操作人筛选"`
}
type LogListModel struct {
entity.SysLog
MemberName string `json:"memberName"`
Region string `json:"region"`
CityLabel string `json:"cityLabel" dc:"城市标签"`
Tags string `json:"tags" dc:"接口所属的标签,用于接口分类"`
Summary string `json:"summary" dc:"接口/参数概要描述"`
Description string `json:"description" dc:"接口/参数详细描述"`
}
// LogViewInp 获取信息
type LogViewInp struct {
Id string `json:"id" v:"required#日志ID不能为空" description:"日志ID"`
}
type LogViewModel struct {
entity.SysLog
CityLabel string `json:"cityLabel" dc:"城市标签"`
Tags string `json:"tags" dc:"接口所属的标签,用于接口分类"`
Summary string `json:"summary" dc:"接口/参数概要描述"`
Description string `json:"description" dc:"接口/参数详细描述"`
}
// LogDeleteInp 删除
type LogDeleteInp struct {
Id interface{} `json:"id" v:"required#日志ID不能为空" description:"日志ID"`
}
type LogDeleteModel struct{}
@@ -0,0 +1,79 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/form"
)
// LoginLogDeleteInp 删除登录日志
type LoginLogDeleteInp struct {
Id interface{} `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
}
type LoginLogDeleteModel struct{}
// LoginLogViewInp 获取指定登录日志信息
type LoginLogViewInp struct {
Id int64 `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
}
type LoginLogViewModel struct {
entity.SysLoginLog
}
// LoginLogListInp 获取登录日志列表
type LoginLogListInp struct {
form.PageReq
Username string `json:"username" dc:"用户名"`
Status int `json:"status" dc:"状态"`
LoginAt []*gtime.Time `json:"loginAt" dc:"登录时间"`
LoginIp string `json:"loginIp" dc:"登录IP"`
}
type LoginLogListModel struct {
entity.SysLoginLog
Os string `json:"os"`
Browser string `json:"browser"`
CityLabel string `json:"cityLabel"`
SysLogId gdb.Value `json:"sysLogId"`
}
func (in *LoginLogListInp) Filter(ctx context.Context) (err error) {
return
}
// LoginLogExportModel 导出登录日志
type LoginLogExportModel struct {
Id int64 `json:"id" orm:"id" description:"日志ID"`
ReqId string `json:"reqId" orm:"req_id" description:"请求ID"`
MemberId int64 `json:"memberId" orm:"member_id" description:"用户ID"`
Username string `json:"username" orm:"username" description:"用户名"`
Response *gjson.Json `json:"response" orm:"response" description:"响应数据"`
LoginAt *gtime.Time `json:"loginAt" orm:"login_at" description:"登录时间"`
LoginIp string `json:"loginIp" orm:"login_ip" description:"登录IP"`
ProvinceId int64 `json:"provinceId" orm:"province_id" description:"省编码"`
CityId int64 `json:"cityId" orm:"city_id" description:"市编码"`
UserAgent string `json:"userAgent" orm:"user_agent" description:"UA信息"`
ErrMsg string `json:"errMsg" orm:"err_msg" description:"错误提示"`
Status int `json:"status" orm:"status" description:"状态"`
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"修改时间"`
Os string `json:"os"`
Browser string `json:"browser"`
}
// LoginLogPushInp 解推送登录日志
type LoginLogPushInp struct {
Response *adminin.LoginModel
Err error
}
@@ -0,0 +1,145 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2024 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.15.7
package sysin
import (
"context"
"hotgo/internal/library/hgorm/hook"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/tree"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// NormalTreeDemoUpdateFields 修改普通树表字段过滤
type NormalTreeDemoUpdateFields struct {
Title string `json:"title" dc:"标题"`
Pid int64 `json:"pid" dc:"上级"`
Level int `json:"level" dc:"关系树级别"`
Tree string `json:"tree" dc:"关系树"`
CategoryId int64 `json:"categoryId" dc:"测试分类"`
Description string `json:"description" dc:"描述"`
Sort int `json:"sort" dc:"排序"`
Status int `json:"status" dc:"状态"`
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
}
// NormalTreeDemoInsertFields 新增普通树表字段过滤
type NormalTreeDemoInsertFields struct {
Title string `json:"title" dc:"标题"`
Pid int64 `json:"pid" dc:"上级"`
Level int `json:"level" dc:"关系树级别"`
Tree string `json:"tree" dc:"关系树"`
CategoryId int64 `json:"categoryId" dc:"测试分类"`
Description string `json:"description" dc:"描述"`
Sort int `json:"sort" dc:"排序"`
Status int `json:"status" dc:"状态"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
}
// NormalTreeDemoEditInp 修改/新增普通树表
type NormalTreeDemoEditInp struct {
entity.SysGenTreeDemo
}
func (in *NormalTreeDemoEditInp) Filter(ctx context.Context) (err error) {
// 验证标题
if err := g.Validator().Rules("required").Data(in.Title).Messages("标题不能为空").Run(ctx); err != nil {
return err.Current()
}
return
}
type NormalTreeDemoEditModel struct{}
// NormalTreeDemoDeleteInp 删除普通树表
type NormalTreeDemoDeleteInp struct {
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *NormalTreeDemoDeleteInp) Filter(ctx context.Context) (err error) {
return
}
type NormalTreeDemoDeleteModel struct{}
// NormalTreeDemoViewInp 获取指定普通树表信息
type NormalTreeDemoViewInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *NormalTreeDemoViewInp) Filter(ctx context.Context) (err error) {
return
}
type NormalTreeDemoViewModel struct {
entity.SysGenTreeDemo
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
}
// NormalTreeDemoListInp 获取普通树表列表
type NormalTreeDemoListInp struct {
form.PageReq
Title string `json:"title" dc:"标题"`
Pid int64 `json:"pid" dc:"上级"`
CategoryId int64 `json:"categoryId" dc:"测试分类"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *NormalTreeDemoListInp) Filter(ctx context.Context) (err error) {
return
}
type NormalTreeDemoListModel struct {
Title string `json:"title" dc:"标题"`
Id int64 `json:"id" dc:"ID"`
Pid int64 `json:"pid" dc:"上级"`
CategoryId int64 `json:"categoryId" dc:"测试分类"`
Description string `json:"description" dc:"描述"`
Status int `json:"status" dc:"状态"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
}
// NormalTreeDemoMaxSortInp 获取普通树表最大排序
type NormalTreeDemoMaxSortInp struct{}
func (in *NormalTreeDemoMaxSortInp) Filter(ctx context.Context) (err error) {
return
}
type NormalTreeDemoMaxSortModel struct {
Sort int `json:"sort" description:"排序"`
}
// NormalTreeDemoTreeOption 关系树选项
type NormalTreeDemoTreeOption struct {
Title string `json:"title" dc:"标题"`
Id int64 `json:"id" dc:"ID"`
Pid int64 `json:"pid" dc:"上级"`
Children []tree.Node `json:"children" dc:"子节点"`
}
// ID 获取节点ID
func (t *NormalTreeDemoTreeOption) ID() int64 {
return t.Id
}
// PID 获取父级节点ID
func (t *NormalTreeDemoTreeOption) PID() int64 {
return t.Pid
}
// SetChildren 设置子节点数据
func (t *NormalTreeDemoTreeOption) SetChildren(children []tree.Node) {
t.Children = children
}
@@ -0,0 +1,144 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2025 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.17.8
package sysin
import (
"context"
"hotgo/internal/library/hgorm/hook"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/tree"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// OptionTreeDemoUpdateFields 修改选项树表字段过滤
type OptionTreeDemoUpdateFields struct {
Title string `json:"title" dc:"标题"`
Pid int64 `json:"pid" dc:"上级"`
Level int `json:"level" dc:"关系树级别"`
Tree string `json:"tree" dc:"关系树"`
CategoryId int64 `json:"categoryId" dc:"测试分类"`
Description string `json:"description" dc:"描述"`
Sort int `json:"sort" dc:"排序"`
Status int `json:"status" dc:"状态"`
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
}
// OptionTreeDemoInsertFields 新增选项树表字段过滤
type OptionTreeDemoInsertFields struct {
Title string `json:"title" dc:"标题"`
Pid int64 `json:"pid" dc:"上级"`
Level int `json:"level" dc:"关系树级别"`
Tree string `json:"tree" dc:"关系树"`
CategoryId int64 `json:"categoryId" dc:"测试分类"`
Description string `json:"description" dc:"描述"`
Sort int `json:"sort" dc:"排序"`
Status int `json:"status" dc:"状态"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
}
// OptionTreeDemoEditInp 修改/新增选项树表
type OptionTreeDemoEditInp struct {
entity.SysGenTreeDemo
}
func (in *OptionTreeDemoEditInp) Filter(ctx context.Context) (err error) {
// 验证标题
if err := g.Validator().Rules("required").Data(in.Title).Messages("标题不能为空").Run(ctx); err != nil {
return err.Current()
}
return
}
type OptionTreeDemoEditModel struct{}
// OptionTreeDemoDeleteInp 删除选项树表
type OptionTreeDemoDeleteInp struct {
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *OptionTreeDemoDeleteInp) Filter(ctx context.Context) (err error) {
return
}
type OptionTreeDemoDeleteModel struct{}
// OptionTreeDemoViewInp 获取指定选项树表信息
type OptionTreeDemoViewInp struct {
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
}
func (in *OptionTreeDemoViewInp) Filter(ctx context.Context) (err error) {
return
}
type OptionTreeDemoViewModel struct {
entity.SysGenTreeDemo
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
}
// OptionTreeDemoListInp 获取选项树表列表
type OptionTreeDemoListInp struct {
form.PageReq
Title string `json:"title" dc:"标题"`
Pid int64 `json:"pid" dc:"上级"`
CategoryId int64 `json:"categoryId" dc:"测试分类"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *OptionTreeDemoListInp) Filter(ctx context.Context) (err error) {
return
}
type OptionTreeDemoListModel struct {
Title string `json:"title" dc:"标题"`
Id int64 `json:"id" dc:"ID"`
Pid int64 `json:"pid" dc:"上级"`
CategoryId int64 `json:"categoryId" dc:"测试分类"`
Status int `json:"status" dc:"状态"`
CreatedBy int64 `json:"createdBy" dc:"创建者"`
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
}
// OptionTreeDemoMaxSortInp 获取选项树表最大排序
type OptionTreeDemoMaxSortInp struct{}
func (in *OptionTreeDemoMaxSortInp) Filter(ctx context.Context) (err error) {
return
}
type OptionTreeDemoMaxSortModel struct {
Sort int `json:"sort" description:"排序"`
}
// OptionTreeDemoTreeOption 关系树选项
type OptionTreeDemoTreeOption struct {
Title string `json:"title" dc:"标题"`
Id int64 `json:"id" dc:"ID"`
Pid int64 `json:"pid" dc:"上级"`
Children []tree.Node `json:"children" dc:"子节点"`
}
// ID 获取节点ID
func (t *OptionTreeDemoTreeOption) ID() int64 {
return t.Id
}
// PID 获取父级节点ID
func (t *OptionTreeDemoTreeOption) PID() int64 {
return t.Pid
}
// SetChildren 设置子节点数据
func (t *OptionTreeDemoTreeOption) SetChildren(children []tree.Node) {
t.Children = children
}
@@ -0,0 +1,182 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"hotgo/internal/consts"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/validate"
)
// ProvincesMaxSortInp 最大排序
type ProvincesMaxSortInp struct {
}
type ProvincesMaxSortModel struct {
Sort int `json:"sort" dc:"排序"`
}
// ProvincesEditInp 修改/新增字典数据
type ProvincesEditInp struct {
entity.SysProvinces
}
func (in *ProvincesEditInp) Filter(ctx context.Context) (err error) {
if in.Title == "" {
err = gerror.New("标题不能为空")
return
}
if in.Id <= 0 {
err = gerror.New("地区Id必须大于0")
return
}
return
}
type ProvincesEditModel struct{}
// ProvincesUpdateFields 修改数据字段过滤
type ProvincesUpdateFields struct {
Id int64 `json:"id" description:"省市区ID"`
Title string `json:"title" description:"栏目名称"`
Pinyin string `json:"pinyin" description:"拼音"`
Lng string `json:"lng" description:"经度"`
Lat string `json:"lat" description:"纬度"`
Pid int64 `json:"pid" description:"父栏目"`
Level int `json:"level" description:"关系树等级"`
Tree string `json:"tree" description:"关系"`
Sort int `json:"sort" description:"排序"`
Status int `json:"status" description:"状态"`
}
// ProvincesInsertFields 新增数据字段过滤
type ProvincesInsertFields struct {
Id int64 `json:"id" description:"省市区ID"`
Title string `json:"title" description:"栏目名称"`
Pinyin string `json:"pinyin" description:"拼音"`
Lng string `json:"lng" description:"经度"`
Lat string `json:"lat" description:"纬度"`
Pid int64 `json:"pid" description:"父栏目"`
Level int `json:"level" description:"关系树等级"`
Tree string `json:"tree" description:"关系"`
Sort int `json:"sort" description:"排序"`
Status int `json:"status" description:"状态"`
}
// ProvincesDeleteInp 删除字典类型
type ProvincesDeleteInp struct {
Id interface{} `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
}
type ProvincesDeleteModel struct{}
// ProvincesViewInp 获取信息
type ProvincesViewInp struct {
Id int64
}
type ProvincesViewModel struct {
Id int64 `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
}
// ProvincesListInp 获取列表
type ProvincesListInp struct {
form.PageReq
form.StatusReq
Title string `json:"title"`
Content string `json:"content"`
}
type ProvincesListModel struct {
entity.SysProvinces
}
// ProvincesStatusInp 更新状态
type ProvincesStatusInp struct {
entity.SysProvinces
}
func (in *ProvincesStatusInp) Filter(ctx context.Context) (err error) {
if in.Id <= 0 {
err = gerror.New("ID不能为空")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSlice(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
return
}
type ProvincesStatusModel struct{}
// ProvincesChildrenListInp 获取省市区下级列表
type ProvincesChildrenListInp struct {
form.PageReq
form.StatusReq
Pid int64 `json:"pid" dc:"上级ID"`
Id int64 `json:"id" dc:"地区ID"`
Title string `json:"title" dc:"地区名称"`
}
type ProvincesChildrenListModel struct {
entity.SysProvinces
}
// ProvincesUniqueIdInp 获取省市区下级列表
type ProvincesUniqueIdInp struct {
OldId int64 `json:"oldId" dc:"原始ID"`
NewId int64 `json:"newId" dc:"新的ID"`
}
type ProvincesUniqueIdModel struct {
IsUnique bool `json:"unique" dc:"是否唯一"`
}
type ProvincesSelectInp struct {
DataType string `json:"dataType" v:"required#数据类型不能为空" dc:"数据类型"`
Value int64 `json:"value" dc:"上级ID"`
}
type ProvincesSelectModel struct {
List []*ProvincesSelectData `json:"list" dc:"数据列表"`
}
type ProvincesSelectData struct {
Label string `json:"label" description:"地区名称"`
Value int64 `json:"value" description:"地区ID"`
Level int `json:"level" description:"地区等级"`
IsLeaf bool `json:"isLeaf" description:"是否是最后一个节点"`
}
// ProvincesCityLabelInp 获取指定城市标签
type ProvincesCityLabelInp struct {
Id int64 `json:"oldId" dc:"城市ID"`
Spilt string `json:"spilt" dc:"分隔符"`
}
type ProvincesCityLabelModel string
// ProvincesTree 树
type ProvincesTree struct {
entity.SysProvinces
Key int64 `json:"key" dc:"key"`
Label string `json:"label" dc:"标签"`
Value int64 `json:"value" dc:"键值"`
Children []*ProvincesTree `json:"children"`
}
@@ -0,0 +1,190 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.7.6
package sysin
import (
"context"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/validate"
)
// ServeLicenseUpdateFields 修改服务许可证字段过滤
type ServeLicenseUpdateFields struct {
Group string `json:"group" dc:"分组"`
Name string `json:"name" dc:"许可名称"`
Appid string `json:"appid" dc:"应用ID"`
SecretKey string `json:"secretKey" dc:"应用秘钥"`
OnlineLimit int `json:"onlineLimit" dc:"在线数量限制,默认1"`
// Routes *gjson.Json `json:"routes" dc:"路由表,空使用默认分组路由"`
AllowedIps string `json:"allowedIps" dc:"白名单,*代表所有,只有允许的IP才能连接到tcp服务"`
EndAt *gtime.Time `json:"endAt" dc:"授权结束时间"`
Remark string `json:"remark" dc:"备注"`
Status int `json:"status" dc:"状态"`
}
// ServeLicenseInsertFields 新增服务许可证字段过滤
type ServeLicenseInsertFields struct {
Group string `json:"group" dc:"分组"`
Name string `json:"name" dc:"许可名称"`
Appid string `json:"appid" dc:"应用ID"`
SecretKey string `json:"secretKey" dc:"应用秘钥"`
OnlineLimit int `json:"onlineLimit" dc:"在线数量限制,默认1"`
// Routes *gjson.Json `json:"routes" dc:"路由表,空使用默认分组路由"`
AllowedIps string `json:"allowedIps" dc:"白名单,*代表所有,只有允许的IP才能连接到tcp服务"`
EndAt *gtime.Time `json:"endAt" dc:"授权结束时间"`
Remark string `json:"remark" dc:"备注"`
Status int `json:"status" dc:"状态"`
}
// ServeLicenseEditInp 修改/新增服务许可证
type ServeLicenseEditInp struct {
entity.SysServeLicense
}
func (in *ServeLicenseEditInp) Filter(ctx context.Context) (err error) {
// 验证分组
if err := g.Validator().Rules("required").Data(in.Group).Messages("分组不能为空").Run(ctx); err != nil {
return err.Current()
}
// 验证许可名称
if err := g.Validator().Rules("required").Data(in.Name).Messages("许可名称不能为空").Run(ctx); err != nil {
return err.Current()
}
// 验证应用ID
if err := g.Validator().Rules("required").Data(in.Appid).Messages("应用ID不能为空").Run(ctx); err != nil {
return err.Current()
}
// 验证授权结束时间
if err := g.Validator().Rules("required").Data(in.EndAt).Messages("授权结束时间不能为空").Run(ctx); err != nil {
return err.Current()
}
return
}
type ServeLicenseEditModel struct{}
// ServeLicenseDeleteInp 删除服务许可证
type ServeLicenseDeleteInp struct {
Id interface{} `json:"id" v:"required#许可ID不能为空" dc:"许可ID"`
}
func (in *ServeLicenseDeleteInp) Filter(ctx context.Context) (err error) {
return
}
type ServeLicenseDeleteModel struct{}
// ServeLicenseViewInp 获取指定服务许可证信息
type ServeLicenseViewInp struct {
Id int64 `json:"id" v:"required#许可ID不能为空" dc:"许可ID"`
}
func (in *ServeLicenseViewInp) Filter(ctx context.Context) (err error) {
return
}
type ServeLicenseViewModel struct {
entity.SysServeLicense
}
// ServeLicenseListInp 获取服务许可证列表
type ServeLicenseListInp struct {
form.PageReq
Id int64 `json:"id" dc:"许可ID"`
Group string `json:"group" dc:"分组"`
Name string `json:"name" dc:"许可名称"`
Appid string `json:"appid" dc:"应用ID"`
EndAt []*gtime.Time `json:"endAt" dc:"授权结束时间"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *ServeLicenseListInp) Filter(ctx context.Context) (err error) {
return
}
type ServeLicenseListModel struct {
Id int64 `json:"id" dc:"许可ID"`
Group string `json:"group" dc:"分组"`
Name string `json:"name" dc:"许可名称"`
Appid string `json:"appid" dc:"应用ID"`
SecretKey string `json:"secretKey" dc:"应用秘钥"`
RemoteAddr string `json:"remoteAddr" dc:"最后连接地址"`
OnlineLimit int `json:"onlineLimit" dc:"在线数量限制,默认1"`
LoginTimes int64 `json:"loginTimes" dc:"登录次数"`
LastLoginAt *gtime.Time `json:"lastLoginAt" dc:"最后登录时间"`
LastActiveAt *gtime.Time `json:"lastActiveAt" dc:"最后活跃时间"`
EndAt *gtime.Time `json:"endAt" dc:"授权结束时间"`
Routes *gjson.Json `json:"routes" dc:"路由表,空使用默认分组路由"`
Status int `json:"status" dc:"状态"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
Online int `json:"online" dc:"在线"`
}
// ServeLicenseExportModel 导出服务许可证
type ServeLicenseExportModel struct {
Id int64 `json:"id" dc:"许可ID"`
Group string `json:"group" dc:"分组"`
Name string `json:"name" dc:"许可名称"`
Appid string `json:"appid" dc:"应用ID"`
SecretKey string `json:"secretKey" dc:"应用秘钥"`
RemoteAddr string `json:"remoteAddr" dc:"最后连接地址"`
OnlineLimit int `json:"onlineLimit" dc:"在线数量限制,默认1"`
LoginTimes int64 `json:"loginTimes" dc:"登录次数"`
LastLoginAt *gtime.Time `json:"lastLoginAt" dc:"最后登录时间"`
LastActiveAt *gtime.Time `json:"lastActiveAt" dc:"最后活跃时间"`
EndAt *gtime.Time `json:"endAt" dc:"授权结束时间"`
Status int `json:"status" dc:"状态"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
}
// ServeLicenseStatusInp 更新服务许可证状态
type ServeLicenseStatusInp struct {
Id int64 `json:"id" v:"required#许可ID不能为空" dc:"许可ID"`
Status int `json:"status" dc:"状态"`
}
func (in *ServeLicenseStatusInp) Filter(ctx context.Context) (err error) {
if in.Id <= 0 {
err = gerror.New("许可ID不能为空")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSlice(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
return
}
type ServeLicenseStatusModel struct{}
type ServeLicenseAssignRouterInp struct {
Id int64 `json:"id" v:"required#许可ID不能为空" dc:"许可ID"`
Routes *gjson.Json `json:"routes" dc:"路由表,空使用默认分组路由"`
}
func (in *ServeLicenseAssignRouterInp) Filter(ctx context.Context) (err error) {
return
}
@@ -0,0 +1,69 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// ServeLogDeleteInp 删除服务日志
type ServeLogDeleteInp struct {
Id interface{} `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
}
type ServeLogDeleteModel struct{}
// ServeLogViewInp 获取指定服务日志信息
type ServeLogViewInp struct {
Id int64 `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
}
type ServeLogViewModel struct {
entity.SysServeLog
}
// ServeLogListInp 获取服务日志列表
type ServeLogListInp struct {
form.PageReq
TraceId string `json:"traceId" dc:"链路ID"`
LevelFormat string `json:"levelFormat" dc:"日志级别"`
Content string `json:"content" dc:"日志内容"`
TriggerNs []int64 `json:"triggerNs" dc:"触发时间(ns)"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
type ServeLogListModel struct {
Id int64 `json:"id" dc:"日志ID"`
TraceId string `json:"traceId" dc:"链路ID"`
LevelFormat string `json:"levelFormat" dc:"日志级别"`
Content string `json:"content" dc:"日志内容"`
Stack string `json:"stack" dc:"堆栈"`
Line string `json:"line" dc:"调用行"`
TriggerNs int64 `json:"triggerNs" dc:"触发时间(ns)"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
SysLogId int64 `json:"sysLogId" dc:"访问日志ID"`
}
func (in *ServeLogListInp) Filter(ctx context.Context) (err error) {
return
}
// ServeLogExportModel 导出服务日志
type ServeLogExportModel struct {
Id int64 `json:"id" dc:"日志ID"`
Env string `json:"env" dc:"环境"`
TraceId string `json:"traceId" dc:"链路ID"`
LevelFormat string `json:"levelFormat" dc:"日志级别"`
Content string `json:"content" dc:"日志内容"`
Line string `json:"line" dc:"调用行"`
TriggerNs int64 `json:"triggerNs" dc:"触发时间(ns)"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
}
@@ -0,0 +1,84 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sysin
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// SmsLogEditInp 修改/新增数据
type SmsLogEditInp struct {
entity.SysSmsLog
}
type SmsLogEditModel struct{}
// SmsLogDeleteInp 删除
type SmsLogDeleteInp struct {
Id interface{} `json:"id" v:"required#短信记录ID不能为空" dc:"短信记录ID"`
}
type SmsLogDeleteModel struct{}
// SmsLogViewInp 获取信息
type SmsLogViewInp struct {
Id int64 `json:"id" v:"required#短信记录ID不能为空" dc:"短信记录ID"`
}
type SmsLogViewModel struct {
entity.SysSmsLog
}
// SmsLogListInp 获取列表
type SmsLogListInp struct {
form.PageReq
form.StatusReq
Mobile string `json:"mobile" dc:"手机号"`
Ip string `json:"ip" dc:"IP"`
Event string `json:"event" dc:"事件"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *SmsLogListInp) Filter(ctx context.Context) (err error) {
if in.Event != "" {
if _, ok := consts.SmsTemplateEventMap[in.Event]; !ok {
err = gerror.Newf("无效的事件类型:%v", in.Event)
return
}
}
return
}
type SmsLogListModel struct {
entity.SysSmsLog
}
// SmsLogStatusInp 更新状态
type SmsLogStatusInp struct {
entity.SysSmsLog
}
type SmsLogStatusModel struct{}
// SendCodeInp 发送验证码
type SendCodeInp struct {
Event string `json:"event" description:"事件"` // 必填
Mobile string `json:"mobile" description:"手机号"` // 必填
Code string `json:"code" description:"验证码或短信内容"`
Template string `json:"-" description:"发信模板 "`
}
// VerifyCodeInp 效验验证码
type VerifyCodeInp struct {
Event string `json:"event" description:"事件"` // 必填
Mobile string `json:"mobile" description:"手机号"` // 必填
Code string `json:"code" description:"验证码或短信内容"` // 必填
}
@@ -0,0 +1,143 @@
// Package sysin
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2024 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.15.7
package sysin
import (
"context"
"hotgo/internal/consts"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/utility/validate"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// TestCategoryUpdateFields 修改测试分类字段过滤
type TestCategoryUpdateFields struct {
Name string `json:"name" dc:"分类名称"`
ShortName string `json:"shortName" dc:"简称"`
Description string `json:"description" dc:"描述"`
Sort int `json:"sort" dc:"排序"`
Status int `json:"status" dc:"状态"`
Remark string `json:"remark" dc:"备注"`
}
// TestCategoryInsertFields 新增测试分类字段过滤
type TestCategoryInsertFields struct {
Name string `json:"name" dc:"分类名称"`
ShortName string `json:"shortName" dc:"简称"`
Description string `json:"description" dc:"描述"`
Sort int `json:"sort" dc:"排序"`
Status int `json:"status" dc:"状态"`
Remark string `json:"remark" dc:"备注"`
}
// TestCategoryEditInp 修改/新增测试分类
type TestCategoryEditInp struct {
entity.TestCategory
}
func (in *TestCategoryEditInp) Filter(ctx context.Context) (err error) {
// 验证分类名称
if err := g.Validator().Rules("required").Data(in.Name).Messages("分类名称不能为空").Run(ctx); err != nil {
return err.Current()
}
// 验证排序
if err := g.Validator().Rules("required").Data(in.Sort).Messages("排序不能为空").Run(ctx); err != nil {
return err.Current()
}
return
}
type TestCategoryEditModel struct{}
// TestCategoryDeleteInp 删除测试分类
type TestCategoryDeleteInp struct {
Id interface{} `json:"id" v:"required#分类ID不能为空" dc:"分类ID"`
}
func (in *TestCategoryDeleteInp) Filter(ctx context.Context) (err error) {
return
}
type TestCategoryDeleteModel struct{}
// TestCategoryViewInp 获取指定测试分类信息
type TestCategoryViewInp struct {
Id int64 `json:"id" v:"required#分类ID不能为空" dc:"分类ID"`
}
func (in *TestCategoryViewInp) Filter(ctx context.Context) (err error) {
return
}
type TestCategoryViewModel struct {
entity.TestCategory
}
// TestCategoryListInp 获取测试分类列表
type TestCategoryListInp struct {
form.PageReq
Id int64 `json:"id" dc:"分类ID"`
Name string `json:"name" dc:"分类名称"`
Status int `json:"status" dc:"状态"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
}
func (in *TestCategoryListInp) Filter(ctx context.Context) (err error) {
return
}
type TestCategoryListModel struct {
Id int64 `json:"id" dc:"分类ID"`
Name string `json:"name" dc:"分类名称"`
ShortName string `json:"shortName" dc:"简称"`
Description string `json:"description" dc:"描述"`
Status int `json:"status" dc:"状态"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
}
// TestCategoryMaxSortInp 获取测试分类最大排序
type TestCategoryMaxSortInp struct{}
func (in *TestCategoryMaxSortInp) Filter(ctx context.Context) (err error) {
return
}
type TestCategoryMaxSortModel struct {
Sort int `json:"sort" description:"排序"`
}
// TestCategoryStatusInp 更新测试分类状态
type TestCategoryStatusInp struct {
Id int64 `json:"id" v:"required#分类ID不能为空" dc:"分类ID"`
Status int `json:"status" dc:"状态"`
}
func (in *TestCategoryStatusInp) Filter(ctx context.Context) (err error) {
if in.Id <= 0 {
err = gerror.New("分类ID不能为空")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSlice(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
return
}
type TestCategoryStatusModel struct{}