final project structure
This commit is contained in:
14
wagfarm-api/log/seeding/model.go
Normal file
14
wagfarm-api/log/seeding/model.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package seeding
|
||||
|
||||
import "wagfarm-api/log/base"
|
||||
|
||||
type SeedingLog struct {
|
||||
base.FieldWorkLog
|
||||
SeedID uint `gorm:"not null"`
|
||||
Seed asset.Seed `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;not null"`
|
||||
TechniqueID uint `gorm:"not null"`
|
||||
Technique taxonomy.SeedingTechnique `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;not null"`
|
||||
Amount float64 `gorm:"not null"` // in units/ha
|
||||
ConditionsID uint `gorm:"not null"`
|
||||
Conditions taxonomy.SeedingCondition `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;not null"`
|
||||
}
|
||||
11
wagfarm-api/log/seeding/route.go
Normal file
11
wagfarm-api/log/seeding/route.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package seeding
|
||||
|
||||
import (
|
||||
"wagfarm-api/generic"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RegisterRoutes(rg *gin.RouterGroup) {
|
||||
generic.RegisterCRUDRoutes(rg.Group("/seeding"), generic.DefaultCRUDController[SeedingLog]())
|
||||
}
|
||||
Reference in New Issue
Block a user