label.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package model
  2. //Label label
  3. type Label struct {
  4. ID int64 `json:"id" form:"id" gorm:"AUTO_INCREMENT;primary_key;"`
  5. Name string `json:"label_name"`
  6. Description string `json:"description"`
  7. Color string `json:"color"`
  8. Active int `json:"active"`
  9. }
  10. //LabelName db table name for label
  11. func (l Label) LabelName() string {
  12. return "label"
  13. }
  14. //LabelRelation label relation
  15. type LabelRelation struct {
  16. ID int64 `json:"id" form:"id" gorm:"AUTO_INCREMENT;primary_key;"`
  17. LabelID int64 `json:"label_id" form:"label_id"`
  18. LabelName string `json:"label_name" form:"label_name"`
  19. Color string `json:"color" form:"color"`
  20. Description string `json:"description" form:"description"`
  21. TargetID int64 `json:"target_id" form:"target_id"`
  22. Type int `json:"type"`
  23. Active int `json:"active"`
  24. }
  25. // LabelRelation type const
  26. const (
  27. DefaultType = iota
  28. ScriptType
  29. ReportType
  30. )
  31. //LabelRelationName db table name of label relation
  32. func (l LabelRelation) LabelRelationName() string {
  33. return "label_relation"
  34. }