product.go 542 B

1234567891011121314151617181920212223
  1. // product is a abstract define of same devices made by some vendor
  2. package models
  3. import (
  4. "github.com/jinzhu/gorm"
  5. )
  6. // Product product
  7. type Product struct {
  8. gorm.Model
  9. // which vendor
  10. VendorID int32
  11. // name
  12. ProductName string `sql:"type:varchar(200);not null;"`
  13. // desc
  14. ProductDescription string `sql:"type:text;not null;"`
  15. // product key to auth a product
  16. ProductKey string `sql:"type:varchar(200);not null;unique;key;"`
  17. // product config string (JSON)
  18. ProductConfig string `sql:"type:text; not null;"`
  19. Devices []Device
  20. }