add api drp list rekomendasi
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.iconplus.smartproc.controller;
|
||||
|
||||
import com.iconplus.smartproc.model.request.PrintDrpRequest;
|
||||
import com.iconplus.smartproc.model.request.RolesRequest;
|
||||
import com.iconplus.smartproc.model.response.GetListPrintDrpResponse;
|
||||
import com.iconplus.smartproc.service.print.GetListPrintDrpService;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@CrossOrigin(origins = "${fe.server}", allowCredentials = "true")
|
||||
@RestController
|
||||
@RequestMapping("/api/drp/cetak")
|
||||
public class PrintController {
|
||||
|
||||
private final GetListPrintDrpService getListPrintDrpService;
|
||||
|
||||
public PrintController(GetListPrintDrpService getListPrintDrpService) {
|
||||
this.getListPrintDrpService = getListPrintDrpService;
|
||||
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public GetListPrintDrpResponse getListPrintDrpResponse(@RequestParam(name = "page", defaultValue = "1") Integer page,
|
||||
@RequestParam(name = "size", defaultValue = "5") Integer size) {
|
||||
|
||||
Pageable pageable = PageRequest.of((page - 1), size);
|
||||
PrintDrpRequest printDrpRequest = PrintDrpRequest.builder()
|
||||
.pageable(pageable)
|
||||
.build();
|
||||
|
||||
return getListPrintDrpService.execute(printDrpRequest);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user