|
|
|
@@ -16,18 +16,33 @@ type App struct { |
|
|
|
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:null;onUpdate:CURRENT_TIMESTAMP" json:"updatedAt"` // 更新时间 |
|
|
|
DeletedAt time.Time `gorm:"column:deleted_at;type:timestamp;default:null" json:"-"` // 删除时间 |
|
|
|
} |
|
|
|
|
|
|
|
func (App) TableName() string { |
|
|
|
return "apps" |
|
|
|
} |
|
|
|
|
|
|
|
type AppInstanceDao struct { |
|
|
|
ID int64 `gorm:"primaryKey;autoIncrement;column:id" json:"id"` // 实例ID |
|
|
|
Name string `gorm:"column:name;type:varchar(200);not null" json:"name"` // 实例名称 |
|
|
|
Description string `gorm:"column:description;type:varchar(500);default:null" json:"description"` // 实例描述 |
|
|
|
Content string `gorm:"column:content;type:text;default:null" json:"content"` // 实例内容 |
|
|
|
AppID int64 `gorm:"column:app_id;type:bigint;not null" json:"appID"` // 关联应用ID |
|
|
|
AppName string `gorm:"-" json:"appName"` // 应用名称 |
|
|
|
AppName string `json:"appName"` // 应用名称 |
|
|
|
UserID cdssdk.UserID `gorm:"column:user_id;type:bigint;default:null" json:"userID"` // 创建者 |
|
|
|
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` // 创建时间 |
|
|
|
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:null;onUpdate:CURRENT_TIMESTAMP" json:"updatedAt"` // 更新时间 |
|
|
|
DeletedAt time.Time `gorm:"column:deleted_at;type:timestamp;default:null" json:"-"` // 删除时间 |
|
|
|
|
|
|
|
//回显 |
|
|
|
AppRunRecords []AppRunRecordDao `gorm:"foreignKey:AppInstanceID;references:ID" json:"appRunRecords"` //运行记录 |
|
|
|
Status string `json:"status"` //应用状态 |
|
|
|
Role string `json:"role"` //应用角色 |
|
|
|
} |
|
|
|
|
|
|
|
func (AppInstanceDao) TableName() string { |
|
|
|
return "app_instances" |
|
|
|
} |
|
|
|
|
|
|
|
type AppInstance struct { |
|
|
|
ID int64 `json:"id"` // 实例ID |
|
|
|
Name string `json:"name"` // 实例名称 |
|
|
|
@@ -40,8 +55,10 @@ type AppInstance struct { |
|
|
|
UpdatedAt time.Time `json:"updatedAt"` // 更新时间 |
|
|
|
DeletedAt time.Time `json:"-"` // 删除时间 |
|
|
|
|
|
|
|
//回显应用状态 |
|
|
|
Status string `json:"status"` //应用状态 |
|
|
|
//回显 |
|
|
|
AppRunRecords []AppRunRecordDao `gorm:"foreignKey:AppInstanceID;references:ID" json:"appRunRecords"` //运行记录 |
|
|
|
Status string `json:"status"` //应用状态 |
|
|
|
Role string `gorm:"-" json:"role"` //应用角色 |
|
|
|
} |
|
|
|
|
|
|
|
type AppRunRecordDao struct { |
|
|
|
@@ -50,12 +67,18 @@ type AppRunRecordDao struct { |
|
|
|
Content string `gorm:"column:content;type:text;default:null" json:"content"` // 运行内容 |
|
|
|
Status string `gorm:"column:status;type:varchar(100);not null" json:"status"` // 运行状态 |
|
|
|
RunLog string `gorm:"column:run_log;type:text;default:null" json:"runLog"` // 运行日志 |
|
|
|
RunID JobSetID ` gorm:"column:run_id;type:varchar(100);default:null" json:"runID"` // 运行ID |
|
|
|
RunID JobSetID `gorm:"column:run_id;type:varchar(100);default:null" json:"runID"` // 运行ID |
|
|
|
RunOutput string `gorm:"column:run_output;type:text;default:null" json:"runOutput"` // 运行输出 |
|
|
|
UserID cdssdk.UserID `gorm:"column:user_id;type:bigint;default:null" json:"userID"` // 创建者 |
|
|
|
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` // 创建时间 |
|
|
|
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:null;onUpdate:CURRENT_TIMESTAMP" json:"updatedAt"` // 更新时间 |
|
|
|
DeletedAt time.Time `gorm:"column:deleted_at;type:timestamp;default:null" json:"-"` // 删除时间 |
|
|
|
|
|
|
|
AppRecordParams []AppRecordParam `gorm:"foreignKey:RecordID;references:ID" json:"appRecordParams"` // 运行记录参数 |
|
|
|
} |
|
|
|
|
|
|
|
func (AppRunRecordDao) TableName() string { |
|
|
|
return "app_run_records" |
|
|
|
} |
|
|
|
|
|
|
|
type AppRunRecord struct { |
|
|
|
@@ -64,10 +87,24 @@ type AppRunRecord struct { |
|
|
|
Content AppInfo `gorm:"column:content;type:text;default:null" json:"content"` // 运行内容 |
|
|
|
Status string `gorm:"column:status;type:varchar(100);not null" json:"status"` // 运行状态 |
|
|
|
RunLog string `gorm:"column:run_log;type:text;default:null" json:"runLog"` // 运行日志 |
|
|
|
RunID JobSetID ` gorm:"column:run_id;type:varchar(100);default:null" json:"runID"` // 运行ID |
|
|
|
RunID JobSetID `gorm:"column:run_id;type:varchar(100);default:null" json:"runID"` // 运行ID |
|
|
|
RunOutput string `gorm:"column:run_output;type:text;default:null" json:"runOutput"` // 运行输出 |
|
|
|
UserID cdssdk.UserID `gorm:"column:user_id;type:bigint;default:null" json:"userID"` // 创建者 |
|
|
|
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` // 创建时间 |
|
|
|
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:null;onUpdate:CURRENT_TIMESTAMP" json:"updatedAt"` // 更新时间 |
|
|
|
DeletedAt time.Time `gorm:"column:deleted_at;type:timestamp;default:null" json:"-"` // 删除时间 |
|
|
|
|
|
|
|
AppRecordParams []AppRecordParam `gorm:"foreignKey:RecordID;references:ID" json:"appRecordParams"` // 运行记录参数 |
|
|
|
} |
|
|
|
|
|
|
|
type AppRecordParam struct { |
|
|
|
RecordID int64 `gorm:"column:record_id;type:bigint;not null" json:"recordID"` // 应用运行记录ID |
|
|
|
InstanceID AppInstanceID `gorm:"column:instance_id;type:bigint;not null" json:"instanceID"` // 应用实例ID |
|
|
|
RunID JobSetID `gorm:"column:run_id;type:varchar(100);not null" json:"runID"` // 运行ID |
|
|
|
ParamKey string `gorm:"column:param_key;type:varchar(1000);default:null" json:"paramKey"` // 参数键 |
|
|
|
ParamValue string `gorm:"column:param_value;type:varchar(1000);default:null" json:"paramValue"` // 参数值 |
|
|
|
} |
|
|
|
|
|
|
|
func (AppRecordParam) TableName() string { |
|
|
|
return "app_record_params" |
|
|
|
} |