use of org.example.app3.model.Thing in project bgg-api by tnaskali.
the class ThingsService method getPagedComments.
public Mono<Page<Comment>> getPagedComments(Integer id, PagingParams pagingParams) {
PagingHelper helper = new PagingHelper(pagingParams.getSize(), pagingParams.getPage(), BGG_THING_COMMENTS_PAGE_SIZE);
BggThingsQueryParams firstPageQueryParams = new BggThingsQueryParams();
firstPageQueryParams.setId(id.toString());
firstPageQueryParams.setComments(1);
firstPageQueryParams.setPage(helper.getBggStartPage());
firstPageQueryParams.setPagesize(BGG_THING_COMMENTS_PAGE_SIZE);
return getThing(firstPageQueryParams).flatMap(thing -> helper.getBggPagesRange(thing.getNumcomments()).flatMapSequential(page -> {
BggThingsQueryParams queryParams = new BggThingsQueryParams();
queryParams.setId(id.toString());
queryParams.setComments(1);
queryParams.setPage(page);
queryParams.setPagesize(BGG_THING_COMMENTS_PAGE_SIZE);
return getThing(queryParams);
}).flatMapIterable(Thing::getComments).collect(Collectors.toList()).map(list -> helper.buildPage(list, thing.getNumcomments())));
}
use of org.example.app3.model.Thing in project bgg-api by tnaskali.
the class ThingsService method getPagedRatings.
public Mono<Page<Comment>> getPagedRatings(Integer id, PagingParams pagingParams) {
PagingHelper helper = new PagingHelper(pagingParams.getSize(), pagingParams.getPage(), BGG_THING_COMMENTS_PAGE_SIZE);
BggThingsQueryParams firstPageQueryParams = new BggThingsQueryParams();
firstPageQueryParams.setId(id.toString());
firstPageQueryParams.setRatingcomments(1);
firstPageQueryParams.setPage(helper.getBggStartPage());
firstPageQueryParams.setPagesize(BGG_THING_COMMENTS_PAGE_SIZE);
return getThing(firstPageQueryParams).flatMap(thing -> helper.getBggPagesRange(thing.getNumcomments()).flatMapSequential(page -> {
BggThingsQueryParams queryParams = new BggThingsQueryParams();
queryParams.setId(id.toString());
queryParams.setRatingcomments(1);
queryParams.setPage(page);
queryParams.setPagesize(BGG_THING_COMMENTS_PAGE_SIZE);
return getThing(queryParams);
}).flatMapIterable(Thing::getComments).collect(Collectors.toList()).map(list -> helper.buildPage(list, thing.getNumcomments())));
}
use of org.example.app3.model.Thing in project bgg-api by tnaskali.
the class ThingsService method getVersions.
public Mono<List<Version>> getVersions(Integer id) {
BggThingsQueryParams queryParams = new BggThingsQueryParams();
queryParams.setId(id.toString());
queryParams.setVersions(1);
return getThing(queryParams).map(Thing::getVersions);
}
use of org.example.app3.model.Thing in project bgg-api by tnaskali.
the class ThingsService method getVideos.
public Mono<List<Video>> getVideos(Integer id) {
BggThingsQueryParams queryParams = new BggThingsQueryParams();
queryParams.setId(id.toString());
queryParams.setVideos(1);
return getThing(queryParams).map(Thing::getVideos);
}
use of org.example.app3.model.Thing in project bgg-api by tnaskali.
the class ThingsService method getMarketplacelistings.
public Mono<List<MarketplaceListing>> getMarketplacelistings(Integer id) {
BggThingsQueryParams queryParams = new BggThingsQueryParams();
queryParams.setId(id.toString());
queryParams.setMarketplace(1);
return getThing(queryParams).map(Thing::getMarketplacelistings);
}
Aggregations