mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-13 04:33:44 +08:00
发布v2.8.4版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -16,25 +16,26 @@ import (
|
||||
// AddonsListInp 获取列表
|
||||
type AddonsListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name"`
|
||||
Group int `json:"group"`
|
||||
Status int `json:"status"`
|
||||
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:"是否可以更新"`
|
||||
GroupName string `json:"groupName" dc:"分组名称"`
|
||||
InstallVersion string `json:"installVersion" dc:"安装版本"`
|
||||
InstallStatus int `json:"installStatus" dc:"安装状态"`
|
||||
CanSave bool `json:"canSave" dc:"是否可以更新"`
|
||||
}
|
||||
|
||||
// AddonsSelectsInp 选项
|
||||
type AddonsSelectsInp struct {
|
||||
}
|
||||
|
||||
type AddonsSelectsModel struct {
|
||||
GroupType form.Selects `json:"groupType" dc:"分组类型"`
|
||||
Status form.Selects `json:"status" dc:"安装状态"`
|
||||
Status form.Selects `json:"status" dc:"安装状态"`
|
||||
}
|
||||
|
||||
// AddonsBuildInp 提交生成
|
||||
@@ -52,7 +53,6 @@ func (in *AddonsBuildInp) Filter(ctx context.Context) (err error) {
|
||||
err = gerror.New("插件名称格式不正确,字母开头,只能包含字母、数字和下划线,长度在2~24之间")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -6,35 +6,74 @@
|
||||
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{}
|
||||
Id interface{} `json:"id" v:"required#附件ID不能为空" dc:"附件ID"`
|
||||
}
|
||||
|
||||
type AttachmentDeleteModel struct{}
|
||||
|
||||
// AttachmentViewInp 获取附件信息
|
||||
type AttachmentViewInp struct {
|
||||
Id int64
|
||||
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.RangeDateReq
|
||||
form.StatusReq
|
||||
MemberId int64
|
||||
Drive string
|
||||
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" description:"长度"`
|
||||
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:"上传类型"`
|
||||
}
|
||||
|
||||
@@ -3,38 +3,34 @@
|
||||
// @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"
|
||||
)
|
||||
|
||||
// BlacklistMaxSortInp 最大排序
|
||||
type BlacklistMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type BlacklistMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// BlacklistEditInp 修改/新增字典数据
|
||||
// BlacklistEditInp 修改/新增黑名单数据
|
||||
type BlacklistEditInp struct {
|
||||
entity.SysBlacklist
|
||||
}
|
||||
|
||||
type BlacklistEditModel struct{}
|
||||
|
||||
// BlacklistDeleteInp 删除字典类型
|
||||
// BlacklistDeleteInp 删除黑名单类型
|
||||
type BlacklistDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#黑名单ID不能为空" dc:"黑名单ID"`
|
||||
}
|
||||
|
||||
type BlacklistDeleteModel struct{}
|
||||
|
||||
// BlacklistViewInp 获取信息
|
||||
type BlacklistViewInp struct {
|
||||
Id int64
|
||||
Id int64 `json:"id" v:"required#黑名单ID不能为空" dc:"黑名单ID"`
|
||||
}
|
||||
|
||||
type BlacklistViewModel struct {
|
||||
@@ -44,9 +40,15 @@ type BlacklistViewModel struct {
|
||||
// BlacklistListInp 获取列表
|
||||
type BlacklistListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
|
||||
form.StatusReq
|
||||
Ip string
|
||||
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 {
|
||||
@@ -57,4 +59,23 @@ type BlacklistListModel struct {
|
||||
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{}
|
||||
|
||||
@@ -3,20 +3,12 @@
|
||||
// @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"
|
||||
)
|
||||
|
||||
type GetConfigItem struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// UpdateConfigInp 更新指定分组的配置
|
||||
type UpdateConfigInp struct {
|
||||
Group string `json:"group"`
|
||||
@@ -27,75 +19,7 @@ type UpdateConfigInp struct {
|
||||
type GetConfigInp struct {
|
||||
Group string `json:"group"`
|
||||
}
|
||||
|
||||
type GetConfigModel struct {
|
||||
List g.Map `json:"list"`
|
||||
}
|
||||
|
||||
// ConfigGetValueInp 获取指定配置键的值
|
||||
type ConfigGetValueInp struct {
|
||||
Key string
|
||||
}
|
||||
type ConfigGetValueModel struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
// ConfigNameUniqueInp 名称是否唯一
|
||||
type ConfigNameUniqueInp struct {
|
||||
Name string
|
||||
Id int64
|
||||
}
|
||||
|
||||
type ConfigNameUniqueModel struct {
|
||||
IsUnique bool
|
||||
}
|
||||
|
||||
// ConfigMaxSortInp 最大排序
|
||||
type ConfigMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type ConfigMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// ConfigEditInp 修改/新增字典数据
|
||||
type ConfigEditInp struct {
|
||||
entity.SysConfig
|
||||
}
|
||||
type ConfigEditModel struct{}
|
||||
|
||||
// ConfigDeleteInp 删除字典类型
|
||||
type ConfigDeleteInp struct {
|
||||
Id interface{}
|
||||
}
|
||||
type ConfigDeleteModel struct{}
|
||||
|
||||
// ConfigViewInp 获取信息
|
||||
type ConfigViewInp struct {
|
||||
Id string
|
||||
}
|
||||
|
||||
type ConfigViewModel struct {
|
||||
entity.SysConfig
|
||||
}
|
||||
|
||||
// ConfigListInp 获取列表
|
||||
type ConfigListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
Name string
|
||||
Code string
|
||||
DeptId int
|
||||
Mobile int
|
||||
Username string
|
||||
Realname string
|
||||
StartTime string
|
||||
EndTime string
|
||||
}
|
||||
|
||||
type ConfigListModel struct {
|
||||
entity.SysConfig
|
||||
DeptName string `json:"deptName"`
|
||||
RoleName string `json:"roleName"`
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ type CronViewModel struct {
|
||||
// CronListInp 获取列表
|
||||
type CronListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
|
||||
form.StatusReq
|
||||
Name string
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ func (in *CronGroupEditInp) Filter(ctx context.Context) (err error) {
|
||||
err = gerror.New("上级分组不能是自己")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -83,7 +82,7 @@ type CronGroupViewModel struct {
|
||||
// CronGroupListInp 获取列表
|
||||
type CronGroupListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
|
||||
form.StatusReq
|
||||
Name string
|
||||
}
|
||||
@@ -112,7 +111,6 @@ func (in *CronGroupStatusInp) Filter(ctx context.Context) (err error) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.7.3
|
||||
// @AutoGenerate Version 2.7.6
|
||||
package sysin
|
||||
|
||||
import (
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
// DictDataEditInp 修改/新增字典数据
|
||||
type DictDataEditInp struct {
|
||||
entity.SysDictData
|
||||
TypeID int64
|
||||
TypeID int64 `json:"typeID" dc:"字典类型ID"`
|
||||
}
|
||||
|
||||
func (in *DictDataEditInp) Filter(ctx context.Context) (err error) {
|
||||
@@ -28,7 +28,6 @@ func (in *DictDataEditInp) Filter(ctx context.Context) (err error) {
|
||||
err = gerror.New("字典类型不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -63,18 +62,19 @@ type DictDataInsertFields struct {
|
||||
|
||||
// DictDataDeleteInp 删除字典数据
|
||||
type DictDataDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"`
|
||||
}
|
||||
|
||||
type DictDataDeleteModel struct{}
|
||||
|
||||
// DictDataListInp 获取列表
|
||||
type DictDataListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
|
||||
form.StatusReq
|
||||
TypeID int64
|
||||
Type string
|
||||
Label string
|
||||
TypeID int64 `json:"typeId" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
|
||||
Type string `json:"type"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
type DictDataListModel struct {
|
||||
@@ -85,7 +85,7 @@ type DictDataListModel struct {
|
||||
|
||||
// DataSelectInp 获取指定字典选项
|
||||
type DataSelectInp struct {
|
||||
Type string
|
||||
Type string `in:"path" v:"required#字典类型不能为空" dc:"字典类型"`
|
||||
}
|
||||
|
||||
type DataSelectModel []*SelectData
|
||||
|
||||
@@ -27,7 +27,6 @@ func (in *DictTypeEditInp) Filter(ctx context.Context) (err error) {
|
||||
err = gerror.New("上级字典不能是自己")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -56,8 +55,9 @@ type DictTypeInsertFields struct {
|
||||
|
||||
// DictTypeDeleteInp 删除字典类型
|
||||
type DictTypeDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
|
||||
}
|
||||
|
||||
type DictTypeDeleteModel struct{}
|
||||
|
||||
// DictTreeSelectInp 获取类型关系树选项
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
@@ -16,12 +15,14 @@ import (
|
||||
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 获取信息
|
||||
@@ -36,7 +37,7 @@ type EmsLogViewModel struct {
|
||||
// EmsLogListInp 获取列表
|
||||
type EmsLogListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
|
||||
form.StatusReq
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
@@ -50,6 +51,7 @@ type EmsLogListModel struct {
|
||||
type EmsLogStatusInp struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
type EmsLogStatusModel struct{}
|
||||
|
||||
// SendEmsInp 发送邮件
|
||||
|
||||
@@ -18,11 +18,11 @@ import (
|
||||
|
||||
// GenCodesMaxSortInp 最大排序
|
||||
type GenCodesMaxSortInp struct {
|
||||
Id int64
|
||||
Id int64 `json:"id" dc:"生成代码ID"`
|
||||
}
|
||||
|
||||
type GenCodesMaxSortModel struct {
|
||||
Sort int
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
}
|
||||
|
||||
// GenCodesEditInp 修改/新增数据
|
||||
@@ -40,13 +40,14 @@ type GenCodesEditModel struct {
|
||||
|
||||
// GenCodesDeleteInp 删除
|
||||
type GenCodesDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#生成代码ID不能为空" dc:"生成代码ID"`
|
||||
}
|
||||
|
||||
type GenCodesDeleteModel struct{}
|
||||
|
||||
// GenCodesViewInp 获取信息
|
||||
type GenCodesViewInp struct {
|
||||
Id int64
|
||||
Id int64 `json:"id" v:"required#生成代码ID不能为空" dc:"生成代码ID"`
|
||||
}
|
||||
|
||||
type GenCodesViewModel struct {
|
||||
@@ -57,8 +58,8 @@ type GenCodesViewModel struct {
|
||||
type GenCodesListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
GenType int `json:"genType"`
|
||||
VarName string `json:"varName"`
|
||||
GenType int `json:"genType" dc:"生成类型"`
|
||||
VarName string `json:"varName" dc:"实体"`
|
||||
}
|
||||
|
||||
type GenCodesListModel struct {
|
||||
@@ -76,6 +77,7 @@ type GenCodesStatusModel struct{}
|
||||
// GenCodesSelectsInp 选项
|
||||
type GenCodesSelectsInp struct {
|
||||
}
|
||||
|
||||
type GenCodesSelectsModel struct {
|
||||
GenType GenTypeSelects `json:"genType" dc:"生成类型"`
|
||||
Db form.Selects `json:"db" dc:"数据库选项"`
|
||||
@@ -100,6 +102,7 @@ type GenTypeSelect struct {
|
||||
}
|
||||
|
||||
type GenTemplateSelects []*GenTemplateSelect
|
||||
|
||||
type GenTemplateSelect struct {
|
||||
Value interface{} `json:"value"`
|
||||
Label string `json:"label"`
|
||||
@@ -110,9 +113,11 @@ type GenTemplateSelect struct {
|
||||
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)
|
||||
}
|
||||
@@ -120,9 +125,11 @@ func (p GenTemplateSelects) Less(i, j int) bool {
|
||||
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)
|
||||
}
|
||||
@@ -131,6 +138,7 @@ func (p GenTypeSelects) Less(i, j int) bool {
|
||||
type GenCodesTableSelectInp struct {
|
||||
Name string `json:"name" dc:"数据库配置名称"`
|
||||
}
|
||||
|
||||
type GenCodesTableSelectModel struct {
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
@@ -146,6 +154,7 @@ type GenCodesColumnSelectInp struct {
|
||||
Name string `json:"name" dc:"数据库配置名称"`
|
||||
Table string `json:"table" dc:"表名称"`
|
||||
}
|
||||
|
||||
type GenCodesColumnSelectModel struct {
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
@@ -159,6 +168,7 @@ type GenCodesColumnListInp struct {
|
||||
IsLink int64 `json:"isLink" dc:"是否是关联表"`
|
||||
Alias string `json:"alias" dc:"关联表别名"`
|
||||
}
|
||||
|
||||
type GenCodesColumnListModel struct {
|
||||
model.GenCodesColumn
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
@@ -14,18 +13,15 @@ import (
|
||||
// LogListInp 获取菜单列表
|
||||
type LogListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
Module string
|
||||
MemberId int
|
||||
TakeUpTime int
|
||||
Method string
|
||||
Url string
|
||||
Ip string
|
||||
ErrorCode string
|
||||
StartTime string
|
||||
EndTime string
|
||||
CreatedAt []int64
|
||||
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:"状态码"`
|
||||
CreatedAt []int64 `json:"created_at" dc:"创建时间"`
|
||||
}
|
||||
|
||||
type LogListModel struct {
|
||||
@@ -36,7 +32,7 @@ type LogListModel struct {
|
||||
|
||||
// LogViewInp 获取信息
|
||||
type LogViewInp struct {
|
||||
Id string
|
||||
Id string `json:"id" v:"required#日志ID不能为空" description:"日志ID"`
|
||||
}
|
||||
|
||||
type LogViewModel struct {
|
||||
@@ -46,6 +42,7 @@ type LogViewModel struct {
|
||||
|
||||
// LogDeleteInp 删除
|
||||
type LogDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#日志ID不能为空" description:"日志ID"`
|
||||
}
|
||||
|
||||
type LogDeleteModel struct{}
|
||||
|
||||
@@ -74,6 +74,7 @@ type ProvincesInsertFields struct {
|
||||
type ProvincesDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
|
||||
}
|
||||
|
||||
type ProvincesDeleteModel struct{}
|
||||
|
||||
// ProvincesViewInp 获取信息
|
||||
@@ -82,16 +83,16 @@ type ProvincesViewInp struct {
|
||||
}
|
||||
|
||||
type ProvincesViewModel struct {
|
||||
entity.SysProvinces
|
||||
Id int64 `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
|
||||
}
|
||||
|
||||
// ProvincesListInp 获取列表
|
||||
type ProvincesListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
|
||||
form.StatusReq
|
||||
Title string
|
||||
Content string
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type ProvincesListModel struct {
|
||||
|
||||
190
server/internal/model/input/sysin/serve_license.go
Normal file
190
server/internal/model/input/sysin/serve_license.go
Normal file
@@ -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
|
||||
}
|
||||
@@ -8,35 +8,29 @@ 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"
|
||||
)
|
||||
|
||||
// SmsLogMaxSortInp 最大排序
|
||||
type SmsLogMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type SmsLogMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// SmsLogEditInp 修改/新增数据
|
||||
type SmsLogEditInp struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
type SmsLogEditModel struct{}
|
||||
|
||||
// SmsLogDeleteInp 删除
|
||||
type SmsLogDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#短信记录ID不能为空" dc:"短信记录ID"`
|
||||
}
|
||||
|
||||
type SmsLogDeleteModel struct{}
|
||||
|
||||
// SmsLogViewInp 获取信息
|
||||
type SmsLogViewInp struct {
|
||||
Id int64
|
||||
Id int64 `json:"id" v:"required#短信记录ID不能为空" dc:"短信记录ID"`
|
||||
}
|
||||
|
||||
type SmsLogViewModel struct {
|
||||
@@ -46,11 +40,11 @@ type SmsLogViewModel struct {
|
||||
// SmsLogListInp 获取列表
|
||||
type SmsLogListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
Mobile string
|
||||
Ip string
|
||||
Event string
|
||||
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) {
|
||||
@@ -71,6 +65,7 @@ type SmsLogListModel struct {
|
||||
type SmsLogStatusInp struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
type SmsLogStatusModel struct{}
|
||||
|
||||
// SendCodeInp 发送验证码
|
||||
|
||||
Reference in New Issue
Block a user