datamodel done without validators

This commit is contained in:
matze committed 2025-04-17 12:33:53 +02:00
1 parent 284a40fac2
commit 5337da219e
58 files changed
+575 -227

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
package land
import (
"wagfarm-api/assets/base"
"wagfarm-api/database"
)
type Land struct {
base.Asset
FID string `gorm:"not null"`
IsWaterProtectionArea bool `gorm:"not null"`
IsRedArea bool `gorm:"not null"`
Area float64 `gorm:"not null"`
}
func RegisterModels() { database.RegisterModel(&Land{}) }
+11
View File
@@ -0,0 +1,11 @@
package land
import (
"wagfarm-api/generic"
"github.com/gin-gonic/gin"
)
func RegisterRoutes(rg *gin.RouterGroup) {
generic.RegisterCRUDRoutes(rg.Group("/land"), generic.DefaultCRUDController[Land]())
}