数据集

This commit is contained in:
XM-GO
2023-04-26 17:12:20 +08:00
parent 3da0dc3936
commit a01b7bb55d
18 changed files with 37 additions and 804 deletions

View File

@@ -2,28 +2,16 @@ package entity
import "github.com/XM-GO/PandaKit/model"
// VisualDataSetGroup 数据集分组
type VisualDataSetGroup struct {
model.BaseModelD
Id string `gorm:"primary_key;id;type:varchar(64);" json:"id"`
Name string `gorm:"name;type:varchar(64);comment:数据源类型" json:"name"`
Pid string `gorm:"pid;type:varchar(64);comment:父Id" json:"pid"`
Level int64 `gorm:"level;type:int;comment:等级" json:"level"`
}
func (VisualDataSetGroup) TableName() string {
return "visual_data_set_group"
}
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"`
TableType string `gorm:"tableType;type:varchar(64);comment:db,sql,excel,custom,api" json:"tableType"` //'db,sql,excel,custom',
Mode string `gorm:"mode;type:varchar(1);comment:原始表信息" json:"mode"` //'连接模式0-直连1-定时同步',
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
Fields []VisualDataSetField `gorm:"-" json:"fields"` //字段信息
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 {
@@ -32,14 +20,16 @@ func (VisualDataSetTable) TableName() string {
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"`
Type string `gorm:"type;type:varchar(50);comment:字段类型" json:"type"`
GoType string `gorm:"go_type;type:varchar(50);comment:go字段类型" json:"goType"` // Go类型
GoField string `gorm:"go_field;type:varchar(50);comment:go对应字段" json:"goField"` // Go字段名
JsonField string `gorm:"json_field;type:varchar(50);comment:json对应字段" json:"jsonField"`
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 {