Resolved conflicts

This commit is contained in:
rajesh
2024-08-28 17:43:21 +05:30
13 changed files with 134 additions and 38 deletions

View File

@@ -2,15 +2,15 @@ package net.gepafin.tendermanagement.web.rest.api;
import java.util.List;
import net.gepafin.tendermanagement.enums.CallStatusEnum;
import net.gepafin.tendermanagement.enums.UserStatusEnum;
import net.gepafin.tendermanagement.model.response.UserResponseBean;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -120,5 +120,23 @@ public interface CallApi {
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
public ResponseEntity<Response<CallResponse>> validateCall(HttpServletRequest request,
@Parameter(description = "The call id", required = true) @PathVariable("callId") Long callId);
@Operation(summary = "Api to update call status",
responses = {
@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE)})),
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@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)}))
})
@RequestMapping(value = "/{callId}/status",
produces = {"application/json"},
method = RequestMethod.PUT)
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
default ResponseEntity<Response<CallResponse>> updateCallStatus(
@Parameter(description = "The call id", required = true) @PathVariable("callId") Long callId,
@Parameter(description = "status", required = true)@RequestParam(value = "status", required = true) CallStatusEnum status) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
}

View File

@@ -77,5 +77,5 @@ public interface LookUpDataApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE)}))})
@GetMapping(value = "/type", produces = "application/json")
ResponseEntity<Response<List<LookUpDataResponseBean>>> getLookUpDataByType(HttpServletRequest request, @RequestParam LookUpDataTypeEnum type);
ResponseEntity<Response<List<LookUpDataResponseBean>>> getLookUpDataByType(HttpServletRequest request, @RequestParam List<LookUpDataTypeEnum> types);
}

View File

@@ -2,11 +2,16 @@ package net.gepafin.tendermanagement.web.rest.api.impl;
import java.util.List;
import net.gepafin.tendermanagement.enums.CallStatusEnum;
import net.gepafin.tendermanagement.enums.UserStatusEnum;
import net.gepafin.tendermanagement.model.response.UserResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletRequest;
@@ -78,4 +83,9 @@ public class CallApiController implements CallApi {
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(call, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
}
@Override
public ResponseEntity<Response<CallResponse>> updateCallStatus(@PathVariable Long callId, @RequestParam CallStatusEnum status) {
CallResponse updateCall = callService.updateCallStatus(callId, status);
return ResponseEntity.ok(new Response<>(updateCall, Status.SUCCESS, Translator.toLocale(GepafinConstant.UPDATE_CALL_STATUS_SUCCESS_MSG)));
}
}

View File

@@ -63,7 +63,7 @@ public class LookUpDataApiController implements LookUpDataApi {
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.LOOKUP_DATA_DELETED_SUCCESSFULLY)));
}
@Override
public ResponseEntity<Response<List<LookUpDataResponseBean>>> getLookUpDataByType(HttpServletRequest request, LookUpDataTypeEnum type) {
public ResponseEntity<Response<List<LookUpDataResponseBean>>> getLookUpDataByType(HttpServletRequest request, List<LookUpDataTypeEnum> type) {
List<LookUpDataResponseBean> responseBean = lookUpDataService.getLookUpDataByType(type);
if (responseBean != null) {
return ResponseEntity.status(HttpStatus.OK)