123456789101112131415161718192021222324 |
- package model
- import "github.com/jinzhu/gorm"
- // All 导出
- type All struct {
- Product *Product
- Vendor *Vendor
- User *User
- Application *Application
- Protocal *Protocal
- Alert *Alert
- }
- // Init 初始化所有model
- func (a *All) Init(db *gorm.DB) *All {
- a.Product = new(Product).Init(db)
- a.Vendor = new(Vendor).Init(db)
- a.User = new(User).Init(db)
- a.Application = new(Application).Init(db)
- a.Protocal = new(Protocal).Init(db)
- a.Alert = new(Alert).Init(db)
- return a
- }
|