Skip to content
Snippets Groups Projects
Commit 7e80a3ac authored by Tucker Gary Siegel's avatar Tucker Gary Siegel
Browse files

update swagger documentation

parent 8d000f2a
No related branches found
No related tags found
2 merge requests!24update swagger,!23update swagger documentation
...@@ -12,19 +12,19 @@ import ( ...@@ -12,19 +12,19 @@ import (
var GetGddValues = services.GetGddValues var GetGddValues = services.GetGddValues
// GetDailyGdd godoc // GetDailyGdd godoc
// @Summary Get gdd values // @Summary Get GDD Values for given year
// @Tags Gdd, public // @Tags Gdd, public
// @Description get gdd values // @Security ApiKeyAuth
// @Accept json // @Accept json
// @Produce json // @Produce json
// @Success 200 {object} models.GddResponse // @Success 200 {object} models.GddResponse
// @Failure 400 {object} errors.StandardError // @Failure 400 {object} errors.StandardError
// @Param year query int true "Year to get gdd for" // @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 product query string true "Crop to calculate gdd for" Enums(corn)
// @Param latitude query number true "Latitude to search for" // @Param latitude query number true "Latitude to search for"
// @Param longitude query number true "Longitude to search for" // @Param longitude query number true "Longitude to search for"
// @Param accumulate query boolean true "Accumulate gdd values" // @Param accumulate query boolean true "Accumulate gdd values"
// @Param plantingDate query string true "Plant date, ISO8601 or RFC3339 format" // @Param plantingDate query string true "Plant date RFC3339 format"
// @Router /gdd/daily [get] // @Router /gdd/daily [get]
func GetDailyGdd(c *fiber.Ctx) error { func GetDailyGdd(c *fiber.Ctx) error {
ctx := common.DawnCtx{FiberCtx: c} ctx := common.DawnCtx{FiberCtx: c}
...@@ -33,14 +33,14 @@ func GetDailyGdd(c *fiber.Ctx) error { ...@@ -33,14 +33,14 @@ func GetDailyGdd(c *fiber.Ctx) error {
} }
// GetNormalGdd godoc // GetNormalGdd godoc
// @Summary Get gdd normals // @Summary Get GDD normals over the past 30 years
// @Tags Gdd // @Tags Gdd, public
// @Description get gdd normals // @Security ApiKeyAuth
// @Accept json // @Accept json
// @Produce json // @Produce json
// @Success 200 {object} models.GddResponse // @Success 200 {object} models.GddResponse
// @Failure 400 {object} errors.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 product query string true "Crop to calculate gdd for" Enums(corn)
// @Param latitude query number true "Latitude to search for" // @Param latitude query number true "Latitude to search for"
// @Param longitude query number true "Longitude to search for" // @Param longitude query number true "Longitude to search for"
// @Param accumulate query boolean true "Accumulate gdd values" // @Param accumulate query boolean true "Accumulate gdd values"
......
...@@ -4,6 +4,12 @@ import ( ...@@ -4,6 +4,12 @@ import (
"gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/cmd" "gitlab.cs.umd.edu/dawn/go-backend/dawn-gdd/cmd"
) )
// @title Dawn GDD Service
// @contact.name API Support
// @contact.email tgsiegel@umd.edu
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name Authorization
func main() { func main() {
cmd.Execute() cmd.Execute()
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment