Updated put endpoint of application

This commit is contained in:
rajesh
2024-09-16 18:47:51 +05:30
parent b4212ee219
commit 3a02571394
5 changed files with 28 additions and 27 deletions

View File

@@ -37,11 +37,12 @@ public interface ApplicationApi {
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@PutMapping(value = "/form/{formId}",
@PutMapping(value = "/{applicationId}",
produces = { "application/json" })
ResponseEntity<Response<ApplicationResponseBean>> createApplication(HttpServletRequest request,
@Parameter(description = " Flow request object", required = true) @Valid @RequestBody ApplicationRequestBean applicationRequestBean,
@Parameter(description = "The form ID", required = true) @PathVariable("formId") Long formId);
@Parameter(description = "The application id", required = true) @PathVariable(value = "applicationId", required = true) Long applicationId,
@Parameter(description = "The form ID", required = true) @RequestParam("formId") Long formId);
@Operation(summary = "Api to get an application by id",
responses = {

View File

@@ -36,8 +36,8 @@ public class ApplicationApiController implements ApplicationApi {
private ApplicationService applicationService;
@Override
public ResponseEntity<Response<ApplicationResponseBean>> createApplication(HttpServletRequest request, ApplicationRequestBean applicationRequestBean, Long formId) {
ApplicationResponseBean applicationResponseBean= applicationService.createApplication(request,applicationRequestBean,formId);
public ResponseEntity<Response<ApplicationResponseBean>> createApplication(HttpServletRequest request, ApplicationRequestBean applicationRequestBean,Long applicationId, Long formId) {
ApplicationResponseBean applicationResponseBean= applicationService.createApplication(request,applicationRequestBean,applicationId,formId);
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(applicationResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.APPLICATION_CREATED_SUCCESS_MSG))); }