diff --git a/controllers/data_download_controller.go b/controllers/data_download_controller.go index a926fe6dd795ac98a312811c7fe866f763c72d33..1ef58d99f86c4ed23af12a36345d18043faeee74 100644 --- a/controllers/data_download_controller.go +++ b/controllers/data_download_controller.go @@ -1,44 +1,45 @@ -package controllers - -import ( - "github.com/tgs266/dawn-go-common/common" - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" - - "github.com/gofiber/fiber/v2" -) - -// GetCSVFile godoc -// @Summary Get gdd data csv -// @Tags Gdd -// @Description Get gdd data csv -// @Accept json -// @Produce text/csv -// @Failure 400 {object} common.StandardError -// @Param analog query boolean false "Add analog data to csv" -// @Param cfs query boolean false "Add cfs data to csv" -// @Param cfs_upper query boolean false "Add cfs upper bound data to csv" -// @Param cfs_lower query boolean false "Add cfs lower bound data to csv" -// @Param comparison query boolean false "Add comparison year data to csv" -// @Param first_freezing query boolean false "Add first freezing date data to csv" -// @Param gefs query boolean false "Add gefs data to csv" -// @Param last_freezing query boolean false "Add last freezing date data to csv" -// @Param maximum query boolean false "Add maximum boundary of confidence interval data to csv" -// @Param minimum query boolean false "Add minimum boundary of confidence interval data to csv" -// @Param normals query boolean false "Add thirty year normal data to csv" -// @Param primary query boolean false "Add primary GDD data to csv" -// @Param comparison_year query int false "Comparison year to use" -// @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) -// @Param range query number false "Confidence interval percentage" -// @Param temperature query int false "Freezing date temperature" -// @Param year query int false "Year to get primary data for" -// @Param latitude query number true "Latitude to search for" -// @Param longitude query number true "Longitude to search for" -// @Router /gdd/csv [get] -func GetCSVFile(c *fiber.Ctx) error { - request := models.CSVRequest{}.Build(c) - ctx := common.DawnCtx{FiberCtx: c} - fileText := services.GetDataDownload(ctx, request) - e := c.Status(fiber.StatusOK).SendString(fileText) - return e -} +package controllers + +import ( + "github.com/tgs266/dawn-go-common/common" + _ "github.com/tgs266/dawn-go-common/errors" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" + + "github.com/gofiber/fiber/v2" +) + +// GetCSVFile godoc +// @Summary Get gdd data csv +// @Tags Gdd +// @Description Get gdd data csv +// @Accept json +// @Produce text/csv +// @Failure 400 {object} errors.StandardError +// @Param analog query boolean false "Add analog data to csv" +// @Param cfs query boolean false "Add cfs data to csv" +// @Param cfs_upper query boolean false "Add cfs upper bound data to csv" +// @Param cfs_lower query boolean false "Add cfs lower bound data to csv" +// @Param comparison query boolean false "Add comparison year data to csv" +// @Param first_freezing query boolean false "Add first freezing date data to csv" +// @Param gefs query boolean false "Add gefs data to csv" +// @Param last_freezing query boolean false "Add last freezing date data to csv" +// @Param maximum query boolean false "Add maximum boundary of confidence interval data to csv" +// @Param minimum query boolean false "Add minimum boundary of confidence interval data to csv" +// @Param normals query boolean false "Add thirty year normal data to csv" +// @Param primary query boolean false "Add primary GDD data to csv" +// @Param comparison_year query int false "Comparison year to use" +// @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) +// @Param range query number false "Confidence interval percentage" +// @Param temperature query int false "Freezing date temperature" +// @Param year query int false "Year to get primary data for" +// @Param latitude query number true "Latitude to search for" +// @Param longitude query number true "Longitude to search for" +// @Router /gdd/csv [get] +func GetCSVFile(c *fiber.Ctx) error { + request := models.CSVRequest{}.Build(c) + ctx := common.DawnCtx{FiberCtx: c} + fileText := services.GetDataDownload(ctx, request) + e := c.Status(fiber.StatusOK).SendString(fileText) + return e +} diff --git a/controllers/forecast_controller.go b/controllers/forecast_controller.go index e96b5a42491a2cba2a85eec998e89291a36230c0..b9a1f01d489d846cd3cff404146eaae2dda1f643 100644 --- a/controllers/forecast_controller.go +++ b/controllers/forecast_controller.go @@ -3,6 +3,7 @@ package controllers import ( "github.com/gofiber/fiber/v2" "github.com/tgs266/dawn-go-common/common" + _ "github.com/tgs266/dawn-go-common/errors" "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" ) @@ -14,7 +15,7 @@ import ( // @Accept json // @Produce json // @Success 200 {object} map[string]models.Bins -// @Failure 400 {object} common.StandardError +// @Failure 400 {object} errors.StandardError // @Param latitude query number true "Latitude to search for" // @Param longitude query number true "Longitude to search for" // @Param plant_date query string true "Plant date, ISO8601 or RFC3339 format" @@ -38,7 +39,7 @@ func ForecastStages(c *fiber.Ctx) error { // @Accept json // @Produce json // @Success 200 {object} map[string][]time.Time -// @Failure 400 {object} common.StandardError +// @Failure 400 {object} errors.StandardError // @Param latitude query number true "Latitude to search for" // @Param longitude query number true "Longitude to search for" // @Param freezing_temp query number true "Freezing temperature to use" diff --git a/controllers/freezing_dates_controller.go b/controllers/freezing_dates_controller.go index b3e4a80d6bce06ef8352d557e7e5ff3a58a7e713..ef58f818f1fe6ee986aa51463b0a4188185e54ed 100644 --- a/controllers/freezing_dates_controller.go +++ b/controllers/freezing_dates_controller.go @@ -1,6 +1,7 @@ package controllers import ( + _ "github.com/tgs266/dawn-go-common/errors" "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" @@ -14,7 +15,7 @@ import ( // @Accept json // @Produce json // @Success 200 {object} models.FreezingDateResponse -// @Failure 400 {object} common.StandardError +// @Failure 400 {object} errors.StandardError // @Param latitude query number true "Latitude to search for" // @Param longitude query number true "Longitude to search for" // @Param freezing_temp query number true "Freezing temperature to use" diff --git a/controllers/gdd_controller.go b/controllers/gdd_controller.go index 182b78d5c2b824178ac73896558d597a48b4da73..d482652ef7de9dc792c12941332b3b472e3e330e 100644 --- a/controllers/gdd_controller.go +++ b/controllers/gdd_controller.go @@ -2,6 +2,7 @@ package controllers import ( "github.com/tgs266/dawn-go-common/common" + _ "github.com/tgs266/dawn-go-common/errors" "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" @@ -17,7 +18,7 @@ var GetGddValues = services.GetGddValues // @Accept json // @Produce json // @Success 200 {object} models.GddResponse -// @Failure 400 {object} common.StandardError +// @Failure 400 {object} errors.StandardError // @Param year query int true "Year to get gdd for" // @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) // @Param latitude query number true "Latitude to search for" @@ -38,7 +39,7 @@ func GetDailyGdd(c *fiber.Ctx) error { // @Accept json // @Produce json // @Success 200 {object} models.GddResponse -// @Failure 400 {object} common.StandardError +// @Failure 400 {object} errors.StandardError // @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) // @Param latitude query number true "Latitude to search for" // @Param longitude query number true "Longitude to search for" diff --git a/controllers/maturity_controller.go b/controllers/maturity_controller.go index 857fce4123dc602bec0b84a6b04a79215b11513d..3c57b6a8d32e06085b447bd6a514e0fef3bf5938 100644 --- a/controllers/maturity_controller.go +++ b/controllers/maturity_controller.go @@ -1,87 +1,88 @@ -package controllers - -import ( - "github.com/gofiber/fiber/v2" - "github.com/tgs266/dawn-go-common/common" - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" -) - -type MaturityRequest struct { - PlantDate int `json:"plantdate"` - Tmins []float32 `json:"tmins"` - Tmaxs []float32 `json:"tmaxs"` - Srads []float32 `json:"srads"` - Rains []float32 `json:"rains"` - Units string `json:"units"` -} - -type ResponseTest struct { - Date int `json:"date"` -} - -// GetCultivars godoc -// @Summary Get all generic corn cultivars -// @Tags Maturity -// @Description Get all generic corn cultivars -// @Accept json -// @Produce json -// @Success 200 {object} models.CultivarResponse -// @Failure 400 {object} common.StandardError -// @Param name query string false "Name of cultivar to get" -// @Router /gdd/maturity/corn/cultivars [get] -func GetCultivars(c *fiber.Ctx) error { - ctx := common.DawnCtx{FiberCtx: c} - request := models.CultivarRequest{ - Name: c.Query("name", ""), - } - return c.Status(fiber.StatusOK).JSON(services.GetCultivars(ctx, request)) -} - -// GetMaturity godoc -// @Summary Get expected maturity date -// @Tags Maturity -// @Description Get expected maturity date -// @Accept json -// @Produce json -// @Success 200 {object} models.CornMaturityResponse -// @Failure 400 {object} common.StandardError -// @Param latitude query number true "Latitude to search for" -// @Param longitude query number true "Longitude to search for" -// @Param plant_month query number true "Platning month" -// @Param plant_date query number true "Platning date" -// @Param var_name query string true "Name of cultivar" -// @Param var_num query string true "ID# of cultivar" -// @Param eco_num query string true "Eco# of cultivar" -// @Param p1 query number true "P1 value of cultivar" -// @Param p2 query number true "P2 value of cultivar" -// @Param p5 query number true "P5 value of cultivar" -// @Param g2 query number true "G2 value of cultivar" -// @Param g3 query number true "G3 value of cultivar" -// @Param phint query number true "PHINT value of cultivar" -// @Router /gdd/maturity/corn [get] -func GetMaturity(c *fiber.Ctx) error { - ctx := common.DawnCtx{FiberCtx: c} - request := models.BuildCornMaturityRequest(ctx) - return c.Status(fiber.StatusOK).JSON(services.CalculateMaturity(ctx, request)) -} - -// GetMaturity godoc -// @Summary Get expected maturity date -// @Tags Maturity -// @Description Get expected maturity date -// @Accept json -// @Produce json -// @Success 200 {object} models.CornMaturityResponse -// @Failure 400 {object} common.StandardError -// @Param latitude query number true "Latitude to search for" -// @Param longitude query number true "Longitude to search for" -// @Param plant_month query number true "Platning month" -// @Param plant_date query number true "Platning date" -// @Param relative_maturity query number true "RM of seed" -// @Router /gdd/maturity/corn/relative [get] -func GetRMToMaturity(c *fiber.Ctx) error { - ctx := common.DawnCtx{FiberCtx: c} - request := models.BuildCornRMMaturityRequest(ctx) - return c.Status(fiber.StatusOK).JSON(services.CalculateRMMaturity(ctx, request)) -} +package controllers + +import ( + "github.com/gofiber/fiber/v2" + "github.com/tgs266/dawn-go-common/common" + _ "github.com/tgs266/dawn-go-common/errors" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" +) + +type MaturityRequest struct { + PlantDate int `json:"plantdate"` + Tmins []float32 `json:"tmins"` + Tmaxs []float32 `json:"tmaxs"` + Srads []float32 `json:"srads"` + Rains []float32 `json:"rains"` + Units string `json:"units"` +} + +type ResponseTest struct { + Date int `json:"date"` +} + +// GetCultivars godoc +// @Summary Get all generic corn cultivars +// @Tags Maturity +// @Description Get all generic corn cultivars +// @Accept json +// @Produce json +// @Success 200 {object} models.CultivarResponse +// @Failure 400 {object} errors.StandardError +// @Param name query string false "Name of cultivar to get" +// @Router /gdd/maturity/corn/cultivars [get] +func GetCultivars(c *fiber.Ctx) error { + ctx := common.DawnCtx{FiberCtx: c} + request := models.CultivarRequest{ + Name: c.Query("name", ""), + } + return c.Status(fiber.StatusOK).JSON(services.GetCultivars(ctx, request)) +} + +// GetMaturity godoc +// @Summary Get expected maturity date +// @Tags Maturity +// @Description Get expected maturity date +// @Accept json +// @Produce json +// @Success 200 {object} models.CornMaturityResponse +// @Failure 400 {object} errors.StandardError +// @Param latitude query number true "Latitude to search for" +// @Param longitude query number true "Longitude to search for" +// @Param plant_month query number true "Platning month" +// @Param plant_date query number true "Platning date" +// @Param var_name query string true "Name of cultivar" +// @Param var_num query string true "ID# of cultivar" +// @Param eco_num query string true "Eco# of cultivar" +// @Param p1 query number true "P1 value of cultivar" +// @Param p2 query number true "P2 value of cultivar" +// @Param p5 query number true "P5 value of cultivar" +// @Param g2 query number true "G2 value of cultivar" +// @Param g3 query number true "G3 value of cultivar" +// @Param phint query number true "PHINT value of cultivar" +// @Router /gdd/maturity/corn [get] +func GetMaturity(c *fiber.Ctx) error { + ctx := common.DawnCtx{FiberCtx: c} + request := models.BuildCornMaturityRequest(ctx) + return c.Status(fiber.StatusOK).JSON(services.CalculateMaturity(ctx, request)) +} + +// GetMaturity godoc +// @Summary Get expected maturity date +// @Tags Maturity +// @Description Get expected maturity date +// @Accept json +// @Produce json +// @Success 200 {object} models.CornMaturityResponse +// @Failure 400 {object} errors.StandardError +// @Param latitude query number true "Latitude to search for" +// @Param longitude query number true "Longitude to search for" +// @Param plant_month query number true "Platning month" +// @Param plant_date query number true "Platning date" +// @Param relative_maturity query number true "RM of seed" +// @Router /gdd/maturity/corn/relative [get] +func GetRMToMaturity(c *fiber.Ctx) error { + ctx := common.DawnCtx{FiberCtx: c} + request := models.BuildCornRMMaturityRequest(ctx) + return c.Status(fiber.StatusOK).JSON(services.CalculateRMMaturity(ctx, request)) +} diff --git a/controllers/misc_controller.go b/controllers/misc_controller.go index f8d2aa4b48acf3d4864244827a76bc1c91685768..9b770e6aa56dfd67f987a4e6385c6b0d1cac6cbb 100644 --- a/controllers/misc_controller.go +++ b/controllers/misc_controller.go @@ -1,57 +1,59 @@ -package controllers - -import ( - "strconv" - - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/config" - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/persistence" - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/persistence/entities" - "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" - - "github.com/gofiber/fiber/v2" -) - -// GetAnalogYear godoc -// @Summary Get analog year -// @Tags Gdd -// @Description Get analog year -// @Accept json -// @Produce json -// @Success 200 {object} models.AnalogResponse -// @Failure 400 {object} common.StandardError -// @Param latitude query number true "Latitude to search for" -// @Param longitude query number true "Longitude to search for" -// @Router /gdd/analog [get] -func GetAnalogYear(c *fiber.Ctx) error { - lat, _ := strconv.ParseFloat(c.Query("latitude", "-10000.0"), 64) - lon, _ := strconv.ParseFloat(c.Query("longitude", "-10000.0"), 64) - err := models.ValidateAnalogRequest(lat, lon) - if err != nil { - panic(config.BAD_REQUEST) - } - - location := entities.Location{Type: "Point", Coordinates: []float64{lon, lat}} - - return c.Status(fiber.StatusOK).JSON( - persistence.FindAnalogYear(location), - ) -} - -// GetConfidenceInterval godoc -// @Summary Get confidence interval -// @Tags Gdd -// @Description Get confidence interval -// @Accept json -// @Produce json -// @Success 200 {object} models.ConfidenceIntervalResposne -// @Failure 400 {object} common.StandardError -// @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) -// @Param Interval query number true "Interval values" Enums(80, 85, 90, 95, 99, 99.5, 99.9) -// @Param latitude query number true "Latitude to search for" -// @Param longitude query number true "Longitude to search for" -// @Router /gdd/confidence [get] -func GetConfidenceInterval(c *fiber.Ctx) error { - r := models.ConfidenceIntervalRequest{}.Build(c) - return c.Status(fiber.StatusOK).JSON(services.GetConfidenceInterval(r)) -} +package controllers + +import ( + "strconv" + + _ "github.com/tgs266/dawn-go-common/errors" + + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/config" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/persistence" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/persistence/entities" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" + + "github.com/gofiber/fiber/v2" +) + +// GetAnalogYear godoc +// @Summary Get analog year +// @Tags Gdd +// @Description Get analog year +// @Accept json +// @Produce json +// @Success 200 {object} models.AnalogResponse +// @Failure 400 {object} errors.StandardError +// @Param latitude query number true "Latitude to search for" +// @Param longitude query number true "Longitude to search for" +// @Router /gdd/analog [get] +func GetAnalogYear(c *fiber.Ctx) error { + lat, _ := strconv.ParseFloat(c.Query("latitude", "-10000.0"), 64) + lon, _ := strconv.ParseFloat(c.Query("longitude", "-10000.0"), 64) + err := models.ValidateAnalogRequest(lat, lon) + if err != nil { + panic(config.BAD_REQUEST) + } + + location := entities.Location{Type: "Point", Coordinates: []float64{lon, lat}} + + return c.Status(fiber.StatusOK).JSON( + persistence.FindAnalogYear(location), + ) +} + +// GetConfidenceInterval godoc +// @Summary Get confidence interval +// @Tags Gdd +// @Description Get confidence interval +// @Accept json +// @Produce json +// @Success 200 {object} models.ConfidenceIntervalResposne +// @Failure 400 {object} errors.StandardError +// @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) +// @Param Interval query number true "Interval values" Enums(80, 85, 90, 95, 99, 99.5, 99.9) +// @Param latitude query number true "Latitude to search for" +// @Param longitude query number true "Longitude to search for" +// @Router /gdd/confidence [get] +func GetConfidenceInterval(c *fiber.Ctx) error { + r := models.ConfidenceIntervalRequest{}.Build(c) + return c.Status(fiber.StatusOK).JSON(services.GetConfidenceInterval(r)) +} diff --git a/controllers/nomads_controller.go b/controllers/nomads_controller.go index c2d645c40b3d1d787435c7cbc785bd8856529f3b..e79592543d4d4d5684a9580feb3f3e8213a093f4 100644 --- a/controllers/nomads_controller.go +++ b/controllers/nomads_controller.go @@ -1,6 +1,8 @@ package controllers import ( + _ "github.com/tgs266/dawn-go-common/errors" + "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" @@ -14,7 +16,7 @@ import ( // @Accept json // @Produce json // @Success 200 {object} models.GefsGddResponse -// @Failure 400 {object} common.StandardError +// @Failure 400 {object} errors.StandardError // @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) // @Param latitude query number true "Latitude to search for" // @Param longitude query number true "Longitude to search for" @@ -32,7 +34,7 @@ func GetGefsGDD(c *fiber.Ctx) error { // @Accept json // @Produce json // @Success 200 {object} models.CfsGddResponse -// @Failure 400 {object} common.StandardError +// @Failure 400 {object} errors.StandardError // @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) // @Param latitude query number true "Latitude to search for" // @Param longitude query number true "Longitude to search for" @@ -50,7 +52,7 @@ func GetCfsGDD(c *fiber.Ctx) error { // // @Accept json // // @Produce json // // @Success 200 {object} models.CfsGddResponse -// // @Failure 400 {object} common.StandardError +// // @Failure 400 {object} errors.StandardError // // @Param product query string true "Crop to calculate gdd for" Enums(corn, soybean, sunflower, tomato, sugar_beet, peanut, cotton, potato, wheat, pea, oat, spring_wheat, rice, sorghum) // // @Param latitude query number true "Latitude to search for" // // @Param longitude query number true "Longitude to search for" diff --git a/controllers/seed_controllers.go b/controllers/seed_controllers.go index 27925ffd5d0a02a431a8d7c564ae5e69ff7757e4..ac8562d8f8aa0a52d2c5949ff545da3d2167817e 100644 --- a/controllers/seed_controllers.go +++ b/controllers/seed_controllers.go @@ -1,38 +1,38 @@ -package controllers - -// import ( -// "github.com/tgs266/dawn-go-common/common" -// "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" -// "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" - -// "github.com/gofiber/fiber/v2" -// ) - -// func GetSeedList(c *fiber.Ctx) error { -// request := models.SeedListRequest{Product: c.Query("product")} -// return c.Status(fiber.StatusOK).JSON( -// services.GetSeedList(c, request), -// ) -// } - -// // GetCornSeedMaturityDate godoc -// // @Summary Get estimated maturity date from given gdd (uses CFS data if current GDUs are less than the crop maturity) -// // @Tags GDD Maturity Data -// // @Description Get estimated maturity date from given gdd -// // @Accept json -// // @Produce json -// // @Success 200 {object} models.CornMaturityResponse -// // @Failure 400 {object} common.StandardError -// // @Param latitude query number true "Latitude to search for" -// // @Param longitude query number true "Longitude to search for" -// // @Param gdds query number true "number of gdds given" -// // @Param month query number true "month planted" -// // @Param date query number true "date planted" -// // @Router /gdd/maturity/corn [get] -// func GetCornSeedMaturityDate(c *fiber.Ctx) error { -// ctx := common.DawnCtx{FiberCtx: c} -// request := models.BuildCornMaturityRequest(c) -// return c.Status(fiber.StatusOK).JSON( -// services.GetCornMaturityDate(ctx, request), -// ) -// } +package controllers + +// import ( +// "github.com/tgs266/dawn-go-common/common" +// "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/models" +// "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/services" + +// "github.com/gofiber/fiber/v2" +// ) + +// func GetSeedList(c *fiber.Ctx) error { +// request := models.SeedListRequest{Product: c.Query("product")} +// return c.Status(fiber.StatusOK).JSON( +// services.GetSeedList(c, request), +// ) +// } + +// // GetCornSeedMaturityDate godoc +// // @Summary Get estimated maturity date from given gdd (uses CFS data if current GDUs are less than the crop maturity) +// // @Tags GDD Maturity Data +// // @Description Get estimated maturity date from given gdd +// // @Accept json +// // @Produce json +// // @Success 200 {object} models.CornMaturityResponse +// // @Failure 400 {object} errors.StandardError +// // @Param latitude query number true "Latitude to search for" +// // @Param longitude query number true "Longitude to search for" +// // @Param gdds query number true "number of gdds given" +// // @Param month query number true "month planted" +// // @Param date query number true "date planted" +// // @Router /gdd/maturity/corn [get] +// func GetCornSeedMaturityDate(c *fiber.Ctx) error { +// ctx := common.DawnCtx{FiberCtx: c} +// request := models.BuildCornMaturityRequest(c) +// return c.Status(fiber.StatusOK).JSON( +// services.GetCornMaturityDate(ctx, request), +// ) +// }