add api drp list rekomendasi

This commit is contained in:
dirgantarasiahaan
2023-06-02 18:21:29 +07:00
parent d2015e6695
commit f1f071b512
17 changed files with 376 additions and 12 deletions

View File

@@ -5,10 +5,7 @@ import com.iconplus.smartproc.helper.model.EmptyResponse;
import com.iconplus.smartproc.model.request.DrpApprovalRequest;
import com.iconplus.smartproc.model.request.DrpRekomendasiRequest;
import com.iconplus.smartproc.model.request.ListDrpApprovalRequest;
import com.iconplus.smartproc.model.response.DrpApprovalResponse;
import com.iconplus.smartproc.model.response.DrpRekomendasiResponse;
import com.iconplus.smartproc.model.response.GetListDrpApprovalResponse;
import com.iconplus.smartproc.model.response.GetListUserApprovalResponse;
import com.iconplus.smartproc.model.response.*;
import com.iconplus.smartproc.service.approval.*;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@@ -26,13 +23,15 @@ public class ApprovalDrpController {
private PostDrpRekomendasiService postDrpRekomendasiService;
private PostDrpApprovalExecutionService postDrpApprovalExecutionService;
private GetApprovalService getApprovalService;
private GetListRekomendasiService getListRekomendasiService;
public ApprovalDrpController(GetListUserVpService getListUserVpService,
GetListUserDirekturKomiteService getListUserDirekturKomiteService,
PostCreateDrpApprovalService postCreateDrpApprovalService,
GetListApprovalDrpServie getListApprovalDrpServie,
PostDrpRekomendasiService postDrpRekomendasiService,
PostDrpApprovalExecutionService postDrpApprovalExecutionService,
GetApprovalService getApprovalService) {
GetApprovalService getApprovalService,
GetListRekomendasiService getListRekomendasiService) {
this.getListUserVpService = getListUserVpService;
this.getListUserDirekturKomiteService = getListUserDirekturKomiteService;
this.postCreateDrpApprovalService = postCreateDrpApprovalService;
@@ -40,6 +39,7 @@ public class ApprovalDrpController {
this.postDrpRekomendasiService = postDrpRekomendasiService;
this.postDrpApprovalExecutionService = postDrpApprovalExecutionService;
this.getApprovalService = getApprovalService;
this.getListRekomendasiService = getListRekomendasiService;
}
@GetMapping("/vp")
@@ -87,4 +87,18 @@ public class ApprovalDrpController {
.jenisPengadaanId(id)
.build());
}
@GetMapping("/rekomendasi/jenis-pengadaan/{id}")
public GetListDrpRekomendasiResponse getListRekomendasi(@PathVariable(name = "id") Long id,
@RequestParam(name = "page", defaultValue = "1") Integer page,
@RequestParam(name = "size", defaultValue = "5") Integer size) {
Pageable pageable = PageRequest.of((page - 1), size);
DrpRekomendasiRequest drpRekomendasiRequest = DrpRekomendasiRequest.builder()
.jenisPengadaanId(id)
.pageable(pageable)
.build();
return getListRekomendasiService.execute(drpRekomendasiRequest);
}
}