final project structure
This commit is contained in:
12
wagfarm-api/taxonomy/ingredient/model.go
Normal file
12
wagfarm-api/taxonomy/ingredient/model.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package ingredient
|
||||
|
||||
import (
|
||||
"wagfarm-api/taxonomy/base"
|
||||
"wagfarm-api/taxonomy/unit"
|
||||
)
|
||||
|
||||
type Ingredient struct {
|
||||
base.Taxonomy
|
||||
UnitID uint `gorm:"not null"`
|
||||
Unit unit.Unit `gorm:"not null"`
|
||||
}
|
||||
11
wagfarm-api/taxonomy/ingredient/route.go
Normal file
11
wagfarm-api/taxonomy/ingredient/route.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package ingredient
|
||||
|
||||
import (
|
||||
"wagfarm-api/generic"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RegisterRoutes(rg *gin.RouterGroup) {
|
||||
generic.RegisterCRUDRoutes(rg.Group("/ingredient"), generic.DefaultCRUDController[Ingredient]())
|
||||
}
|
||||
Reference in New Issue
Block a user