36 lines
1.3 KiB
Go
36 lines
1.3 KiB
Go
|
package dto
|
|||
|
|
|||
|
type CommonDtoFieldChoice struct {
|
|||
|
Desc string `json:"desc"`
|
|||
|
Value any `json:"value"`
|
|||
|
// 描述选项的类型,例如添加物品时,可以添加道具、翅膀、宠物等,他们可能不一定都设计为道具
|
|||
|
Type int `json:"type"`
|
|||
|
}
|
|||
|
|
|||
|
type CommonDtoFieldDesc struct {
|
|||
|
Name string `json:"name"`
|
|||
|
Key string `json:"key"`
|
|||
|
// 字段类型,基础类型支持int float string bool []<基础类行>,
|
|||
|
// 支持自定义类型和自定义类型的数组
|
|||
|
Type string `json:"type"`
|
|||
|
HelpText string `json:"help_text"`
|
|||
|
Editable bool `json:"editable"` // 是否可编辑,例如id就不可编辑,新增时也不需要填写
|
|||
|
Require bool `json:"require"` // 是否必填,不能为空
|
|||
|
Choices []*CommonDtoFieldChoice `json:"choices"` // 可选项,用于字段做下拉框
|
|||
|
MultiChoice bool `json:"multi_choice"` // 是否多选
|
|||
|
}
|
|||
|
|
|||
|
type CommonDtoValue struct {
|
|||
|
FieldName string `json:"field_name"`
|
|||
|
Value any `json:"value"`
|
|||
|
}
|
|||
|
|
|||
|
type CommonDtoValues struct {
|
|||
|
Values []*CommonDtoValue `json:"values"`
|
|||
|
}
|
|||
|
|
|||
|
type CommonDtoList struct {
|
|||
|
FieldsDesc []*CommonDtoFieldDesc `json:"fields_desc"` // 数据字段描述信息
|
|||
|
Rows []*CommonDtoValues `json:"rows"` // 数据行
|
|||
|
}
|