plan.go 1.2 KB

1234567891011121314151617181920212223242526272829
  1. package model
  2. type Plan struct {
  3. Id string `json:"id" gorm:"type:varchar(128);not null"`
  4. Title string `json:"title" gorm:"type:varchar(30);not null"`
  5. Version string `json:"version" gorm:"type:varchar(20);not null"`
  6. State int `json:"state" gorm:"type:int; not null"`
  7. Description string `json:"description" gorm:"type:longtext;not null"`
  8. StatementFile string `json:"statementFile" gorm:"column:statement_file;type:longtext;not null"`
  9. Delete int `json:"delete" gorm:"type:tinyint(1);not null"`
  10. CreatorId string `json:"creatorId" gorm:"column:creator_id;type:varchar(128);not null"`
  11. SoftwareId string `json:"softwareId" gorm:"column:software_id;type:varchar(128);not null"`
  12. CreatedAt Time `json:"created_at" gorm:"column:create_time;type:datetime default CURRENT_TIMESTAMP"`
  13. UpdatedAt Time `json:"updated_at" gorm:"column:update_time;type:datetime default CURRENT_TIMESTAMP"`
  14. }
  15. func (Plan) TableName() string {
  16. return "plan"
  17. }
  18. type Plan2Group struct {
  19. ID uint `gorm:"primary_key;type:int(11) auto_increment"`
  20. PlanId string `gorm:"column:plan_id"`
  21. GroupId string `gorm:"column:group_id"`
  22. }
  23. func (Plan2Group) TableName() string {
  24. return "plan_groups"
  25. }