Commit 8038a9bf authored by Matija Obreza's avatar Matija Obreza

Merge branch 'ui-7-subsets-public-pages' into 'master'

Ui 7 subsets public pages

See merge request genesys-pgr/genesys-server!158
parents 955dbf76 cd98608b
...@@ -137,7 +137,7 @@ public class ApiExceptionHandler { ...@@ -137,7 +137,7 @@ public class ApiExceptionHandler {
* @return the api error * @return the api error
*/ */
@ResponseStatus(code = HttpStatus.NOT_FOUND) @ResponseStatus(code = HttpStatus.NOT_FOUND)
@ExceptionHandler(NotFoundElement.class) @ExceptionHandler(value = { NotFoundElement.class, org.genesys2.server.exception.NotFoundElement.class })
@ResponseBody @ResponseBody
public ApiError<Exception> handleNotFound(final Exception e, final HttpServletRequest request) { public ApiError<Exception> handleNotFound(final Exception e, final HttpServletRequest request) {
LOG.warn("Element not found {} {}", request.getMethod(), request.getRequestURL(), e); LOG.warn("Element not found {} {}", request.getMethod(), request.getRequestURL(), e);
......
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
*/ */
package org.genesys.catalog.api.v0; package org.genesys.catalog.api.v0;
import org.apache.commons.lang3.StringUtils; import java.io.IOException;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import org.genesys.catalog.api.FilteredPage; import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.exceptions.NotFoundElement; import org.genesys.catalog.exceptions.NotFoundElement;
import org.genesys.catalog.model.dataset.AccessionIdentifier; import org.genesys.catalog.model.dataset.AccessionIdentifier;
...@@ -32,15 +36,18 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -32,15 +36,18 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import java.io.IOException;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
/** /**
* The Class DatasetController. * The Class DatasetController.
* *
...@@ -70,6 +77,34 @@ public class DatasetController { ...@@ -70,6 +77,34 @@ public class DatasetController {
@Autowired @Autowired
protected DescriptorService descriptorService; protected DescriptorService descriptorService;
/**
* My datasets.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filterCode short filter code -- overrides filter in body
* @param filter the filter
* @return the page
* @throws IOException
*/
@PostMapping(value = "/list-mine")
public FilteredPage<Dataset> myDatasets(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "DESC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "lastModifiedDate") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DatasetFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, datasetService.listDatasetsForCurrentUser(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/** /**
* List datasets. * List datasets.
* *
...@@ -86,9 +121,9 @@ public class DatasetController { ...@@ -86,9 +121,9 @@ public class DatasetController {
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction, @RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode, @RequestParam(name = "f", required = false) String filterCode,
@RequestBody DatasetFilter filter) throws IOException { @RequestBody(required = false) DatasetFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) { if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class); filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class);
} else { } else {
filterCode = shortFilterService.getCode(filter); filterCode = shortFilterService.getCode(filter);
......
...@@ -19,7 +19,6 @@ import java.io.IOException; ...@@ -19,7 +19,6 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.genesys.blocks.model.JsonViews; import org.genesys.blocks.model.JsonViews;
import org.genesys.catalog.api.FilteredPage; import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.model.dataset.Dataset; import org.genesys.catalog.model.dataset.Dataset;
...@@ -78,6 +77,33 @@ public class DescriptorController { ...@@ -78,6 +77,33 @@ public class DescriptorController {
return Descriptor.Category.values(); return Descriptor.Category.values();
} }
/**
* My descriptors.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param filter the descriptor filter
* @return the page
* @throws IOException
*/
@PostMapping(value = "/list-mine")
public FilteredPage<Descriptor> myDescriptors(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "DESC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "lastModifiedDate") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DescriptorFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, descriptorService.listDescriptorsForCurrentUser(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/** /**
* List descriptors. * List descriptors.
* *
...@@ -95,9 +121,9 @@ public class DescriptorController { ...@@ -95,9 +121,9 @@ public class DescriptorController {
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction, @RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode, @RequestParam(name = "f", required = false) String filterCode,
@RequestBody DescriptorFilter filter) throws IOException { @RequestBody(required = false) DescriptorFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) { if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorFilter.class); filter = shortFilterService.filterByCode(filterCode, DescriptorFilter.class);
} else { } else {
filterCode = shortFilterService.getCode(filter); filterCode = shortFilterService.getCode(filter);
......
...@@ -15,7 +15,14 @@ ...@@ -15,7 +15,14 @@
*/ */
package org.genesys.catalog.api.v0; package org.genesys.catalog.api.v0;
import org.apache.commons.lang3.StringUtils; import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.genesys.blocks.model.JsonViews; import org.genesys.blocks.model.JsonViews;
import org.genesys.catalog.api.FilteredPage; import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.model.filters.DescriptorListFilter; import org.genesys.catalog.model.filters.DescriptorListFilter;
...@@ -33,19 +40,20 @@ import org.springframework.http.HttpHeaders; ...@@ -33,19 +40,20 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
/** /**
* The Class DescriptorListController. * The Class DescriptorListController.
* *
...@@ -165,6 +173,33 @@ public class DescriptorListController { ...@@ -165,6 +173,33 @@ public class DescriptorListController {
return descriptorList; return descriptorList;
} }
/**
* My descriptor lists.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param descriptorListFilter the descriptor list filter
* @return the page
* @throws IOException
*/
@PostMapping(value = "/list-mine")
public FilteredPage<DescriptorList> myDescriptorLists(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "DESC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "lastModifiedDate") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DescriptorListFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, descriptorListService.listDescriptorListsForCurrentUser(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
}
/** /**
* List descriptor lists. * List descriptor lists.
* *
...@@ -182,9 +217,9 @@ public class DescriptorListController { ...@@ -182,9 +217,9 @@ public class DescriptorListController {
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction, @RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode, @RequestParam(name = "f", required = false) String filterCode,
@RequestBody DescriptorListFilter filter) throws IOException { @RequestBody(required = false) DescriptorListFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) { if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class); filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
} else { } else {
filterCode = shortFilterService.getCode(filter); filterCode = shortFilterService.getCode(filter);
......
...@@ -18,7 +18,6 @@ package org.genesys.catalog.api.v0; ...@@ -18,7 +18,6 @@ package org.genesys.catalog.api.v0;
import java.io.IOException; import java.io.IOException;
import java.util.UUID; import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.genesys.blocks.security.SecurityContextUtil; import org.genesys.blocks.security.SecurityContextUtil;
import org.genesys.blocks.security.UserException; import org.genesys.blocks.security.UserException;
import org.genesys.blocks.security.lockout.AccountLockoutManager; import org.genesys.blocks.security.lockout.AccountLockoutManager;
...@@ -159,6 +158,7 @@ public class MeController { ...@@ -159,6 +158,7 @@ public class MeController {
* @param sort the sort * @param sort the sort
* @param partnerFilter the partner filter * @param partnerFilter the partner filter
* @return the page * @return the page
* @deprecated Moved to PartnerController
*/ */
@PostMapping(value = "/partners") @PostMapping(value = "/partners")
public Page<Partner> myPartners(@RequestParam(name = "p", required = false, defaultValue = "0") final int page, public Page<Partner> myPartners(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
...@@ -180,6 +180,7 @@ public class MeController { ...@@ -180,6 +180,7 @@ public class MeController {
* @param filter the filter * @param filter the filter
* @return the page * @return the page
* @throws IOException * @throws IOException
* @deprecated Moved to DatasetController
*/ */
@PostMapping(value = "/datasets") @PostMapping(value = "/datasets")
public FilteredPage<Dataset> myDatasets(@RequestParam(name = "p", required = false, defaultValue = "0") final int page, public FilteredPage<Dataset> myDatasets(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
...@@ -189,7 +190,7 @@ public class MeController { ...@@ -189,7 +190,7 @@ public class MeController {
@RequestParam(name = "f", required = false) String filterCode, @RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DatasetFilter filter) throws IOException { @RequestBody(required = false) DatasetFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) { if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class); filter = shortFilterService.filterByCode(filterCode, DatasetFilter.class);
} else { } else {
filterCode = shortFilterService.getCode(filter); filterCode = shortFilterService.getCode(filter);
...@@ -207,6 +208,7 @@ public class MeController { ...@@ -207,6 +208,7 @@ public class MeController {
* @param filter the descriptor filter * @param filter the descriptor filter
* @return the page * @return the page
* @throws IOException * @throws IOException
* @deprecated Moved to DescriptorController
*/ */
@PostMapping(value = "/descriptors") @PostMapping(value = "/descriptors")
public FilteredPage<Descriptor> myDescriptors(@RequestParam(name = "p", required = false, defaultValue = "0") final int page, public FilteredPage<Descriptor> myDescriptors(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
...@@ -216,7 +218,7 @@ public class MeController { ...@@ -216,7 +218,7 @@ public class MeController {
@RequestParam(name = "f", required = false) String filterCode, @RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DescriptorFilter filter) throws IOException { @RequestBody(required = false) DescriptorFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) { if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorFilter.class); filter = shortFilterService.filterByCode(filterCode, DescriptorFilter.class);
} else { } else {
filterCode = shortFilterService.getCode(filter); filterCode = shortFilterService.getCode(filter);
...@@ -234,6 +236,7 @@ public class MeController { ...@@ -234,6 +236,7 @@ public class MeController {
* @param descriptorListFilter the descriptor list filter * @param descriptorListFilter the descriptor list filter
* @return the page * @return the page
* @throws IOException * @throws IOException
* @deprecated Moved to DescriptorListController
*/ */
@PostMapping(value = "/descriptorlists") @PostMapping(value = "/descriptorlists")
public FilteredPage<DescriptorList> myDescriptorLists(@RequestParam(name = "p", required = false, defaultValue = "0") final int page, public FilteredPage<DescriptorList> myDescriptorLists(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
...@@ -243,7 +246,7 @@ public class MeController { ...@@ -243,7 +246,7 @@ public class MeController {
@RequestParam(name = "f", required = false) String filterCode, @RequestParam(name = "f", required = false) String filterCode,
@RequestBody(required = false) DescriptorListFilter filter) throws IOException { @RequestBody(required = false) DescriptorListFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) { if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class); filter = shortFilterService.filterByCode(filterCode, DescriptorListFilter.class);
} else { } else {
filterCode = shortFilterService.getCode(filter); filterCode = shortFilterService.getCode(filter);
......
...@@ -18,7 +18,6 @@ package org.genesys.catalog.api.v0; ...@@ -18,7 +18,6 @@ package org.genesys.catalog.api.v0;
import java.io.IOException; import java.io.IOException;
import java.util.UUID; import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
import org.genesys.catalog.api.FilteredPage; import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.model.Partner; import org.genesys.catalog.model.Partner;
import org.genesys.catalog.model.filters.PartnerFilter; import org.genesys.catalog.model.filters.PartnerFilter;
...@@ -26,6 +25,7 @@ import org.genesys.catalog.service.PartnerService; ...@@ -26,6 +25,7 @@ import org.genesys.catalog.service.PartnerService;
import org.genesys.catalog.service.ShortFilterService; import org.genesys.catalog.service.ShortFilterService;
import org.genesys2.server.api.ApiBaseController; import org.genesys2.server.api.ApiBaseController;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
...@@ -60,6 +60,26 @@ public class PartnerController { ...@@ -60,6 +60,26 @@ public class PartnerController {
@Autowired @Autowired
protected ShortFilterService shortFilterService; protected ShortFilterService shortFilterService;
/**
* My partners.
*
* @param page the page
* @param pageSize the page size
* @param direction the direction
* @param sort the sort
* @param partnerFilter the partner filter
* @return the page
*/
@PostMapping(value = "/list-mine")
public Page<Partner> myPartners(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "name") final String[] sort, @RequestBody final PartnerFilter partnerFilter) {
return partnerService.listPartnersForCurrentUser(partnerFilter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort));
}
/** /**
* List partners. * List partners.
* *
...@@ -77,9 +97,9 @@ public class PartnerController { ...@@ -77,9 +97,9 @@ public class PartnerController {
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction, @RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode, @RequestParam(name = "f", required = false) String filterCode,
@RequestBody PartnerFilter filter) throws IOException { @RequestBody(required = false) PartnerFilter filter) throws IOException {
if (StringUtils.isNotBlank(filterCode)) { if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, PartnerFilter.class); filter = shortFilterService.filterByCode(filterCode, PartnerFilter.class);
} else { } else {
filterCode = shortFilterService.getCode(filter); filterCode = shortFilterService.getCode(filter);
......
...@@ -163,14 +163,22 @@ public class VocabularyController { ...@@ -163,14 +163,22 @@ public class VocabularyController {
* @param sort the sort * @param sort the sort
* @param filter the controlled vocabulary filter * @param filter the controlled vocabulary filter
* @return the page * @return the page
* @throws IOException
*/ */
@PostMapping(value = "/list") @PostMapping(value = "/list")
public FilteredPage<ControlledVocabulary> list(@RequestParam(name = "p", required = false, defaultValue = "0") final int page, public FilteredPage<ControlledVocabulary> list(@RequestParam(name = "p", required = false, defaultValue = "0") final int page,
@RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize, @RequestParam(name = "l", required = false, defaultValue = "50") final int pageSize,
@RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction, @RequestParam(name = "d", required = false, defaultValue = "ASC") final Sort.Direction direction,
@RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort, @RequestBody final ControlledVocabularyFilter filter) { @RequestParam(name = "s", required = false, defaultValue = "id") final String[] sort,
@RequestParam(name = "f", required = false) String filterCode,
return new FilteredPage<>(shortFilterService.getCode(filter), filter, vocabularyService.listVocabularies(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort))); @RequestBody(required = false) ControlledVocabularyFilter filter) throws IOException {
if (filterCode != null) {
filter = shortFilterService.filterByCode(filterCode, ControlledVocabularyFilter.class);
} else {
filterCode = shortFilterService.getCode(filter);
}
return new FilteredPage<>(filterCode, filter, vocabularyService.listVocabularies(filter, new PageRequest(page, Integer.min(pageSize, 100), direction, sort)));
} }
/** /**
......
...@@ -21,6 +21,7 @@ package org.genesys.catalog.exceptions; ...@@ -21,6 +21,7 @@ package org.genesys.catalog.exceptions;
* *
* @author Andrey Lugovskoy. * @author Andrey Lugovskoy.
*/ */
// TODO Replace with org.genesys2.server.api.NotFoundElement
public class NotFoundElement extends InvalidApiUsageException { public class NotFoundElement extends InvalidApiUsageException {
private static final long serialVersionUID = 6621976491018091330L; private static final long serialVersionUID = 6621976491018091330L;
......
...@@ -16,14 +16,16 @@ ...@@ -16,14 +16,16 @@
package org.genesys2.server.api.v1; package org.genesys2.server.api.v1;
import java.io.IOException;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import org.genesys.catalog.api.FilteredPage;
import org.genesys.catalog.service.ShortFilterService;
import org.genesys2.server.model.impl.Subset; import org.genesys2.server.model.impl.Subset;
import org.genesys2.server.service.SubsetService; import org.genesys2.server.service.SubsetService;
import org.genesys2.server.service.filter.SubsetFilter; import org.genesys2.server.service.filter.SubsetFilter;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -40,15 +42,15 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -40,15 +42,15 @@ import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
/** /**
* The Class SubsetRestController. * The Class SubsetController.
* *
* @author Maxym Borodenko * @author Maxym Borodenko
*/ */
@RestController("subsetApi1") @RestController("subsetApi1")
@PreAuthorize("isAuthenticated()") @PreAuthorize("isAuthenticated()")
@RequestMapping(SubsetRestController.API_BASE)