all.go 604 B

12345678910111213141516171819202122232425262728
  1. package model
  2. import "github.com/jinzhu/gorm"
  3. // All 导出
  4. type All struct {
  5. Product *Product
  6. Vendor *Vendor
  7. User *User
  8. Application *Application
  9. Protocal *Protocal
  10. Alert *Alert
  11. Device *Device
  12. Role *Role
  13. }
  14. // Init 初始化所有model
  15. func (a *All) Init(db *gorm.DB) *All {
  16. a.Product = new(Product).Init(db)
  17. a.Vendor = new(Vendor).Init(db)
  18. a.User = new(User).Init(db)
  19. a.Application = new(Application).Init(db)
  20. a.Protocal = new(Protocal).Init(db)
  21. a.Alert = new(Alert).Init(db)
  22. a.Device = new(Device).Init(db)
  23. a.Role = new(Role).Init(db)
  24. return a
  25. }