Search in sources :

Example 1 with Pagination

use of io.lumeer.api.model.Pagination in project engine by Lumeer.

the class ViewService method getViews.

@GET
public List<JsonView> getViews(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize) {
    Pagination pagination = new Pagination(page, pageSize);
    List<View> views = viewFacade.getViews(pagination);
    return JsonView.convert(views);
}
Also used : Pagination(io.lumeer.api.model.Pagination) JsonView(io.lumeer.api.dto.JsonView) View(io.lumeer.api.model.View) GET(javax.ws.rs.GET)

Example 2 with Pagination

use of io.lumeer.api.model.Pagination in project engine by Lumeer.

the class CollectionService method getCollections.

@GET
public List<JsonCollection> getCollections(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize) {
    Pagination pagination = new Pagination(page, pageSize);
    List<Collection> collections = collectionFacade.getCollections(pagination);
    return JsonCollection.convert(collections);
}
Also used : Pagination(io.lumeer.api.model.Pagination) JsonCollection(io.lumeer.api.dto.JsonCollection) Collection(io.lumeer.api.model.Collection) GET(javax.ws.rs.GET)

Example 3 with Pagination

use of io.lumeer.api.model.Pagination in project engine by Lumeer.

the class DocumentService method getDocuments.

@GET
public List<JsonDocument> getDocuments(@QueryParam("page") Integer page, @QueryParam("pageSize") Integer pageSize) {
    Pagination pagination = new Pagination(page, pageSize);
    List<Document> documents = documentFacade.getDocuments(collectionId, pagination);
    return JsonDocument.convert(documents);
}
Also used : Pagination(io.lumeer.api.model.Pagination) DataDocument(io.lumeer.engine.api.data.DataDocument) JsonDocument(io.lumeer.api.dto.JsonDocument) Document(io.lumeer.api.model.Document) GET(javax.ws.rs.GET)

Example 4 with Pagination

use of io.lumeer.api.model.Pagination in project engine by Lumeer.

the class DocumentFacadeIT method testGetDocuments.

@Test
public void testGetDocuments() {
    String id1 = createDocument().getId();
    String id2 = createDocument().getId();
    Pagination pagination = new Pagination(null, null);
    List<Document> documents = documentFacade.getDocuments(collection.getId(), pagination);
    assertThat(documents).extracting(Document::getId).containsOnly(id1, id2);
}
Also used : Pagination(io.lumeer.api.model.Pagination) DataDocument(io.lumeer.engine.api.data.DataDocument) JsonDocument(io.lumeer.api.dto.JsonDocument) Document(io.lumeer.api.model.Document) Test(org.junit.Test)

Aggregations

Pagination (io.lumeer.api.model.Pagination)4 GET (javax.ws.rs.GET)3 JsonDocument (io.lumeer.api.dto.JsonDocument)2 Document (io.lumeer.api.model.Document)2 DataDocument (io.lumeer.engine.api.data.DataDocument)2 JsonCollection (io.lumeer.api.dto.JsonCollection)1 JsonView (io.lumeer.api.dto.JsonView)1 Collection (io.lumeer.api.model.Collection)1 View (io.lumeer.api.model.View)1 Test (org.junit.Test)1