use of li.naska.bgg.resource.v3.model.Forum in project bgg-api by tnaskali.
the class ForumsService method getFamilyForums.
public Mono<List<Forum>> getFamilyForums(Integer id) {
ForumsParams parameters = new ForumsParams();
parameters.setId(id);
parameters.setType(ItemType.family);
return getForums(parameters);
}
use of li.naska.bgg.resource.v3.model.Forum in project bgg-api by tnaskali.
the class ForumsService method getPagedThreads.
public Mono<Page<Thread>> getPagedThreads(Integer id, PagingParams pagingParams) {
PagingHelper helper = new PagingHelper(pagingParams.getSize(), pagingParams.getPage(), BGG_FORUM_THREADS_PAGE_SIZE);
BggForumQueryParams firstPageQueryParams = new BggForumQueryParams();
firstPageQueryParams.setId(id);
firstPageQueryParams.setPage(helper.getBggStartPage());
return getForum(firstPageQueryParams).flatMap(forum -> helper.getBggPagesRange(forum.getNumthreads()).flatMapSequential(page -> {
if (page == helper.getBggStartPage()) {
return Mono.just(forum);
}
BggForumQueryParams queryParams = new BggForumQueryParams();
queryParams.setId(id);
queryParams.setPage(page);
return getForum(queryParams);
}).flatMapIterable(Forum::getThreads).collect(Collectors.toList()).map(list -> helper.buildPage(list, forum.getNumthreads())));
}
use of li.naska.bgg.resource.v3.model.Forum in project bgg-api by tnaskali.
the class ForumsService method getThingForums.
public Mono<List<Forum>> getThingForums(Integer id) {
ForumsParams parameters = new ForumsParams();
parameters.setId(id);
parameters.setType(ItemType.thing);
return getForums(parameters);
}
Aggregations