Search in sources :

Example 1 with ThreadMapper

use of li.naska.bgg.mapper.ThreadMapper in project bgg-api by tnaskali.

the class ForumsService method getThread.

public Mono<Thread> getThread(Integer id, ThreadParams params) {
    BggThreadQueryParams queryParams = threadParamsMapper.toBggModel(params);
    queryParams.setId(id);
    return threadsRepository.getThread(queryParams).map(xml -> xmlProcessor.toJavaObject(xml, com.boardgamegeek.thread.Thread.class)).map(threadMapper::fromBggModel);
}
Also used : BggForumListsRepository(li.naska.bgg.repository.BggForumListsRepository) BggThreadsRepository(li.naska.bgg.repository.BggThreadsRepository) Thread(li.naska.bgg.resource.v3.model.Thread) BggForumsRepository(li.naska.bgg.repository.BggForumsRepository) BggForumsQueryParams(li.naska.bgg.repository.model.BggForumsQueryParams) ThreadParamsMapper(li.naska.bgg.mapper.ThreadParamsMapper) PagingHelper(li.naska.bgg.util.PagingHelper) Autowired(org.springframework.beans.factory.annotation.Autowired) Page(li.naska.bgg.util.Page) ThreadMapper(li.naska.bgg.mapper.ThreadMapper) Service(org.springframework.stereotype.Service) ForumMapper(li.naska.bgg.mapper.ForumMapper) BggThreadQueryParams(li.naska.bgg.repository.model.BggThreadQueryParams) ForumsParams(li.naska.bgg.resource.v3.model.ForumsParams) XmlProcessor(li.naska.bgg.util.XmlProcessor) ThreadParams(li.naska.bgg.resource.v3.model.ThreadParams) ItemType(com.boardgamegeek.enums.ItemType) BggForumQueryParams(li.naska.bgg.repository.model.BggForumQueryParams) Mono(reactor.core.publisher.Mono) Collectors(java.util.stream.Collectors) PagingParams(li.naska.bgg.util.PagingParams) Forum(li.naska.bgg.resource.v3.model.Forum) Flux(reactor.core.publisher.Flux) List(java.util.List) Forums(com.boardgamegeek.forumlist.Forums) ForumListsParamsMapper(li.naska.bgg.mapper.ForumListsParamsMapper) BggThreadQueryParams(li.naska.bgg.repository.model.BggThreadQueryParams)

Aggregations

ItemType (com.boardgamegeek.enums.ItemType)1 Forums (com.boardgamegeek.forumlist.Forums)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 ForumListsParamsMapper (li.naska.bgg.mapper.ForumListsParamsMapper)1 ForumMapper (li.naska.bgg.mapper.ForumMapper)1 ThreadMapper (li.naska.bgg.mapper.ThreadMapper)1 ThreadParamsMapper (li.naska.bgg.mapper.ThreadParamsMapper)1 BggForumListsRepository (li.naska.bgg.repository.BggForumListsRepository)1 BggForumsRepository (li.naska.bgg.repository.BggForumsRepository)1 BggThreadsRepository (li.naska.bgg.repository.BggThreadsRepository)1 BggForumQueryParams (li.naska.bgg.repository.model.BggForumQueryParams)1 BggForumsQueryParams (li.naska.bgg.repository.model.BggForumsQueryParams)1 BggThreadQueryParams (li.naska.bgg.repository.model.BggThreadQueryParams)1 Forum (li.naska.bgg.resource.v3.model.Forum)1 ForumsParams (li.naska.bgg.resource.v3.model.ForumsParams)1 Thread (li.naska.bgg.resource.v3.model.Thread)1 ThreadParams (li.naska.bgg.resource.v3.model.ThreadParams)1 Page (li.naska.bgg.util.Page)1 PagingHelper (li.naska.bgg.util.PagingHelper)1