final project structure
This commit is contained in:
9
wagfarm-api/log/harvest/model.go
Normal file
9
wagfarm-api/log/harvest/model.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package harvest
|
||||
|
||||
import base "wagfarm-api/log/seeding"
|
||||
|
||||
type HarvestLog struct {
|
||||
base.FieldWorkLog
|
||||
Product asset.Product `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;not null"`
|
||||
Amount float64 `gorm:"not null"` // in units of the product
|
||||
}
|
||||
11
wagfarm-api/log/harvest/route.go
Normal file
11
wagfarm-api/log/harvest/route.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package harvest
|
||||
|
||||
import (
|
||||
"wagfarm-api/generic"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RegisterRoutes(rg *gin.RouterGroup) {
|
||||
generic.RegisterCRUDRoutes(rg.Group("/harvest"), generic.DefaultCRUDController[HarvestLog]())
|
||||
}
|
||||
Reference in New Issue
Block a user