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