From b8f6fc48edafa9e05a1bf42590f4c3aaeb0cbfef Mon Sep 17 00:00:00 2001 From: XM-GO <93296511+XM-GO@users.noreply.github.com> Date: Tue, 4 Apr 2023 17:46:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/bi/entity/data_set.go | 22 +++++++++++++++++++++ apps/bi/entity/data_source.go | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 apps/bi/entity/data_set.go create mode 100644 apps/bi/entity/data_source.go diff --git a/apps/bi/entity/data_set.go b/apps/bi/entity/data_set.go new file mode 100644 index 0000000..de5e2e5 --- /dev/null +++ b/apps/bi/entity/data_set.go @@ -0,0 +1,22 @@ +package entity + +import "github.com/XM-GO/PandaKit/model" + +type DataSetGroup struct { + model.BaseModelD + Name string `gorm:"name;type:varchar(64);comment:数据源类型" json:"name"` + Pid string `json:"pid"` + Level int64 `json:"level"` +} + +/*type DataSetTable struct { + model.BaseModelD + TableId string `gorm:"name;type:TEXT;comment:表id" json:"tableId"` + DataSourceId string `gorm:"name;type:TEXT;comment:数据圆ID" json:"data_source_Id"` + TableType string `gorm:"name;type:TEXT;comment:db,sql,excel,custom,api" json:"tableType"` //'db,sql,excel,custom', + Mode string `gorm:"name;type:TEXT;comment:原始表信息" json:"mode"` //'连接模式:0-直连,1-定时同步', + Info string `gorm:"name;type:TEXT;comment:原始表信息" json:"name"` + CreateBy int64 `gorm:"create_by" json:"createBy"` //创建人ID + Columns []DevGenTableColumn `gorm:"-" json:"columns"` //字段信息 +} +*/ diff --git a/apps/bi/entity/data_source.go b/apps/bi/entity/data_source.go new file mode 100644 index 0000000..12a2f2a --- /dev/null +++ b/apps/bi/entity/data_source.go @@ -0,0 +1,36 @@ +package entity + +import "github.com/XM-GO/PandaKit/model" + +type DataSource struct { + model.BaseModel + SourceId string `gorm:"source_id;comment:数据源Id" json:"sourceId"` // 数据源Id + SourceType string `gorm:"source_type;type:varchar(50);comment:数据源类型" json:"sourceType"` // 数据源类型 + SourceName string `gorm:"source_name;type:varchar(50);comment:数据源名称" json:"sourceName"` // 原名称 + SourceComment string `gorm:"source_comment;type:varchar(50);comment:数据源描述" json:"source_comment"` // 描述 + Status string `gorm:"status;type:varchar(1);comment:数据源状态" json:"status"` + Configuration string `gorm:"configuration;type:text;comment:详细信息" json:"configuration"` + CreateBy int64 `gorm:"api" json:"createBy"` //创建人ID + +} + +type Db struct { + DbIp string `gorm:"db_ip" json:"dbIp"` + DbPort string `gorm:"db_port" json:"dbPort"` + DbName string `gorm:"db_name" json:"dbName"` + DbUsername string `gorm:"db_username" json:"dbUsername"` + DbPassword string `gorm:"db_password" json:"dbPassword"` + DbJointParam string `gorm:"db_joint_param" json:"dbJointParam"` //额外的链接参数 +} + +type Api struct { + Method string `gorm:"method" json:"method"` + url string `gorm:"url" json:"url"` + Headers map[string]interface{} `gorm:"headers" json:"headers"` + RequestBody string `gorm:"db_username" json:"dbUsername"` + Auth string `gorm:"db_password" json:"dbPassword"` +} + +func (DataSource) TableName() string { + return "bi_data_source" +}