fix request body examples in publicapi
This commit is contained in:
parent
3361b6aff6
commit
20f618a5d7
|
@ -25,5 +25,10 @@
|
||||||
<artifactId>elastic</artifactId>
|
<artifactId>elastic</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-annotations</artifactId>
|
||||||
|
<version>1.5.20</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -1,9 +1,9 @@
|
||||||
package eu.eudat.data.dao.criteria;
|
package eu.eudat.data.dao.criteria;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
|
||||||
|
|
||||||
public abstract class Criteria<T> {
|
public abstract class Criteria<T> {
|
||||||
|
@ApiModelProperty(value = "like", name = "like", dataType = "String", allowEmptyValue = true, example = "\"\"")
|
||||||
private String like;
|
private String like;
|
||||||
|
|
||||||
public String getLike() {
|
public String getLike() {
|
||||||
|
|
|
@ -3,12 +3,14 @@ package eu.eudat.data.query.definition;
|
||||||
import eu.eudat.data.dao.criteria.Criteria;
|
import eu.eudat.data.dao.criteria.Criteria;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public abstract class Query<C extends Criteria<T>, T extends DataEntity> implements CriteriaQuery<C, T> {
|
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 static final Logger logger = LoggerFactory.getLogger(Query.class);
|
||||||
private C criteria;
|
private C criteria;
|
||||||
|
@ApiModelProperty(value = "query", name = "query", dataType = "String", hidden = true)
|
||||||
private QueryableList<T> query;
|
private QueryableList<T> query;
|
||||||
|
|
||||||
public static class QueryBuilder<C extends Criteria<T>, T extends DataEntity, Q extends Query<C, T>> {
|
public static class QueryBuilder<C extends Criteria<T>, T extends DataEntity, Q extends Query<C, T>> {
|
||||||
|
|
|
@ -6,12 +6,16 @@ import eu.eudat.data.query.definition.helpers.ColumnOrderings;
|
||||||
import eu.eudat.data.query.definition.helpers.SelectionFields;
|
import eu.eudat.data.query.definition.helpers.SelectionFields;
|
||||||
import eu.eudat.queryable.QueryableList;
|
import eu.eudat.queryable.QueryableList;
|
||||||
import eu.eudat.queryable.queryableentity.DataEntity;
|
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> {
|
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;
|
private ColumnOrderings orderings;
|
||||||
|
@ApiModelProperty(hidden = true)
|
||||||
private SelectionFields selection;
|
private SelectionFields selection;
|
||||||
|
@ApiModelProperty(value = "length", name = "length", dataType = "Integer", example = "2")
|
||||||
private Integer length;
|
private Integer length;
|
||||||
|
@ApiModelProperty(value = "offset", name = "offset", dataType = "Integer", example = "0")
|
||||||
private Integer offset;
|
private Integer offset;
|
||||||
|
|
||||||
public Integer getLength() {
|
public Integer getLength() {
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
package eu.eudat.data.query.definition.helpers;
|
package eu.eudat.data.query.definition.helpers;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class ColumnOrderings {
|
public class ColumnOrderings {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "fields", name = "fields", dataType = "List<String>", example = "[]")
|
||||||
private List<String> fields;
|
private List<String> fields;
|
||||||
|
|
||||||
public List<String> getFields() {
|
public List<String> getFields() {
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
package eu.eudat.data.query.definition.helpers;
|
package eu.eudat.data.query.definition.helpers;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
public class SelectionFields {
|
public class SelectionFields {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "fields", name = "fields", dataType = "String[]", example = "[]")
|
||||||
private String[] fields;
|
private String[] fields;
|
||||||
|
|
||||||
public String[] getFields() {
|
public String[] getFields() {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package eu.eudat.publicapi.criteria.dataset;
|
||||||
import eu.eudat.data.dao.criteria.Criteria;
|
import eu.eudat.data.dao.criteria.Criteria;
|
||||||
import eu.eudat.data.entities.Dataset;
|
import eu.eudat.data.entities.Dataset;
|
||||||
import eu.eudat.elastic.entities.Tag;
|
import eu.eudat.elastic.entities.Tag;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -10,15 +11,25 @@ import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
public class DatasetPublicCriteria extends Criteria<Dataset> {
|
public class DatasetPublicCriteria extends Criteria<Dataset> {
|
||||||
|
@ApiModelProperty(value = "periodStart", name = "periodStart", dataType = "Date", example = "2022-01-01T13:19:42.210Z")
|
||||||
private Date periodStart;
|
private Date periodStart;
|
||||||
|
@ApiModelProperty(value = "periodEnd", name = "periodEnd", dataType = "Date", example = "2022-12-31T13:19:42.210Z")
|
||||||
private Date periodEnd;
|
private Date periodEnd;
|
||||||
|
@ApiModelProperty(value = "grants", name = "grants", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> grants;
|
private List<UUID> grants;
|
||||||
|
@ApiModelProperty(value = "collaborators", name = "collaborators", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> collaborators;
|
private List<UUID> collaborators;
|
||||||
|
@ApiModelProperty(value = "datasetTemplates", name = "datasetTemplates", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> datasetTemplates;
|
private List<UUID> datasetTemplates;
|
||||||
|
@ApiModelProperty(value = "dmpOrganisations", name = "dmpOrganisations", dataType = "List<String>", example = "[]")
|
||||||
private List<String> dmpOrganisations;
|
private List<String> dmpOrganisations;
|
||||||
|
@ApiModelProperty(value = "tags", name = "tags", dataType = "List<Tag>", example = "[]")
|
||||||
private List<Tag> tags;
|
private List<Tag> tags;
|
||||||
|
@ApiModelProperty(value = "dmpIds", name = "dmpIds", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> dmpIds;
|
private List<UUID> dmpIds;
|
||||||
|
@ApiModelProperty(value = "groupIds", name = "groupIds", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> groupIds;
|
private List<UUID> groupIds;
|
||||||
|
@ApiModelProperty(value = "allVersions", name = "allVersions", dataType = "Boolean", example = "false")
|
||||||
private boolean allVersions;
|
private boolean allVersions;
|
||||||
|
|
||||||
public Date getPeriodStart() {
|
public Date getPeriodStart() {
|
||||||
|
|
|
@ -2,20 +2,30 @@ package eu.eudat.publicapi.criteria.dmp;
|
||||||
|
|
||||||
import eu.eudat.data.dao.criteria.Criteria;
|
import eu.eudat.data.dao.criteria.Criteria;
|
||||||
import eu.eudat.data.entities.DMP;
|
import eu.eudat.data.entities.DMP;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class DataManagementPlanPublicCriteria extends Criteria<DMP> {
|
public class DataManagementPlanPublicCriteria extends Criteria<DMP> {
|
||||||
|
@ApiModelProperty(value = "periodStart", name = "periodStart", dataType = "Date", example = "2022-01-01T13:19:42.210Z")
|
||||||
private Date periodStart;
|
private Date periodStart;
|
||||||
|
@ApiModelProperty(value = "periodEnd", name = "periodEnd", dataType = "Date", example = "2022-12-31T13:19:42.210Z")
|
||||||
private Date periodEnd;
|
private Date periodEnd;
|
||||||
|
@ApiModelProperty(value = "grants", name = "grants", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> grants;
|
private List<UUID> grants;
|
||||||
|
@ApiModelProperty(value = "funders", name = "funders", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> funders;
|
private List<UUID> funders;
|
||||||
|
@ApiModelProperty(value = "datasetTemplates", name = "datasetTemplates", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> datasetTemplates;
|
private List<UUID> datasetTemplates;
|
||||||
|
@ApiModelProperty(value = "dmpOrganisations", name = "dmpOrganisations", dataType = "List<String>", example = "[]")
|
||||||
private List<String> dmpOrganisations;
|
private List<String> dmpOrganisations;
|
||||||
|
@ApiModelProperty(value = "collaborators", name = "collaborators", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> collaborators;
|
private List<UUID> collaborators;
|
||||||
|
@ApiModelProperty(value = "allVersions", name = "allVersions", dataType = "Boolean", example = "false")
|
||||||
private boolean allVersions;
|
private boolean allVersions;
|
||||||
|
@ApiModelProperty(value = "groupIds", name = "groupIds", dataType = "List<UUID>", example = "[]")
|
||||||
private List<UUID> groupIds;
|
private List<UUID> groupIds;
|
||||||
|
|
||||||
public Date getPeriodStart() {
|
public Date getPeriodStart() {
|
||||||
|
|
Loading…
Reference in New Issue