dev_program.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package dao
  2. import "server/global"
  3. type Program struct {
  4. global.GVA_MODEL
  5. Num1 string `json:"num1" gorm:"comment:显示内容编号1"`
  6. Effect1 string `json:"effect1" gorm:"comment:显示方式1"`
  7. Speed1 string `json:"speed1" gorm:"comment:移动速度1"`
  8. Stay1 string `json:"stay1" gorm:"comment:节目停留时间1"`
  9. Total1 string `json:"total1" gorm:"comment:预留1"`
  10. Color1 string `json:"color1" gorm:"comment:颜色1"`
  11. Content1 string `json:"content1" gorm:"comment:节目内容1"`
  12. Num2 string `json:"num2" gorm:"comment:显示内容编号2"`
  13. Effect2 string `json:"effect2" gorm:"comment:显示方式2"`
  14. Speed2 string `json:"speed2" gorm:"comment:移动速度2"`
  15. Stay2 string `json:"stay2" gorm:"comment:节目停留时间2"`
  16. Total2 string `json:"total2" gorm:"comment:预留2"`
  17. Color2 string `json:"color2" gorm:"comment:颜色2"`
  18. Content2 string `json:"content2" gorm:"comment:节目内容2"`
  19. Num3 string `json:"num3" gorm:"comment:显示内容编号3"`
  20. Effect3 string `json:"effect3" gorm:"comment:显示方式3"`
  21. Speed3 string `json:"speed3" gorm:"comment:移动速度3"`
  22. Stay3 string `json:"stay3" gorm:"comment:节目停留时间3"`
  23. Total3 string `json:"total3" gorm:"comment:预留3"`
  24. Color3 string `json:"color3" gorm:"comment:颜色3"`
  25. Content3 string `json:"content3" gorm:"comment:节目内容3"`
  26. Num4 string `json:"num4" gorm:"comment:显示内容编号4"`
  27. Effect4 string `json:"effect4" gorm:"comment:显示方式4"`
  28. Speed4 string `json:"speed4" gorm:"comment:移动速度4"`
  29. Stay4 string `json:"stay4" gorm:"comment:节目停留时间4"`
  30. Total4 string `json:"total4" gorm:"comment:预留4"`
  31. Color4 string `json:"color4" gorm:"comment:颜色4"`
  32. Content4 string `json:"content4" gorm:"comment:节目内容4"`
  33. Num5 string `json:"num5" gorm:"comment:显示内容编号5"`
  34. Effect5 string `json:"effect5" gorm:"comment:显示方式5"`
  35. Speed5 string `json:"speed5" gorm:"comment:移动速度5"`
  36. Stay5 string `json:"stay5" gorm:"comment:节目停留时间5"`
  37. Total5 string `json:"total5" gorm:"comment:预留5"`
  38. Color5 string `json:"color5" gorm:"comment:颜色5"`
  39. Content5 string `json:"content5" gorm:"comment:节目内容5"`
  40. }
  41. func (Program) TableName() string {
  42. return "dev_program"
  43. }
  44. func (p Program) CreateProgram() error {
  45. return global.GVA_DB.Create(&p).Error
  46. }
  47. func (p Program) UpdateProgram() error {
  48. return global.GVA_DB.Model(&Program{}).Where("id = ?", p.ID).Updates(&p).Error
  49. }