products.go 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package models
  2. import (
  3. "gorm.io/gorm"
  4. "html/template"
  5. )
  6. // Products Server Products 产品
  7. type Products struct {
  8. gorm.Model
  9. Title string `json:"title"` //标题
  10. Synopsis template.HTML `json:"synopsis"` //简介
  11. Detail template.HTML `json:"detail"` //详情
  12. Type string `json:"type"` //类型 1.产品 2.服务
  13. Ptype string `json:"ptype"` //产品类型 软件 硬件
  14. IsIndex bool `json:"isIndex"` //是否首页显示
  15. Url string `json:"url"` //图片链接
  16. ProductIntroduction template.HTML `json:"product_introduction"` //产品介绍
  17. TechnicalParameters template.HTML `json:"technical_parameters"` //技术参数
  18. Instructions template.HTML `json:"instructions"` //使用说明
  19. SupportingSoftware string `json:"supporting_software" ` //配套软件
  20. OptionalAccessories string `json:"optional_accessories" gorm:"comment:'可选配件'"` //可选配件
  21. IsActive bool `json:"is_active" gorm:"comment:'是否激活'"` //是否激活
  22. ParentId int `gorm:"comment:'父级id'" json:"parentId"`
  23. }
  24. type ProductDto struct {
  25. ID uint `json:"id"`
  26. Title string `json:"title"` //标题
  27. Synopsis template.HTML `json:"synopsis"` //简介
  28. Detail template.HTML `json:"detail"` //详情
  29. Type string `json:"type"` //类型 1.产品 2.服务
  30. Ptype string `json:"ptype"` //产品类型 软件 硬件
  31. IsIndex bool `json:"isIndex"` //是否首页显示
  32. Url string `json:"url"` //图片链接
  33. ProductIntroduction template.HTML `json:"product_introduction"` //产品介绍
  34. TechnicalParameters template.HTML `json:"technical_parameters"` //技术参数
  35. Instructions template.HTML `json:"instructions"` //使用说明
  36. SupportingSoftware string `json:"supporting_software" ` //配套软件
  37. OptionalAccessories string `json:"optional_accessories" gorm:"comment:'可选配件'"` //可选配件
  38. IsActive bool `json:"is_active"`
  39. }