Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSLogic
Commits
088ceef3
Commit
088ceef3
authored
2 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Improving documentation for the endpoints in GrowthStageService
parent
b40ffad7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/nibio/vips/logic/service/GrowthStageService.java
+26
-0
26 additions, 0 deletions
.../java/no/nibio/vips/logic/service/GrowthStageService.java
with
26 additions
and
0 deletions
src/main/java/no/nibio/vips/logic/service/GrowthStageService.java
+
26
−
0
View file @
088ceef3
...
@@ -60,6 +60,7 @@ public class GrowthStageService {
...
@@ -60,6 +60,7 @@ public class GrowthStageService {
PointOfInterestBean
pointOfInterestBean
;
PointOfInterestBean
pointOfInterestBean
;
/**
/**
* TODO Add response example
* At what dates can we expect the given crop to be at the given growth stages
* At what dates can we expect the given crop to be at the given growth stages
* at the given location?
* at the given location?
* @param organismId
* @param organismId
...
@@ -94,6 +95,7 @@ public class GrowthStageService {
...
@@ -94,6 +95,7 @@ public class GrowthStageService {
}
}
/**
/**
* TODO Add response example
* At what GS is the given organism at the given date and location?
* At what GS is the given organism at the given date and location?
* @param organismId
* @param organismId
* @param dateStr
* @param dateStr
...
@@ -122,6 +124,11 @@ public class GrowthStageService {
...
@@ -122,6 +124,11 @@ public class GrowthStageService {
return
Response
.
ok
().
entity
(
retVal
).
build
();
return
Response
.
ok
().
entity
(
retVal
).
build
();
}
}
/**
*
* @param location
* @return
*/
private
Coordinate
getLocationCoordinate
(
String
location
)
private
Coordinate
getLocationCoordinate
(
String
location
)
{
{
String
[]
lonLat
=
location
.
split
(
","
);
String
[]
lonLat
=
location
.
split
(
","
);
...
@@ -131,6 +138,12 @@ public class GrowthStageService {
...
@@ -131,6 +138,12 @@ public class GrowthStageService {
return
retVal
;
return
retVal
;
}
}
/**
*
* @param datesForGrowthStages
* @param date
* @return
*/
private
Integer
getGrowthStageForDate
(
List
<
GrowthStageLocationDate
>
datesForGrowthStages
,
LocalDate
date
)
private
Integer
getGrowthStageForDate
(
List
<
GrowthStageLocationDate
>
datesForGrowthStages
,
LocalDate
date
)
{
{
Integer
dateDayNum
=
date
.
getDayOfYear
();
Integer
dateDayNum
=
date
.
getDayOfYear
();
...
@@ -168,6 +181,13 @@ public class GrowthStageService {
...
@@ -168,6 +181,13 @@ public class GrowthStageService {
return
null
;
return
null
;
}
}
/**
*
* @param datesForGrowthStages
* @param growthStage
* @param season
* @return
*/
private
LocalDate
getDateForGrowthStage
(
List
<
GrowthStageLocationDate
>
datesForGrowthStages
,
Integer
growthStage
,
Integer
season
)
private
LocalDate
getDateForGrowthStage
(
List
<
GrowthStageLocationDate
>
datesForGrowthStages
,
Integer
growthStage
,
Integer
season
)
{
{
Collections
.
sort
(
datesForGrowthStages
);
Collections
.
sort
(
datesForGrowthStages
);
...
@@ -203,6 +223,12 @@ public class GrowthStageService {
...
@@ -203,6 +223,12 @@ public class GrowthStageService {
return
null
;
return
null
;
}
}
/**
*
* @param location
* @param organismId
* @return
*/
private
List
<
GrowthStageLocationDate
>
getGrowthStageDatesForLocationAndCrop
(
String
location
,
Integer
organismId
)
private
List
<
GrowthStageLocationDate
>
getGrowthStageDatesForLocationAndCrop
(
String
location
,
Integer
organismId
)
{
{
List
<
PointOfInterestWeatherStation
>
stationsWithGrowthStageInfoForCrop
=
em
.
createNativeQuery
(
List
<
PointOfInterestWeatherStation
>
stationsWithGrowthStageInfoForCrop
=
em
.
createNativeQuery
(
...
...
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