sys_dictionaries.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package system
  2. import (
  3. "go_server/model/common"
  4. )
  5. type Dictionaries struct {
  6. common.GormFullModel
  7. Name string `json:"name" gorm:"column:name;type:varchar(50);comment:名称"`
  8. Key string `json:"key" gorm:"column:key;;unique;type:varchar(50);comment:关键词"`
  9. Enable bool `json:"enable" gorm:"column:enable;type:tinyint(1);comment:是否有效"`
  10. Desc string `json:"desc" gorm:"column:desc;type:varchar(255);comment:说明"`
  11. }
  12. func (*Dictionaries) TableName() string {
  13. return common.ModelPrefix + "dictionaries"
  14. }
  15. func NewDictionaries() *Dictionaries {
  16. return &Dictionaries{}
  17. }
  18. func (*Dictionaries) Comment() string {
  19. return "系统字典表"
  20. }
  21. type DictionaryDetail struct {
  22. common.GormFullModel
  23. DictionaryId int64 `json:"dictionaryId" gorm:"comment:字典ID"`
  24. Label string `json:"label" gorm:"type:varchar(50);comment:展示值"`
  25. Value string `json:"value" gorm:"type:varchar(50);comment:字典值"`
  26. Extend string `json:"extend" gorm:"type:varchar(100);comment:扩展值"`
  27. Enable bool `json:"enable" gorm:"column:enable;type:tinyint(1);comment:是否有效"`
  28. Sort int64 `json:"sort" gorm:"comment:排序"`
  29. }
  30. func (*DictionaryDetail) TableName() string {
  31. return common.ModelPrefix + "dictionary_detail"
  32. }
  33. func NewDictionaryDetail() *DictionaryDetail {
  34. return &DictionaryDetail{}
  35. }
  36. func (*DictionaryDetail) Comment() string {
  37. return "系统字典详情"
  38. }