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
b8248930
Commit
b8248930
authored
2 years ago
by
Tucker Gary Siegel
Browse files
Options
Downloads
Patches
Plain Diff
fix error message
parent
97017041
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
persistence/mongodb.go
+2
-5
2 additions, 5 deletions
persistence/mongodb.go
services/gdd_service.go
+0
-1
0 additions, 1 deletion
services/gdd_service.go
with
2 additions
and
6 deletions
persistence/mongodb.go
+
2
−
5
View file @
b8248930
...
...
@@ -2,7 +2,6 @@ package persistence
import
(
"context"
"fmt"
"strings"
"github.com/tgs266/dawn-go-common/common"
...
...
@@ -86,11 +85,9 @@ func GddFindFirstByYearAndLocation(year int, location entities.Location) entitie
coll
:=
Session
.
Collection
(
"gdd"
)
filter
:=
buildLocationRequest
(
location
,
&
year
)
fmt
.
Println
(
filter
)
var
g
entities
.
Gdd
err
:=
coll
.
FindOne
(
Session
.
Ctx
,
filter
)
.
Decode
(
&
g
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
panic
(
config
.
NO_DATA_FOUND
.
PutDetail
(
"reason"
,
"gdd"
))
}
...
...
@@ -120,7 +117,7 @@ func GetLastNormalsYearly(location entities.Location) []entities.Gdd {
var
n
[]
entities
.
Gdd
cursor
,
err
:=
coll
.
Find
(
Session
.
Ctx
,
filter
,
options
.
Find
()
.
SetLimit
(
30
))
if
err
!=
nil
{
panic
(
config
.
NO_DATA_FOUND
.
PutDetail
(
"reason"
,
"
normal_
gdd"
))
panic
(
config
.
NO_DATA_FOUND
.
PutDetail
(
"reason"
,
"gdd"
))
}
if
err
=
cursor
.
All
(
Session
.
Ctx
,
&
n
);
err
!=
nil
{
...
...
@@ -128,7 +125,7 @@ func GetLastNormalsYearly(location entities.Location) []entities.Gdd {
}
if
len
(
n
)
==
0
{
panic
(
config
.
NO_DATA_FOUND
.
PutDetail
(
"reason"
,
"
normal_
gdd"
))
panic
(
config
.
NO_DATA_FOUND
.
PutDetail
(
"reason"
,
"gdd"
))
}
return
n
...
...
This diff is collapsed.
Click to expand it.
services/gdd_service.go
+
0
−
1
View file @
b8248930
...
...
@@ -37,7 +37,6 @@ func GetFullYearGddValues(ctx common.DawnCtx, request models.GddRequest) models.
func
GetGddValues
(
ctx
common
.
DawnCtx
,
request
models
.
GddRequest
)
models
.
GddResponse
{
product
:=
enums
.
GetProductFromString
(
request
.
Product
)
var
gdds
entities
.
Gdd
fmt
.
Println
(
request
)
if
request
.
Year
==
time
.
Now
()
.
Year
()
{
gdds
=
persistence
.
CurrentGddFindFirstByYearAndLocation
(
ctx
,
request
.
BuildLocation
())
}
else
{
...
...
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