Discover Packages
github.com/hopeio/utils
types
model
package
Version:
v0.7.0
Opens a new window with list of versions in this module.
Published: Feb 12, 2025
License: MIT, Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
先有属性
属性类型可以是基本类型
属性类型可以有枚举,value就是枚举id
属性类型可以是键值对,value就是[dict.group]
属性类型可以有子属性,value就是[attrId] // 暂时不支持
Expand ▾
Collapse ▴
Documentation
¶
type Attribute struct {
ID uint `json:"id" gorm:"primaryKey"`
Name string `json:"name" gorm:"comment:名称"`
Type uint32 `json:"type" gorm:"comment:类型"`
Value string `json:"value" gorm:"值"`
}
type Dict struct {
Group uint32 `json:"group" gorm:"primaryKey;comment:组"`
Key string `json:"key" gorm:"primaryKey;comment:键"`
Value string `json:"value" gorm:"comment:值"`
Type uint32 `json:"type" gorm:"comment:类型"`
Seq uint32 `json:"seq" gorm:"comment:排序"`
}
type Enum struct {
ID uint `json:"id" gorm:"primaryKey"`
Group uint32 `json:"group" gorm:"uniqueIndex:idx_group_name;not null;default:0;comment:枚举组"`
Name string `json:"name" gorm:"uniqueIndex:idx_group_name;not null;comment:名称"`
Type uint32 `json:"type" gorm:"comment:类型"`
}
type EnumValue struct {
ID uint `json:"id" gorm:"primaryKey"`
EnumID uint `json:"enumId" gorm:"index;not null;comment:枚举id"`
Index uint32 `json:"index" gorm:"comment:索引"`
Value string `json:"value" gorm:"not null;comment:值"`
}
type Model struct {
ID uint `json:"id" gorm:"primarykey"`
CreatedAt time .Time `json:"createdAt"`
UpdatedAt time .Time `json:"updatedAt"`
DeletedAt time .Time `json:"deletedAt,omitempty" gorm:"index"`
}
type ModelExt struct {
OperatorId uint `json:"operatorId"`
}
type Object struct {
ID uint `json:"id" gorm:"primaryKey"`
FieldID uint `json:"fieldId" gorm:"comment:字段id"`
Value string `json:"value" gorm:"comment:值"`
}
type Struct struct {
ID uint `json:"id" gorm:"primaryKey"`
Name string `json:"name" gorm:"comment:名称"`
}
内部保留,{1,int8},{2,int16}...{x,uint8}...{x,uint64},{x,string}
type StructField struct {
ID uint `json:"id" gorm:"primaryKey"`
StructID uint `json:"structId" gorm:"comment:结构体id"`
Name string `json:"name" gorm:"comment:名称"`
Kind uint32 `json:"kind" gorm:"comment:类型"`
Tag string `json:"tag" gorm:"comment:标签"`
Offset uint32 `json:"offset" gorm:"comment:偏移量"`
Anonymous bool `json:"anonymous" gorm:"comment:匿名"`
SubStructID uint `json:"subStructId" gorm:"comment:子结构体id"`
}
type TableColumn struct {
ID uint `json:"id" gorm:"primaryKey"`
Name string `json:"name" gorm:"comment:名称"`
Type string `json:"type" gorm:"comment:类型"`
TableID uint `json:"tableId" gorm:"comment:表id"`
}
type TableMeta struct {
ID uint `json:"id" gorm:"primaryKey"`
Name string `json:"name" gorm:"comment:名称"`
}
type TableValue struct {
ID uint `json:"id" gorm:"primaryKey"`
ColumnID uint `json:"columnId" gorm:"comment:字段id"`
Value string `json:"value" gorm:"comment:值"`
}
type Tree struct {
ID uint `json:"id"`
Name string `json:"name"`
Type uint32 `json:"type"`
}
type TreeNode struct {
ID uint `json:"id"`
PID uint `json:"ptId"`
Value string `json:"value"`
TreeID uint `json:"treeId"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.