updates
This commit is contained in:
21
server/internal/models/supplement.go
Normal file
21
server/internal/models/supplement.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package models
|
||||
|
||||
func (Supplement) TableName() string {
|
||||
return "supplements"
|
||||
}
|
||||
|
||||
type Supplement struct {
|
||||
BaseModel
|
||||
Name string `json:"name" db:"name"`
|
||||
Description string `json:"description" db:"description"`
|
||||
Price int `json:"price" db:"price"`
|
||||
Image string `json:"image" db:"image"`
|
||||
Nutrients []Nutrient `json:"nutrients" db:"nutrients" gorm:"many2many:supplement_nutrients;"`
|
||||
SupplementNutrients []SupplementNutrient `json:"supplementNutrients" db:"supplementNutrients" gorm:"foreignKey:SupplementID"`
|
||||
}
|
||||
|
||||
type DailySupplementsOverview struct {
|
||||
Supplements []*Supplement `json:"supplements"`
|
||||
Nutrients []*Nutrient `json:"nutrients"`
|
||||
Overview []*SupplementNutrientOverview `json:"overview"`
|
||||
}
|
||||
Reference in New Issue
Block a user