Updated code

This commit is contained in:
Piyush
2025-01-28 19:24:39 +05:30
parent b274cd672b
commit 19d7bf5e26
6 changed files with 73 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ import net.gepafin.tendermanagement.model.request.ApplicationAmendmentRequestBea
import net.gepafin.tendermanagement.model.request.CloseAmendmentRequest;
import net.gepafin.tendermanagement.model.response.ApplicationAmendmentRequestResponse;
import net.gepafin.tendermanagement.model.response.ApplicationResponse;
import net.gepafin.tendermanagement.model.response.GetAllAmendmentResponseBean;
import net.gepafin.tendermanagement.model.util.Response;
import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
import org.springframework.http.MediaType;
@@ -88,8 +89,8 @@ public interface ApplicationAmendmentRequestApi {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@GetMapping(value = "/user", produces = "application/json")
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN') || hasRole('ROLE_INSTRUCTOR_MANAGER')|| hasRole('ROLE_PRE_INSTRUCTOR')")
ResponseEntity<Response<List<ApplicationAmendmentRequestResponse>>> getAllApplicationAmendmentRequest(HttpServletRequest request,
@Parameter(description = "The User ID", required = false) @RequestParam(value = "userId",required = false) Long userId);
ResponseEntity<Response<List<GetAllAmendmentResponseBean>>> getAllApplicationAmendmentRequest(HttpServletRequest request,
@Parameter(description = "The User ID", required = false) @RequestParam(value = "userId",required = false) Long userId);
@Operation(summary = "Api to update application amendment",
responses = {

View File

@@ -12,6 +12,7 @@ import net.gepafin.tendermanagement.model.request.ApplicationAmendmentRequestBea
import net.gepafin.tendermanagement.model.request.CloseAmendmentRequest;
import net.gepafin.tendermanagement.model.request.UserActionRequest;
import net.gepafin.tendermanagement.model.response.ApplicationAmendmentRequestResponse;
import net.gepafin.tendermanagement.model.response.GetAllAmendmentResponseBean;
import net.gepafin.tendermanagement.model.util.Response;
import net.gepafin.tendermanagement.service.ApplicationAmendmentRequestService;
import net.gepafin.tendermanagement.util.LoggingUtil;
@@ -85,14 +86,14 @@ public class ApplicationAmendmentRequestController implements ApplicationAmendme
}
@Override
public ResponseEntity<Response<List<ApplicationAmendmentRequestResponse>>> getAllApplicationAmendmentRequest(HttpServletRequest request,Long userId) {
public ResponseEntity<Response<List<GetAllAmendmentResponseBean>>> getAllApplicationAmendmentRequest(HttpServletRequest request, Long userId) {
log.info("Get All Applications Amendment Request");
/** This code is responsible for creating user action logs for the "get all application amendment by preInstructor user id" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW)
.actionContext(UserActionContextEnum.GET_ALL_AMENDMENT_BY_PREINSTRUCTOR_USER_ID).build());
List<ApplicationAmendmentRequestResponse> applicationAmendmentRequestResponses = applicationAmendmentRequestService.getAllApplicationAmendmentRequest(request,userId);
List<GetAllAmendmentResponseBean> applicationAmendmentRequestResponses = applicationAmendmentRequestService.getAllApplicationAmendmentRequest(request,userId);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(applicationAmendmentRequestResponses, Status.SUCCESS, Translator.toLocale(GepafinConstant.GET_APPLICATION_AMENDMENT_SUCCESS_MSG)));
}