Files
PandaX/apps/visual/entity/data_set.go
2023-04-26 17:12:20 +08:00

38 lines
2.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package entity
import "github.com/XM-GO/PandaKit/model"
type VisualDataSetTable struct {
model.BaseModelD
TableId string `gorm:"primary_key;tableId;comment:表id" json:"tableId"`
DataSourceId string `gorm:"dataSourceId;type:varchar(64);comment:数据源ID" json:"dataSourceId"`
Name string `gorm:"name;type:varchar(64);comment:名称" json:"name"`
TableType string `gorm:"tableType;type:varchar(64);comment:db,sql,excel,union" json:"tableType"`
Info string `gorm:"info;type:TEXT;comment:原始表信息" json:"info"`
CreateBy int64 `gorm:"create_by" json:"createBy"` //创建人ID
DataSource VisualDataSource `gorm:"foreignKey:DataSourceId;references:SourceId" json:"dataSource"`
Fields []VisualDataSetField `gorm:"foreignKey:TableId" json:"fields"` //字段信息
}
func (VisualDataSetTable) TableName() string {
return "visual_data_set_table"
}
type VisualDataSetField struct {
model.BaseModelD
FieldId string `gorm:"primary_key;fieldId;comment:表id" json:"fieldId"`
TableId string `gorm:"tableId;type:varchar(64);comment:表id" json:"tableId"`
Comment string `gorm:"comment;type:varchar(64);comment:字段描述" json:"columnComment"` // 列描述
Name string `gorm:"name;type:varchar(64);comment:字段名" json:"name"`
GroupType string `gorm:"group_type;type:varchar(1);comment:字段分组类型" json:"group_type"` //d 维度 g
OriginName string `gorm:"origin_name;type:varchar(50);comment:原始字段名" json:"origin_name"`
OriginType string `gorm:"origin_type;type:varchar(50);comment:原始字段类型" json:"origin_type"`
DeType int `gorm:"de_type;type:varchar(50);comment:数据源字段类型0-文本1-时间2-数值(包括小数)" json:"deType"`
DeName string `gorm:"de_name;type:varchar(50);comment:数据源查询名" json:"deName"`
ExtField int `gorm:"ext_field;type:int;comment:是否扩展字段 0否 1是" json:"extField"`
}
func (VisualDataSetField) TableName() string {
return "visual_data_set_field"
}