2022-11-24 23:37:34 +08:00
|
|
|
|
// Package sysin
|
|
|
|
|
// @Link https://github.com/bufanyun/hotgo
|
2023-02-23 17:53:04 +08:00
|
|
|
|
// @Copyright Copyright (c) 2023 HotGo CLI
|
2022-11-24 23:37:34 +08:00
|
|
|
|
// @Author Ms <133814250@qq.com>
|
|
|
|
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
|
|
|
package sysin
|
|
|
|
|
|
|
|
|
|
import (
|
2023-05-29 20:24:13 +08:00
|
|
|
|
"context"
|
|
|
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
2024-03-07 20:08:56 +08:00
|
|
|
|
"hotgo/internal/model"
|
2022-11-24 23:37:34 +08:00
|
|
|
|
"hotgo/internal/model/entity"
|
|
|
|
|
"hotgo/internal/model/input/form"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// DictDataEditInp 修改/新增字典数据
|
|
|
|
|
type DictDataEditInp struct {
|
|
|
|
|
entity.SysDictData
|
2023-07-20 18:01:10 +08:00
|
|
|
|
TypeID int64 `json:"typeID" dc:"字典类型ID"`
|
2022-11-24 23:37:34 +08:00
|
|
|
|
}
|
2023-05-29 20:24:13 +08:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-24 23:37:34 +08:00
|
|
|
|
type DictDataEditModel struct{}
|
|
|
|
|
|
2023-05-29 20:24:13 +08:00
|
|
|
|
// 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:"状态"`
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-24 23:37:34 +08:00
|
|
|
|
// DictDataDeleteInp 删除字典数据
|
|
|
|
|
type DictDataDeleteInp struct {
|
2023-07-20 18:01:10 +08:00
|
|
|
|
Id interface{} `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"`
|
2022-11-24 23:37:34 +08:00
|
|
|
|
}
|
2023-07-20 18:01:10 +08:00
|
|
|
|
|
2022-11-24 23:37:34 +08:00
|
|
|
|
type DictDataDeleteModel struct{}
|
|
|
|
|
|
|
|
|
|
// DictDataListInp 获取列表
|
|
|
|
|
type DictDataListInp struct {
|
|
|
|
|
form.PageReq
|
|
|
|
|
form.StatusReq
|
2023-07-20 18:01:10 +08:00
|
|
|
|
TypeID int64 `json:"typeId" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
|
2024-04-22 23:08:40 +08:00
|
|
|
|
Type string `json:"type" dc:"字典类型"`
|
|
|
|
|
Label string `json:"label" dc:"字典标签"`
|
|
|
|
|
Value string `json:"value" dc:"字典键值"`
|
2022-11-24 23:37:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DictDataListModel struct {
|
2023-01-18 16:23:39 +08:00
|
|
|
|
TypeID int64 `json:"typeId"`
|
|
|
|
|
Key string `json:"key"`
|
2022-11-24 23:37:34 +08:00
|
|
|
|
entity.SysDictData
|
|
|
|
|
}
|
2023-01-18 16:23:39 +08:00
|
|
|
|
|
|
|
|
|
// DataSelectInp 获取指定字典选项
|
|
|
|
|
type DataSelectInp struct {
|
2023-07-20 18:01:10 +08:00
|
|
|
|
Type string `in:"path" v:"required#字典类型不能为空" dc:"字典类型"`
|
2023-01-18 16:23:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-03-07 20:08:56 +08:00
|
|
|
|
type DataSelectModel []*model.Option
|