You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.go 6.8 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package schsdk
  2. import (
  3. cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
  4. "time"
  5. )
  6. type App struct {
  7. ID int64 `gorm:"primaryKey;autoIncrement;column:id" json:"id,string"`
  8. Name string `gorm:"column:name;type:varchar(200);not null" json:"name"` // 应用名称
  9. Description string `gorm:"column:description;type:varchar(500);default:null" json:"description"` // 应用描述
  10. Version string `gorm:"column:version;type:varchar(100);not null" json:"version"` // 应用版本
  11. Status string `gorm:"column:status;type:tinyint(1);default:1;not null" json:"status"` // 应用状态 (0:禁用, 1:正常)
  12. UserID cdssdk.UserID `gorm:"column:user_id;type:bigint;default:null" json:"userID"` // 创建者
  13. CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` // 创建时间
  14. UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:null;onUpdate:CURRENT_TIMESTAMP" json:"updatedAt"` // 更新时间
  15. DeletedAt time.Time `gorm:"column:deleted_at;type:timestamp;default:null" json:"-"` // 删除时间
  16. }
  17. type AppInstanceDao struct {
  18. ID int64 `gorm:"primaryKey;autoIncrement;column:id" json:"id"` // 实例ID
  19. Name string `gorm:"column:name;type:varchar(200);not null" json:"name"` // 实例名称
  20. Description string `gorm:"column:description;type:varchar(500);default:null" json:"description"` // 实例描述
  21. Content string `gorm:"column:content;type:text;default:null" json:"content"` // 实例内容
  22. AppID int64 `gorm:"column:app_id;type:bigint;not null" json:"appID"` // 关联应用ID
  23. AppName string `gorm:"-" json:"appName"` // 应用名称
  24. UserID cdssdk.UserID `gorm:"column:user_id;type:bigint;default:null" json:"userID"` // 创建者
  25. CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` // 创建时间
  26. UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:null;onUpdate:CURRENT_TIMESTAMP" json:"updatedAt"` // 更新时间
  27. DeletedAt time.Time `gorm:"column:deleted_at;type:timestamp;default:null" json:"-"` // 删除时间
  28. }
  29. type AppInstance struct {
  30. ID int64 `json:"id"` // 实例ID
  31. Name string `json:"name"` // 实例名称
  32. Description string `json:"description"` // 实例描述
  33. Content AppInfo `json:"content"` // 实例内容
  34. AppID int64 `json:"appID,string"` // 关联应用ID
  35. AppName string `json:"appName"` // 应用名称
  36. UserID cdssdk.UserID `json:"userID"` // 创建者
  37. CreatedAt time.Time `json:"createdAt"` // 创建时间
  38. UpdatedAt time.Time `json:"updatedAt"` // 更新时间
  39. DeletedAt time.Time `json:"-"` // 删除时间
  40. //回显应用状态
  41. Status string `json:"status"` //应用状态
  42. }
  43. type AppRunRecordDao struct {
  44. ID int64 `gorm:"primaryKey;autoIncrement;column:id" json:"id"` // 运行记录ID
  45. AppInstanceID AppInstanceID `gorm:"column:app_instance_id;type:bigint;not null" json:"appInstanceID"` // 关联应用实例ID
  46. Content string `gorm:"column:content;type:text;default:null" json:"content"` // 运行内容
  47. Status string `gorm:"column:status;type:varchar(100);not null" json:"status"` // 运行状态
  48. RunLog string `gorm:"column:run_log;type:text;default:null" json:"runLog"` // 运行日志
  49. RunID JobSetID ` gorm:"column:run_id;type:varchar(100);default:null" json:"runID"` // 运行ID
  50. RunOutput string `gorm:"column:run_output;type:text;default:null" json:"runOutput"` // 运行输出
  51. UserID cdssdk.UserID `gorm:"column:user_id;type:bigint;default:null" json:"userID"` // 创建者
  52. CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` // 创建时间
  53. UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:null;onUpdate:CURRENT_TIMESTAMP" json:"updatedAt"` // 更新时间
  54. DeletedAt time.Time `gorm:"column:deleted_at;type:timestamp;default:null" json:"-"` // 删除时间
  55. }
  56. type AppRunRecord struct {
  57. ID int64 `gorm:"primaryKey;autoIncrement;column:id" json:"id"` // 运行记录ID
  58. AppInstanceID AppInstanceID `gorm:"column:app_instance_id;type:bigint;not null" json:"appInstanceID"` // 关联应用实例ID
  59. Content AppInfo `gorm:"column:content;type:text;default:null" json:"content"` // 运行内容
  60. Status string `gorm:"column:status;type:varchar(100);not null" json:"status"` // 运行状态
  61. RunLog string `gorm:"column:run_log;type:text;default:null" json:"runLog"` // 运行日志
  62. RunID JobSetID ` gorm:"column:run_id;type:varchar(100);default:null" json:"runID"` // 运行ID
  63. RunOutput string `gorm:"column:run_output;type:text;default:null" json:"runOutput"` // 运行输出
  64. UserID cdssdk.UserID `gorm:"column:user_id;type:bigint;default:null" json:"userID"` // 创建者
  65. CreatedAt time.Time `gorm:"column:created_at;type:timestamp;default:CURRENT_TIMESTAMP" json:"createdAt"` // 创建时间
  66. UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;default:null;onUpdate:CURRENT_TIMESTAMP" json:"updatedAt"` // 更新时间
  67. DeletedAt time.Time `gorm:"column:deleted_at;type:timestamp;default:null" json:"-"` // 删除时间
  68. }