Search in sources :

Example 1 with WorkspaceListResponse

use of org.pmiops.workbench.model.WorkspaceListResponse in project workbench by all-of-us.

the class WorkspacesController method getWorkspacesForReview.

// Note we do not paginate the workspaces list, since we expect few workspaces
// to require review.
// 
// We can add pagination in the DAO by returning Slice<Workspace> if we want the method to return
// pagination information (e.g. are there more workspaces to get), and Page<Workspace> if we
// want the method to return both pagination information and a total count.
@Override
@AuthorityRequired({ Authority.REVIEW_RESEARCH_PURPOSE })
public ResponseEntity<WorkspaceListResponse> getWorkspacesForReview() {
    WorkspaceListResponse response = new WorkspaceListResponse();
    List<org.pmiops.workbench.db.model.Workspace> workspaces = workspaceService.findForReview();
    response.setItems(workspaces.stream().map(TO_CLIENT_WORKSPACE).collect(Collectors.toList()));
    return ResponseEntity.ok(response);
}
Also used : WorkspaceListResponse(org.pmiops.workbench.model.WorkspaceListResponse) Workspace(org.pmiops.workbench.model.Workspace) AuthorityRequired(org.pmiops.workbench.annotations.AuthorityRequired)

Aggregations

AuthorityRequired (org.pmiops.workbench.annotations.AuthorityRequired)1 Workspace (org.pmiops.workbench.model.Workspace)1 WorkspaceListResponse (org.pmiops.workbench.model.WorkspaceListResponse)1