Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dawn-gdd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
dawn
go-backend
dawn-gdd
Commits
89b89c5c
Commit
89b89c5c
authored
3 years ago
by
Tucker Siegel
Browse files
Options
Downloads
Patches
Plain Diff
minor updates
parent
cd68d480
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+8
-2
8 additions, 2 deletions
README.md
models/gdd.go
+4
-4
4 additions, 4 deletions
models/gdd.go
services/gdd_service.go
+1
-1
1 addition, 1 deletion
services/gdd_service.go
with
13 additions
and
7 deletions
README.md
+
8
−
2
View file @
89b89c5c
To build swagger:
# Weather server
`swag init --parseDependency --parseInternal`
Used to serve gdd, cfs, and gefs data, and can be expanded to more data
Still need to add CFS/GEFS, and confidence intervals
In the future, the errors folder might be moved to a common package when more go services are built to have shared error
In the future, the errors folder might be moved to a common package when more go services are built to have shared error
handling across all services
handling across all services
To run:
`go run main.go`
Build to executable:
`go build`
To rebuild swagger:
`swag init`
This diff is collapsed.
Click to expand it.
models/gdd.go
+
4
−
4
View file @
89b89c5c
...
@@ -3,11 +3,11 @@ package models
...
@@ -3,11 +3,11 @@ package models
import
(
import
(
"dawn-weather/errors"
"dawn-weather/errors"
"dawn-weather/persistence/entities"
"dawn-weather/persistence/entities"
validation
"github.com/go-ozzo/ozzo-validation"
"github.com/gofiber/fiber/v2"
"go.mongodb.org/mongo-driver/bson/primitive"
"strconv"
"strconv"
"time"
"time"
validation
"github.com/go-ozzo/ozzo-validation"
"github.com/gofiber/fiber/v2"
)
)
type
GddResponse
struct
{
type
GddResponse
struct
{
...
@@ -15,7 +15,7 @@ type GddResponse struct {
...
@@ -15,7 +15,7 @@ type GddResponse struct {
NearestLatitude
float64
`json:"nearest_latitude"`
NearestLatitude
float64
`json:"nearest_latitude"`
NearestLongitude
float64
`json:"nearest_longitude"`
NearestLongitude
float64
`json:"nearest_longitude"`
GddValues
[]
float64
`json:"gdd_values"`
GddValues
[]
float64
`json:"gdd_values"`
LastDate
primitive
.
DateTime
`json:"last_date"`
LastDate
string
`json:"last_date"`
}
}
type
GddRequest
struct
{
type
GddRequest
struct
{
...
...
This diff is collapsed.
Click to expand it.
services/gdd_service.go
+
1
−
1
View file @
89b89c5c
...
@@ -74,7 +74,7 @@ func GetGddValues(request models.GddRequest) models.GddResponse {
...
@@ -74,7 +74,7 @@ func GetGddValues(request models.GddRequest) models.GddResponse {
NearestLatitude
:
gdds
.
Location
.
Coordinates
[
1
],
NearestLatitude
:
gdds
.
Location
.
Coordinates
[
1
],
NearestLongitude
:
gdds
.
Location
.
Coordinates
[
0
],
NearestLongitude
:
gdds
.
Location
.
Coordinates
[
0
],
GddValues
:
CalculateGddValues
(
gdds
.
MinTemps
,
gdds
.
MaxTemps
,
product
,
request
.
Accumulate
),
GddValues
:
CalculateGddValues
(
gdds
.
MinTemps
,
gdds
.
MaxTemps
,
product
,
request
.
Accumulate
),
LastDate
:
gdds
.
LastDate
,
LastDate
:
gdds
.
LastDate
.
Time
()
.
String
()
,
}
}
return
returnGdds
return
returnGdds
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment