Skip to content
Snippets Groups Projects
Commit 088ceef3 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Improving documentation for the endpoints in GrowthStageService

parent b40ffad7
Branches
No related tags found
No related merge requests found
...@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment