Commit 425beb1c authored by Kristel Meikas's avatar Kristel Meikas
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Kristel Meikas

See merge request teis/common-api-gateway!199
parents 705744ec c3294cc5
package ee.sm.ti.teis.commongateway.violationact;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
import ee.sm.ti.teis.commongateway.proceedings.violationact.ViolationActController;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import static java.util.UUID.randomUUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
class ViolationActControllerTest extends CommonApiGatewayTestBase {
@Autowired
ViolationActController controller;
@Test
void getViolations_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () ->
controller.getViolationActs(randomUUID(), randomUUID(), new RequestMetaDTO()));
}
@Test
void getViolation_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () ->
controller.getViolationAct(randomUUID(), new RequestMetaDTO()));
}
}
package ee.sm.ti.teis.commongateway.admin;
import ee.sm.ti.teis.commongateway.file.FileReferenceDto;
import ee.sm.ti.teis.commongateway.messages.message.MessageProcessingService;
import ee.sm.ti.teis.commongateway.messages.message.dto.MessageFileReferenceDto;
import ee.sm.ti.teis.commongateway.messages.message.request.CreateMessageFileReferencesRequest;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -20,8 +20,7 @@ import java.util.UUID;
@RequiredArgsConstructor
public class AdminForTestingController extends TeisBaseController {
private final AdminForTestingProcessingService service;
private final MessageProcessingService messageProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.admin.reset-message-email}")
@GetMapping("reset-message-email/{messageId}")
......@@ -29,7 +28,7 @@ public class AdminForTestingController extends TeisBaseController {
ResetMessageEmailRequest request = new ResetMessageEmailRequest();
request.setPayload(messageId, requestMetaDTO);
return service.resetMessageEmail(request);
return (UUID) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.message.post-message-file-references}", response = FileReferenceDto.class)
......@@ -40,7 +39,7 @@ public class AdminForTestingController extends TeisBaseController {
dtoList.forEach(reference -> reference.setObjectId(id));
request.setPayload(dtoList, requestMetaDTO);
return messageProcessingService.createFileReferences(request);
return (List<FileReferenceDto>) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.admin;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import java.util.UUID;
@Service
@Deprecated(since = "1.19.0", forRemoval = true)
public class AdminForTestingProcessingService {
private final RabbitTemplate gwRabbitTemplate;
public AdminForTestingProcessingService(RabbitTemplate gwRabbitTemplate) {
this.gwRabbitTemplate = gwRabbitTemplate;
}
UUID resetMessageEmail(ResetMessageEmailRequest request) {
ResetMessageEmailResponse response = (ResetMessageEmailResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
package ee.sm.ti.teis.commongateway.admin;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -16,15 +17,15 @@ import java.time.LocalDateTime;
@RequiredArgsConstructor
public class DeadlineController extends TeisBaseController {
private final DeadlineProcessingService deadlineProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.deadline.get}", response = LocalDateTime.class)
@GetMapping(value = "deadline", produces = MediaType.APPLICATION_JSON_VALUE)
public LocalDateTime getDeadline(GetDeadlineDto getDeadlineDto, RequestMetaDTO requestMetaDTO) {
public LocalDateTime getDeadline(GetDeadlineDto getDeadlineDto, RequestMetaDTO requestMetaDTO) {
CalculateDeadlineGwRequest request = new CalculateDeadlineGwRequest();
request.setPayload(getDeadlineDto, requestMetaDTO);
return deadlineProcessingService.getDeadline(request);
return (LocalDateTime) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.admin;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
@Service
@Deprecated(since = "1.19.0", forRemoval = true)
@RequiredArgsConstructor
public class DeadlineProcessingService {
private final RabbitTemplate gwRabbitTemplate;
LocalDateTime getDeadline(CalculateDeadlineGwRequest requestDTO) {
CalculateDeadlineGwResponse resultDTO = (CalculateDeadlineGwResponse) gwRabbitTemplate
.convertSendAndReceive(requestDTO.routingKey(), requestDTO);
if (resultDTO != null) {
return resultDTO.processResponse();
}
throw new NoResponseFromRabbitException(requestDTO.getRequestMetaDTO().getRequestId());
}
}
package ee.sm.ti.teis.commongateway.admin;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -15,15 +16,14 @@ import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
public class FeatureFlagController extends TeisBaseController {
private final FeatureFlagProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.admin.get-feature-flags}", response = FeatureFlagDto.class)
@GetMapping("{id}")
public FeatureFlagDto getFeatureFlag(@PathVariable("id") String id, RequestMetaDTO requestMetaDTO) {
public FeatureFlagDto getFeatureFlag(@PathVariable("id") String id, RequestMetaDTO requestMetaDTO) {
FeatureFlagRequest request = new FeatureFlagRequest();
request.setPayload(id, requestMetaDTO);
return service.getFeatureFlag(request);
return (FeatureFlagDto) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.admin;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@Deprecated(since = "1.19.0", forRemoval = true)
@RequiredArgsConstructor
public class FeatureFlagProcessingService {
private final RabbitTemplate gwRabbitTemplate;
public FeatureFlagDto getFeatureFlag(FeatureFlagRequest request) {
FeatureFlagResponse response =
(FeatureFlagResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
......@@ -4,7 +4,6 @@ import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -19,10 +18,11 @@ public class PathController extends TeisBaseController {
private final PathProcessingService service;
@ApiOperation(value = "${teis.api.path.get}")
@GetMapping(value = "path", produces = MediaType.APPLICATION_JSON_VALUE)
@GetMapping("path")
public Map<String,String> getPath(PathDto path, RequestMetaDTO requestMetaDTO) {
GetPathRequest request = new GetPathRequest();
request.setPayload(path, requestMetaDTO);
return Map.of("path", service.getPath(request));
}
......
......@@ -5,7 +5,6 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@Deprecated(since = "1.19.0", forRemoval = true)
public class PathProcessingService {
private final RabbitTemplate gwRabbitTemplate;
......@@ -16,9 +15,11 @@ public class PathProcessingService {
String getPath(GetPathRequest requestDTO) {
GetPathResponse resultDTO = (GetPathResponse) gwRabbitTemplate.convertSendAndReceive(requestDTO.routingKey(), requestDTO);
if (resultDTO != null) {
return resultDTO.processResponse();
}
throw new NoResponseFromRabbitException(requestDTO.getRequestMetaDTO().getRequestId());
}
......
......@@ -2,6 +2,7 @@ package ee.sm.ti.teis.commongateway.classifier;
import ee.sm.ti.teis.commongateway.classifier.search.ClassifierItemSearchFilterDto;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.types.enums.classifier.LinkedItems;
import ee.sm.ti.teis.types.enums.classifier.RelationType;
......@@ -17,15 +18,15 @@ import java.util.List;
@RequiredArgsConstructor
public class ClassifierController extends TeisBaseController {
private final ClassifierProcessingService classifierProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.get-classifier-items}", response = String.class)
@GetMapping(value = "classifier-items", produces = MediaType.APPLICATION_JSON_VALUE)
public List<ClassifierItemDto> getClassifiers(ClassifierItemSearchFilterDto searchFilterDto, RequestMetaDTO requestMetaDTO) {
public List<ClassifierItemDto> getClassifiers(ClassifierItemSearchFilterDto searchFilterDto, RequestMetaDTO requestMetaDTO) {
ClassifierItemsRequest request = new ClassifierItemsRequest();
request.setPayload(new ClassifierItemsRequest.Parameters(searchFilterDto), requestMetaDTO);
return classifierProcessingService.getClassifiers(request);
return (List<ClassifierItemDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.get-classifier}", response = String.class)
......@@ -34,20 +35,21 @@ public class ClassifierController extends TeisBaseController {
@PathVariable(name = "id") String id,
@RequestParam(value = "linkedItems", required = false) LinkedItems linkedItems,
@RequestParam(name = "relations", required = false) RelationType relations,
RequestMetaDTO requestMetaDTO) {
RequestMetaDTO requestMetaDTO) {
ClassifierItemRequest request = new ClassifierItemRequest();
request.setPayload(new ClassifierItemRequest.Parameters(id, linkedItems, relations), requestMetaDTO);
return classifierProcessingService.getClassifier(request);
return (ClassifierItemDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.get-classifier-default-value}")
@GetMapping(value = "classifier-definitions/{definitionId}/default-value", produces = MediaType.APPLICATION_JSON_VALUE)
public ClassifierItemDto getDefinition(
@PathVariable(name = "definitionId") String definitionId, RequestMetaDTO requestMetaDTO) {
@PathVariable(name = "definitionId") String definitionId, RequestMetaDTO requestMetaDTO) {
ClassifierDefinitionRequest request = new ClassifierDefinitionRequest();
request.setPayload(new ClassifierDefinitionRequest.Parameters(definitionId), requestMetaDTO);
return classifierProcessingService.getDefaultValue(request);
return (ClassifierItemDto) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.classifier;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Deprecated(since = "1.19.0", forRemoval = true)
@RequiredArgsConstructor
public class ClassifierProcessingService {
private final RabbitTemplate gwRabbitTemplate;
List<ClassifierItemDto> getClassifiers(ClassifierItemsRequest requestDTO) {
ClassifierItemsResponse resultDTO = (ClassifierItemsResponse) gwRabbitTemplate
.convertSendAndReceive(requestDTO.routingKey(), requestDTO);
if (resultDTO != null) {
return resultDTO.processResponse();
}
throw new NoResponseFromRabbitException(requestDTO.getRequestMetaDTO().getRequestId());
}
ClassifierItemDto getClassifier(ClassifierItemRequest requestDTO) {
ClassifierItemResponse resultDTO = (ClassifierItemResponse) gwRabbitTemplate
.convertSendAndReceive(requestDTO.routingKey(), requestDTO);
if (resultDTO != null) {
return resultDTO.processResponse();
}
throw new NoResponseFromRabbitException(requestDTO.getRequestMetaDTO().getRequestId());
}
ClassifierItemDto getDefaultValue(ClassifierDefinitionRequest requestDTO) {
ClassifierDefinitionFieldResponse resultDTO = (ClassifierDefinitionFieldResponse) gwRabbitTemplate
.convertSendAndReceive(requestDTO.routingKey(), requestDTO);
if (resultDTO != null) {
return resultDTO.processResponse();
}
throw new NoResponseFromRabbitException(requestDTO.getRequestMetaDTO().getRequestId());
}
}
package ee.sm.ti.teis.commongateway.dumonitor;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@Deprecated(since = "1.19.0", forRemoval = true)
@RequiredArgsConstructor
public class DUMonitorProcessingService {
private final RabbitTemplate gwRabbitTemplate;
String send(SendPersonalDataUsageRequest request) {
SendPersonalDataUsageResponse response = (SendPersonalDataUsageResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
package ee.sm.ti.teis.commongateway.dumonitor;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -10,21 +11,21 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/dumonitor")
@RequestMapping("dumonitor")
@Profile({"dev", "test", "local", "integtest"})
@RequiredArgsConstructor
public class DUMonitorTestController extends TeisBaseController {
private final DUMonitorProcessingService processingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.post-usage-data}", response = String.class)
@PostMapping
public String send(@RequestBody PersonalDataUsageDto usageData, RequestMetaDTO requestMetaDTO) {
SendPersonalDataUsageRequest request = new SendPersonalDataUsageRequest();
request.setPayload(new SendPersonalDataUsageRequest.Parameters(usageData), requestMetaDTO);
return processingService.send(request);
return (String) service.sendAndReceive(request);
}
}
......@@ -2,8 +2,6 @@ package ee.sm.ti.teis.commongateway.file;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
......@@ -22,24 +20,19 @@ public class FileController extends TeisBaseController {
private final FileProcessingService fileProcessingService;
@ApiOperation(value = "${teis.api.messages.proceeding.post-file}")
@ApiImplicitParams(value = {
@ApiImplicitParam(dataType = "__file", name = "file", required = true, paramType = "form"),
@ApiImplicitParam(dataType = "string", name = "contextType", paramType = "form"),
@ApiImplicitParam(dataType = "string", name = "data", paramType = "form")
})
@PostMapping
public FileReferenceDto upload(@PathVariable("fileReferencePath") FileObjectType fileReferencePath,
@PathVariable UUID id, HttpServletRequest request,
RequestMetaDTO requestMetaDTO) throws Exception {
@PathVariable UUID id, HttpServletRequest request,
RequestMetaDTO requestMetaDTO) throws Exception {
return fileContentService.saveFileToStorage(request, id, fileReferencePath, requestMetaDTO);
}
@ApiOperation(value = "${teis.api.messages.proceeding.update-file-context}")
@PatchMapping("{fileId}/context")
public FileReferenceDto updateContext(@PathVariable("fileReferencePath") FileObjectType fileReferencePath,
@PathVariable UUID fileId, @PathVariable UUID id,
@RequestBody FileReferenceDto fileReferenceDto,
RequestMetaDTO requestMetaDTO) {
@PathVariable UUID fileId, @PathVariable UUID id,
@RequestBody FileReferenceDto fileReferenceDto,
RequestMetaDTO requestMetaDTO) {
fileReferenceDto.setFileId(fileId);
fileReferenceDto.setObjectId(id);
return fileContentService.updateContext(fileReferenceDto, fileReferencePath.name(), requestMetaDTO);
......@@ -48,31 +41,31 @@ public class FileController extends TeisBaseController {
@ApiOperation(value = "${teis.api.messages.proceeding.get-files-metadata}")
@GetMapping
public List<FileReferenceDto> getFilesMetadata(@PathVariable("fileReferencePath") FileObjectType objectType,
@PathVariable String id, RequestMetaDTO requestMetaDTO) {
@PathVariable String id, RequestMetaDTO requestMetaDTO) {
return fileProcessingService.getFilesMetadata(id, objectType.name(), requestMetaDTO);
}
@ApiOperation(value = "${teis.api.messages.proceeding.get-file}")
@GetMapping("{fileId}/download/{fileName}")
public void download(@PathVariable("fileReferencePath") FileObjectType fileReferencePath, @PathVariable String id,
@PathVariable String fileId, @PathVariable String fileName, HttpServletResponse response,
RequestMetaDTO requestMetaDTO) throws Exception {
@PathVariable String fileId, @PathVariable String fileName, HttpServletResponse response,
RequestMetaDTO requestMetaDTO) throws Exception {
fileContentService.getFileFromStorage(id, fileId, fileName, response, fileReferencePath.name(), requestMetaDTO);
}
@ApiOperation(value = "${teis.api.messages.proceeding.delete-file}")
@DeleteMapping("{fileId}")
public void delete(@PathVariable("fileReferencePath") FileObjectType fileReferencePath, @PathVariable String id,
@PathVariable String fileId, RequestMetaDTO requestMetaDTO) {
public void delete(@PathVariable("fileReferencePath") FileObjectType fileReferencePath, @PathVariable UUID id,
@PathVariable UUID fileId, RequestMetaDTO requestMetaDTO) {
fileProcessingService.delete(id, fileId, fileReferencePath.name(), requestMetaDTO);
}
@ApiOperation(value = "${teis.api.messages.proceeding.get-thumbnail-file}")
@GetMapping("{fileId}/thumbnail")
public void downloadThumbnail(@PathVariable("fileReferencePath") FileObjectType fileReferencePath,
@PathVariable String id, @PathVariable String fileId,
HttpServletResponse response,
RequestMetaDTO requestMetaDTO) throws Exception {
@PathVariable String id, @PathVariable String fileId,
HttpServletResponse response,
RequestMetaDTO requestMetaDTO) throws Exception {
fileContentService.getThumbnailFileFromStorage(id, fileId, response, fileReferencePath.name(), requestMetaDTO);
}
......
......@@ -97,7 +97,7 @@ public class FileProcessingService {
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public void delete(String id, String fileId, String objectType, RequestMetaDTO requestMetaDTO) {
public void delete(UUID id, UUID fileId, String objectType, RequestMetaDTO requestMetaDTO) {
DeleteFileRequest request = new DeleteFileRequest(objectType);
request.setPayload(new DeleteFileRequest.Parameters(id, fileId, false), requestMetaDTO);
......@@ -113,7 +113,7 @@ public class FileProcessingService {
}
public void delete(String id, String fileId, boolean hard, String objectType, RequestMetaDTO requestMetaDTO) {
public void delete(UUID id, UUID fileId, boolean hard, String objectType, RequestMetaDTO requestMetaDTO) {
DeleteFileRequest request = new DeleteFileRequest(objectType);
request.setPayload(new DeleteFileRequest.Parameters(id, fileId, hard), requestMetaDTO);
......
......@@ -8,6 +8,7 @@ import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
@Profile({"dev", "test", "local", "integtest"})
@RestController
......@@ -18,8 +19,8 @@ public class FileTestController extends TeisBaseController {
@ApiOperation(value = "${teis.api.messages.proceeding.delete-file}")
@DeleteMapping("{fileId}/{hard}")
public void delete(@PathVariable("fileReferencePath") FileObjectType fileReferencePath, @PathVariable String id,
@PathVariable String fileId, @PathVariable("hard") boolean hard, RequestMetaDTO requestMetaDTO) {
public void delete(@PathVariable("fileReferencePath") FileObjectType fileReferencePath, @PathVariable UUID id,
@PathVariable UUID fileId, @PathVariable("hard") boolean hard, RequestMetaDTO requestMetaDTO) {
fileProcessingService.delete(id, fileId, hard, fileReferencePath.name(), requestMetaDTO);
}
......
package ee.sm.ti.teis.commongateway.location;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
......@@ -16,60 +17,60 @@ import java.util.UUID;
@RequiredArgsConstructor
public class LocationController extends TeisBaseController {
private final LocationProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.get-location}", response = LocationDto.class)
@ApiImplicitParams(
@ApiImplicitParam(name = "id", value = "${teis.api.messages.get-location-id}"))
@GetMapping("{id}")
public LocationDto getLocation(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
public LocationDto getLocation(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
LocationRequest request = new LocationRequest();
request.setPayload(id, requestMetaDTO);
return service.getLocation(request);
return (LocationDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.get-location}", response = LocationDto.class)
@ApiImplicitParams(
@ApiImplicitParam(name = "employerId", value = "${teis.api.messages.get-location-employerId}"))
@GetMapping
public List<LocationDto> getLocations(@RequestParam(name = "employerId") UUID employerId, RequestMetaDTO requestMetaDTO) {
public List<LocationDto> getLocations(@RequestParam(name = "employerId") UUID employerId, RequestMetaDTO requestMetaDTO) {
LocationsRequest request = new LocationsRequest();
request.setPayload(employerId, requestMetaDTO);
return service.getLocations(request);
return (List<LocationDto>)