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