fix request body examples in publicapi

This commit is contained in:
Bernaldo Mihasi 2022-10-18 09:39:46 +03:00
parent 3361b6aff6
commit 20f618a5d7
8 changed files with 40 additions and 2 deletions

View File

@ -25,5 +25,10 @@
<artifactId>elastic</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.20</version>
</dependency>
</dependencies>
</project>

View File

@ -1,9 +1,9 @@
package eu.eudat.data.dao.criteria;
import eu.eudat.queryable.queryableentity.DataEntity;
import io.swagger.annotations.ApiModelProperty;
public abstract class Criteria<T> {
@ApiModelProperty(value = "like", name = "like", dataType = "String", allowEmptyValue = true, example = "\"\"")
private String like;
public String getLike() {

View File

@ -3,12 +3,14 @@ package eu.eudat.data.query.definition;
import eu.eudat.data.dao.criteria.Criteria;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.queryableentity.DataEntity;
import io.swagger.annotations.ApiModelProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class Query<C extends Criteria<T>, T extends DataEntity> implements CriteriaQuery<C, T> {
private static final Logger logger = LoggerFactory.getLogger(Query.class);
private C criteria;
@ApiModelProperty(value = "query", name = "query", dataType = "String", hidden = true)
private QueryableList<T> query;
public static class QueryBuilder<C extends Criteria<T>, T extends DataEntity, Q extends Query<C, T>> {

View File

@ -6,12 +6,16 @@ import eu.eudat.data.query.definition.helpers.ColumnOrderings;
import eu.eudat.data.query.definition.helpers.SelectionFields;
import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.queryableentity.DataEntity;
import io.swagger.annotations.ApiModelProperty;
public abstract class TableQuery<C extends Criteria<T>, T extends DataEntity<T, K>, K> extends Query<C, T> implements TableCriteriaQuery<C, T> {
private ColumnOrderings orderings;
@ApiModelProperty(hidden = true)
private SelectionFields selection;
@ApiModelProperty(value = "length", name = "length", dataType = "Integer", example = "2")
private Integer length;
@ApiModelProperty(value = "offset", name = "offset", dataType = "Integer", example = "0")
private Integer offset;
public Integer getLength() {

View File

@ -1,11 +1,14 @@
package eu.eudat.data.query.definition.helpers;
import io.swagger.annotations.ApiModelProperty;
import java.util.LinkedList;
import java.util.List;
public class ColumnOrderings {
@ApiModelProperty(value = "fields", name = "fields", dataType = "List<String>", example = "[]")
private List<String> fields;
public List<String> getFields() {

View File

@ -1,8 +1,11 @@
package eu.eudat.data.query.definition.helpers;
import io.swagger.annotations.ApiModelProperty;
public class SelectionFields {
@ApiModelProperty(value = "fields", name = "fields", dataType = "String[]", example = "[]")
private String[] fields;
public String[] getFields() {

View File

@ -3,6 +3,7 @@ package eu.eudat.publicapi.criteria.dataset;
import eu.eudat.data.dao.criteria.Criteria;
import eu.eudat.data.entities.Dataset;
import eu.eudat.elastic.entities.Tag;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
@ -10,15 +11,25 @@ import java.util.UUID;
public class DatasetPublicCriteria extends Criteria<Dataset> {
@ApiModelProperty(value = "periodStart", name = "periodStart", dataType = "Date", example = "2022-01-01T13:19:42.210Z")
private Date periodStart;
@ApiModelProperty(value = "periodEnd", name = "periodEnd", dataType = "Date", example = "2022-12-31T13:19:42.210Z")
private Date periodEnd;
@ApiModelProperty(value = "grants", name = "grants", dataType = "List<UUID>", example = "[]")
private List<UUID> grants;
@ApiModelProperty(value = "collaborators", name = "collaborators", dataType = "List<UUID>", example = "[]")
private List<UUID> collaborators;
@ApiModelProperty(value = "datasetTemplates", name = "datasetTemplates", dataType = "List<UUID>", example = "[]")
private List<UUID> datasetTemplates;
@ApiModelProperty(value = "dmpOrganisations", name = "dmpOrganisations", dataType = "List<String>", example = "[]")
private List<String> dmpOrganisations;
@ApiModelProperty(value = "tags", name = "tags", dataType = "List<Tag>", example = "[]")
private List<Tag> tags;
@ApiModelProperty(value = "dmpIds", name = "dmpIds", dataType = "List<UUID>", example = "[]")
private List<UUID> dmpIds;
@ApiModelProperty(value = "groupIds", name = "groupIds", dataType = "List<UUID>", example = "[]")
private List<UUID> groupIds;
@ApiModelProperty(value = "allVersions", name = "allVersions", dataType = "Boolean", example = "false")
private boolean allVersions;
public Date getPeriodStart() {

View File

@ -2,20 +2,30 @@ package eu.eudat.publicapi.criteria.dmp;
import eu.eudat.data.dao.criteria.Criteria;
import eu.eudat.data.entities.DMP;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
import java.util.UUID;
public class DataManagementPlanPublicCriteria extends Criteria<DMP> {
@ApiModelProperty(value = "periodStart", name = "periodStart", dataType = "Date", example = "2022-01-01T13:19:42.210Z")
private Date periodStart;
@ApiModelProperty(value = "periodEnd", name = "periodEnd", dataType = "Date", example = "2022-12-31T13:19:42.210Z")
private Date periodEnd;
@ApiModelProperty(value = "grants", name = "grants", dataType = "List<UUID>", example = "[]")
private List<UUID> grants;
@ApiModelProperty(value = "funders", name = "funders", dataType = "List<UUID>", example = "[]")
private List<UUID> funders;
@ApiModelProperty(value = "datasetTemplates", name = "datasetTemplates", dataType = "List<UUID>", example = "[]")
private List<UUID> datasetTemplates;
@ApiModelProperty(value = "dmpOrganisations", name = "dmpOrganisations", dataType = "List<String>", example = "[]")
private List<String> dmpOrganisations;
@ApiModelProperty(value = "collaborators", name = "collaborators", dataType = "List<UUID>", example = "[]")
private List<UUID> collaborators;
@ApiModelProperty(value = "allVersions", name = "allVersions", dataType = "Boolean", example = "false")
private boolean allVersions;
@ApiModelProperty(value = "groupIds", name = "groupIds", dataType = "List<UUID>", example = "[]")
private List<UUID> groupIds;
public Date getPeriodStart() {