plan.go 1.4 KB

12345678910111213141516171819202122232425262728293031
  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. Type string `json:"type" gorm:"type:varchar(20);not null"`
  13. CreatedAt Time `json:"created_at" gorm:"column:create_time;type:datetime default CURRENT_TIMESTAMP"`
  14. UpdatedAt Time `json:"updated_at" gorm:"column:update_time;type:datetime default CURRENT_TIMESTAMP"`
  15. CompanyId int `json:"company_id" gorm:"column:company_id;type:bigint(20)"`
  16. }
  17. func (Plan) TableName() string {
  18. return "plan"
  19. }
  20. type Plan2Group struct {
  21. ID uint `gorm:"primary_key;type:int(11) auto_increment"`
  22. PlanId string `gorm:"column:plan_id"`
  23. GroupId string `gorm:"column:group_id"`
  24. }
  25. func (Plan2Group) TableName() string {
  26. return "plan_groups"
  27. }