Crops API v1
https://genesys.demo.genesys-pgr.org/c and https://genesys.demo.genesys-pgr.org/c/barley now provide basic crop information.
The crop BrowsePage needs to be updated to display more information (see https://www.genesys-pgr.org/c/banana as example).
Create CropsController
in org.genesys2.server.api.v1
based on existing v0 controller.
Crop details API response
Add a new endpoint to the crop API /{shortName}/details response to include:
- the crop blurb (in language selected in React)
- number of active accessions
- crop image gallery information (see below)
- overview data from ES
For each crop, the file repository will contain an image gallery in /crop/{shortName}/cover
. In the API response, include a list of repository images that can be used as the picture in https://material-ui.com/demos/cards/#media.
Add a CropDetails
class to CropsController
:
public static class CropDetails {
public Crop crop;
public Article blurb;
public long accessionCount;
public List<RepositoryImage> covers;
public Map<String, ElasticsearchService.TermResult> overview;
}
Note: Serialize only the minimum required information for covers
(JsonViews.Minimal.class
?).