resolved conflicts

This commit is contained in:
rajesh
2024-09-15 12:18:42 +05:30
37 changed files with 382 additions and 129 deletions

View File

@@ -100,7 +100,7 @@ public interface CallApi {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
@GetMapping(value = "",
produces = { "application/json" })
ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls();
ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request);
@Operation(summary = "Api to validate call",

View File

@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.servlet.http.HttpServletRequest;
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
import net.gepafin.tendermanagement.model.util.Response;
@@ -29,8 +30,8 @@ public interface DocumentApi {
@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) }))})
@PostMapping(value = "/uploadFile/call/{callId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
default ResponseEntity<Response<List<DocumentResponseBean>>> uploadFile(HttpServletRequest httpServletRequest, @Parameter(description = "call id", required = true) @PathVariable("callId") Long callId, @RequestParam("file") List<MultipartFile> files, @RequestParam("documentType") DocumentTypeEnum documentTypeEnum) {
@PostMapping(value = "/uploadFile/source/{sourceId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
default ResponseEntity<Response<List<DocumentResponseBean>>> uploadFile(HttpServletRequest httpServletRequest, @Parameter(description = "Source Id", required = true) @PathVariable("sourceId") Long sourceId, @RequestParam DocumentSourceTypeEnum sourceType, @RequestParam("file") List<MultipartFile> files, @RequestParam("documentType") DocumentTypeEnum documentTypeEnum) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}

View File

@@ -15,17 +15,14 @@ import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Validated
public interface FlowApi {
@Operation(summary = "Api to create flow",
@Operation(summary = "Api to create or update flow",
responses = {
@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@@ -34,9 +31,9 @@ public interface FlowApi {
@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) })) })
@PostMapping(value = "/call/{callId}",
@PutMapping(value = "/call/{callId}",
produces = { "application/json" })
ResponseEntity<Response<FlowResponseBean>> createFlow(HttpServletRequest request,
ResponseEntity<Response<FlowResponseBean>> createOrUpdateFlow(HttpServletRequest request,
@Parameter(description = " Flow request object", required = true) @Valid @RequestBody FlowRequestBean flowRequestBean,
@Parameter(description = "The call ID", required = true) @PathVariable("callId") Long callId);

View File

@@ -65,8 +65,8 @@ public class CallApiController implements CallApi {
@Override
@Transactional(readOnly = true)
public ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls() {
List<CallDetailsResponseBean> calls = callService.getAllCalls();
public ResponseEntity<Response<List<CallDetailsResponseBean>>> getAllCalls(HttpServletRequest request) {
List<CallDetailsResponseBean> calls = callService.getAllCalls(request);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(calls, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));

View File

@@ -3,6 +3,7 @@ package net.gepafin.tendermanagement.web.rest.api.impl;
import jakarta.servlet.http.HttpServletRequest;
import net.gepafin.tendermanagement.config.Translator;
import net.gepafin.tendermanagement.constants.GepafinConstant;
import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
import net.gepafin.tendermanagement.enums.DocumentTypeEnum;
import net.gepafin.tendermanagement.model.response.DocumentResponseBean;
import net.gepafin.tendermanagement.model.util.Response;
@@ -27,10 +28,10 @@ DocumentApiController implements DocumentApi {
private DocumentService documentService;
@Override
public ResponseEntity<Response<List<DocumentResponseBean>>> uploadFile(HttpServletRequest httpServletRequest, Long callId,
public ResponseEntity<Response<List<DocumentResponseBean>>> uploadFile(HttpServletRequest httpServletRequest, Long sourceId, DocumentSourceTypeEnum sourceType,
List<MultipartFile> files, DocumentTypeEnum fileType) {
try {
List<DocumentResponseBean> responseBeans = documentService.uploadFile(files, callId, fileType);
List<DocumentResponseBean> responseBeans = documentService.uploadFile(files, sourceId,sourceType, fileType);
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<List<DocumentResponseBean>>(responseBeans, Status.SUCCESS, Translator.toLocale(GepafinConstant.FILES_UPLOADED_MSG)));
} catch (CustomValidationException ex) {

View File

@@ -26,15 +26,13 @@ public class FlowApiController implements FlowApi {
private FlowService flowService;
@Override
@Transactional(rollbackFor=Exception.class)
public ResponseEntity<Response<FlowResponseBean>> createFlow(HttpServletRequest httpServletRequest, FlowRequestBean flowRequestBean, Long callId) {
FlowResponseBean flowResponseBean=flowService.createFlow(httpServletRequest,flowRequestBean,callId);
public ResponseEntity<Response<FlowResponseBean>> createOrUpdateFlow(HttpServletRequest httpServletRequest, FlowRequestBean flowRequestBean, Long callId) {
FlowResponseBean flowResponseBean=flowService.createOrUpdateFlow(httpServletRequest,flowRequestBean,callId);
return ResponseEntity.status(HttpStatus.CREATED)
.body(new Response<>(flowResponseBean, Status.SUCCESS, Translator.toLocale(GepafinConstant.FLOW_CREATED_SUCCESSFULLY)));
}
@Override
@Transactional(rollbackFor=Exception.class)
public ResponseEntity<Response<FlowResponseBean>> getFlowByCallId(HttpServletRequest request, Long callId) {
FlowResponseBean flowResponseBean=flowService.getFlowByCallId(request,callId);
return ResponseEntity.status(HttpStatus.OK)