api/src/main/java/com/epam/pipeline/manager/issue/IssueManager.java
public PagedResult<List<Issue>> loadMy(Long page, Integer pageSize) {
        String currentUser = authManager.getAuthorizedUser();

        List<Issue> issues = issueDao.loadIssuesByAuthor(currentUser, page, pageSize);
        Map<Long, List<IssueComment>> commentsMap = commentDao.loadCommentsForIssues(
            issues.stream()
                .map(Issue::getId)
                .collect(Collectors.toList())
        );
        issues.forEach(i -> i.setComments(commentsMap.get(i.getId())));

        return new PagedResult<>(issues, issueDao.countIssuesByAuthor(currentUser));
    }
/**
     * Loads Issues with nested comments for current user.
     * @param page page number to load
     * @param pageSize number of issues per page
     * @return a {@link PagedResult} of list of Issues
     */
Loads Issues with nested comments for current user.
@param page page number to load
@param pageSize number of issues per page
@return a  PagedResult of list of Issues
Loads Issues with nested comments for current user . @param page page number to load @param pageSize number of issues per page @return a PagedResult of list of Issues
public PagedResult<List<Issue>> loadMy(Long page, Integer pageSize) {
        String currentUser = authManager.getAuthorizedUser();
        List<Issue> issues = issueDao.loadIssuesByAuthor(currentUser, page, pageSize);
        Map<Long, List<IssueComment>> commentsMap = commentDao.loadCommentsForIssues(
            issues.stream()
                .map(Issue::getId)
                .collect(Collectors.toList())
        );
        issues.forEach(i -> i.setComments(commentsMap.get(i.getId())));
        return new PagedResult<>(issues, issueDao.countIssuesByAuthor(currentUser));
    }
public PagedResult < List < Issue > > loadMy ( Long page , Integer pageSize ) { String currentUser = authManager . getAuthorizedUser ( ) ; List < Issue > issues = issueDao . loadIssuesByAuthor ( currentUser , page , pageSize ) ; Map < Long , List < IssueComment > > commentsMap = commentDao . loadCommentsForIssues ( issues . stream ( ) . map ( Issue :: getId ) . collect ( Collectors . toList ( ) ) ) ; issues . forEach ( i -> i . setComments ( commentsMap . get ( i . getId ( ) ) ) ) ; return new PagedResult < > ( issues , issueDao . countIssuesByAuthor ( currentUser ) ) ; }
Loads Issues with nested comments for current user.
Loads Issues with nested comments for current user .