serve.go 785 B

12345678910111213141516171819202122
  1. package models
  2. import (
  3. "gorm.io/gorm"
  4. )
  5. type Server struct {
  6. gorm.Model
  7. Title string `json:"title" gorm:"comment:'标题'"`
  8. Synopsis string `json:"synopsis" gorm:"comment:'简介'"` //简介
  9. Detail string `json:"detail" gorm:"comment:'详情'"` //详情
  10. ProductId uint `json:"product_id" gorm:"comment:'产品ID'"` //产品id
  11. Image string `json:"image" gorm:"comment:'图片链接'"`
  12. }
  13. type ServerDto struct {
  14. ID uint `json:"id"`
  15. Title string `json:"title" validate:"required"`
  16. Synopsis string `json:"synopsis" validate:"required"` //简介
  17. Detail string `json:"detail" validate:"required"` //详情
  18. ProductId uint `json:"product_id" validate:"required"` //产品id
  19. Image string `json:"image" validate:"required"`
  20. }