all.go 451 B

12345678910111213141516171819202122
  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. }
  11. // Init 初始化所有model
  12. func (a *All) Init(db *gorm.DB) *All {
  13. a.Product = new(Product).Init(db)
  14. a.Vendor = new(Vendor).Init(db)
  15. a.User = new(User).Init(db)
  16. a.Application = new(Application).Init(db)
  17. a.Protocal = new(Protocal).Init(db)
  18. return a
  19. }