SHARE
TWEET

Untitled

mgogo4 Oct 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Mój FolderDto
  2. public class FolderDto {
  3.     private int id;
  4.     private String path;
  5.  
  6.     public FolderDto(int id, String path) {
  7.         this.id = id;
  8.         this.path = path;
  9.     }
  10.  
  11.     public int getId() {
  12.         return id;
  13.     }
  14.  
  15.     public String getPath() {
  16.         return path;
  17.     }
  18. }
  19.  
  20. Mój Response
  21. public class FolderDtoListResponse {
  22.     private List<FolderDto> result = new ArrayList<>();
  23.  
  24.     public FolderDtoListResponse(List<FolderDto> result) {
  25.         this.result.addAll(result);
  26.     }
  27.  
  28.     public List<FolderDto> getResult() {
  29.         return result;
  30.     }
  31. }
  32.  
  33. Wykorzystanie w FolderController
  34.  
  35.     @RequestMapping(name = "/", method = GET)
  36.     public List<FolderDto> returnFoldersList() {
  37.         return new FolderDtoListResponse(service.getFoldersList());
  38.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top