mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-12 04:03:44 +08:00
修复树表上级关系绑定验证,优化CURD代码生成
This commit is contained in:
@@ -3,10 +3,11 @@
|
||||
// @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/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
@@ -16,8 +17,50 @@ type DictDataEditInp struct {
|
||||
entity.SysDictData
|
||||
TypeID int64
|
||||
}
|
||||
|
||||
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{}
|
||||
|
||||
Reference in New Issue
Block a user