62 lines
2.1 KiB
Go
62 lines
2.1 KiB
Go
package dto
|
||
|
||
type WebRspData struct {
|
||
Code int `json:"code"`
|
||
Msg string `json:"msg"`
|
||
DetailMsg string `json:"detail_msg"`
|
||
Data any `json:"data"`
|
||
}
|
||
|
||
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"`
|
||
Readonly bool `json:"readonly"` // 是否只读,就只展示在表格中
|
||
Required bool `json:"required"` // 是否必填,不能为空
|
||
Choices []*CommonDtoFieldChoice `json:"choices"` // 可选项,用于字段做下拉框
|
||
MultiChoice bool `json:"multi_choice"` // 是否多选
|
||
Uneditable bool `json:"uneditable"` // 不可编辑,某些数据一旦新增之后不能修改,例如封禁的值、服务器的id等
|
||
Where string `json:"where"` // sql list的where条件,用于表格页面查询条件编写,值:eq gt lt ge lt range like
|
||
}
|
||
|
||
//type CommonDtoValue struct {
|
||
// FieldName string `json:"field_name"`
|
||
// Value any `json:"value"`
|
||
//}
|
||
|
||
type CommonDtoValues map[string]any
|
||
|
||
type CommonDtoList struct {
|
||
FieldsDesc []*CommonDtoFieldDesc `json:"fields_desc"` // 数据字段描述信息
|
||
Rows []CommonDtoValues `json:"rows"` // 数据行
|
||
}
|
||
|
||
type PathInfo struct {
|
||
Path string `json:"path"`
|
||
Method string `json:"method"`
|
||
}
|
||
|
||
type GetWhereCondition struct {
|
||
Key string `json:"key"`
|
||
Op string `json:"op"` // eq,gt,lt,range
|
||
Value1 any `json:"value1"`
|
||
Value2 any `json:"value2"`
|
||
}
|
||
|
||
type ItemInfo struct {
|
||
ItemID int `json:"item_id"`
|
||
ItemNum int64 `json:"item_num"`
|
||
ItemType int `json:"item_type"`
|
||
Desc string `json:"desc"`
|
||
}
|