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
......@@ -4,6 +4,7 @@ import ee.sm.ti.teis.commongateway.messages.message.dto.MessageDto;
import ee.sm.ti.teis.commongateway.messages.message.dto.MessageTestDto;
import ee.sm.ti.teis.commongateway.messages.message.request.MessageRequest;
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;
......@@ -21,7 +22,7 @@ import java.util.UUID;
@RequiredArgsConstructor
public class MessageTestController extends TeisBaseController {
private final MessageProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.message.get-message}", response = MessageDto.class)
@GetMapping(value = "{id}")
......@@ -29,7 +30,7 @@ public class MessageTestController extends TeisBaseController {
MessageRequest request = new MessageRequest();
request.setPayload(id, requestMetaDTO);
return service.getMessage(request);
return (MessageTestDto) service.sendAndReceive(request);
}
}
......@@ -6,6 +6,7 @@ import ee.sm.ti.teis.commongateway.payments.claim.dto.ClaimsDto;
import ee.sm.ti.teis.commongateway.payments.claim.request.ClaimRequest;
import ee.sm.ti.teis.commongateway.payments.claim.request.ClaimsRequest;
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;
......@@ -21,7 +22,7 @@ import java.util.UUID;
@RequiredArgsConstructor
public class ClaimController extends TeisBaseController {
private final ClaimProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.payments.get-claims}", response = ClaimsDto.class)
@GetMapping
......@@ -30,7 +31,7 @@ public class ClaimController extends TeisBaseController {
ClaimsRequest request = new ClaimsRequest();
request.setPayload(new ClaimsRequest.Parameters(searchFilterDto), requestMetaDTO);
return service.getClaims(request);
return (ClaimsDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.payments.get-claim}", response = ClaimDto.class)
......@@ -39,6 +40,6 @@ public class ClaimController extends TeisBaseController {
ClaimRequest request = new ClaimRequest();
request.setPayload(id, requestMetaDTO);
return service.getClaim(request);
return (ClaimDto) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.payments.claim;
import ee.sm.ti.teis.commongateway.payments.claim.dto.ClaimDto;
import ee.sm.ti.teis.commongateway.payments.claim.dto.ClaimsDto;
import ee.sm.ti.teis.commongateway.payments.claim.request.*;
import ee.sm.ti.teis.commongateway.payments.claim.response.*;
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 ClaimProcessingService {
private final RabbitTemplate gwRabbitTemplate;
public ClaimDto create(CreateClaimRequest request) {
CreateClaimResponse response =
(CreateClaimResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public ClaimsDto getClaims(ClaimsRequest request) {
ClaimsResponse response =
(ClaimsResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public ClaimDto getClaim(ClaimRequest request) {
ClaimResponse response =
(ClaimResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public void patch(PatchClaimRequest request) {
PatchClaimResponse response =
(PatchClaimResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
response.processResponse();
return;
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public void delete(DeleteClaimRequest request) {
DeleteClaimResponse response =
(DeleteClaimResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
response.processResponse();
return;
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
......@@ -6,6 +6,7 @@ import ee.sm.ti.teis.commongateway.payments.claim.request.CreateClaimRequest;
import ee.sm.ti.teis.commongateway.payments.claim.request.DeleteClaimRequest;
import ee.sm.ti.teis.commongateway.payments.claim.request.PatchClaimRequest;
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,33 +21,34 @@ import java.util.UUID;
@RequiredArgsConstructor
public class ClaimTestController extends TeisBaseController {
private final ClaimProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.payments.create-claim}", response = ClaimDto.class)
@PostMapping
public ClaimDto create(@RequestBody ClaimDto dto, RequestMetaDTO requestMetaDTO) {
public ClaimDto create(@RequestBody ClaimDto dto, RequestMetaDTO requestMetaDTO) {
CreateClaimRequest request = new CreateClaimRequest();
request.setPayload(dto, requestMetaDTO);
return service.create(request);
return (ClaimDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.payments.patch-claim}")
@PatchMapping
public void patch(@RequestBody PatchClaimDto dto, RequestMetaDTO requestMetaDTO) {
public void patch(@RequestBody PatchClaimDto dto, RequestMetaDTO requestMetaDTO) {
PatchClaimRequest request = new PatchClaimRequest();
request.setPayload(dto, requestMetaDTO);
service.patch(request);
service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.payments.delete-claim}")
@DeleteMapping
public void delete(@RequestParam(required = false) UUID claimId, @RequestParam(required = false) UUID dataObjectId, RequestMetaDTO requestMetaDTO) {
public void delete(@RequestParam(required = false) UUID claimId, @RequestParam(required = false) UUID dataObjectId,
RequestMetaDTO requestMetaDTO) {
DeleteClaimRequest request = new DeleteClaimRequest();
request.setPayload(new DeleteClaimRequest.Parameters(claimId, dataObjectId), requestMetaDTO);
service.delete(request);
service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.person;
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;
......@@ -22,15 +23,15 @@ import java.math.BigInteger;
@RequiredArgsConstructor
public class LegalPersonController extends TeisBaseController {
private final PersonProcessingService personProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.get-legal-person}", response = PersonDto.class)
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public PersonDto getLegalPerson(@RequestParam(name = "regCode") @Min(1) @Max(999999999) BigInteger regCode,
@RequestParam(name = "name", required = false) @Size(min = 2) String name,
RequestMetaDTO requestMetaDTO) {
@RequestParam(name = "name", required = false) @Size(min = 2) String name,
RequestMetaDTO requestMetaDTO) {
GetOrCreatePersonRequest request = new GetOrCreatePersonRequest();
request.setPayload(new GetOrCreatePersonRequest.Parameters(String.valueOf(regCode), name), requestMetaDTO);
return personProcessingService.getLegalPerson(request);
return (PersonDto) service.sendAndReceive(request);
}
}
......@@ -2,6 +2,7 @@ package ee.sm.ti.teis.commongateway.person;
import ee.sm.ti.teis.commongateway.person.search.PersonSearchFilterDto;
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;
......@@ -17,16 +18,16 @@ import java.util.List;
@RequiredArgsConstructor
public class PersonController extends TeisBaseController {
private final PersonProcessingService personProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.get-person}", response = PersonDto.class)
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.get-person-default-id}", required = true))
@GetMapping(value = "{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public PersonDto getPerson(@PathVariable(name = "id") String id, RequestMetaDTO requestMetaDTO) {
public PersonDto getPerson(@PathVariable(name = "id") String id, RequestMetaDTO requestMetaDTO) {
PersonRequest request = new PersonRequest();
request.setPayload(new PersonRequest.Parameters(id), requestMetaDTO);
return personProcessingService.getPerson(request);
return (PersonDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.get-persons}", response = PersonDto.class)
......@@ -36,19 +37,19 @@ public class PersonController extends TeisBaseController {
@ApiImplicitParam(name = "individualPerson.idCode", value = "${teis.api.messages.get-persons-default-individual-person-idcode}")
})
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public List<PersonDto> getPersons(PersonSearchFilterDto personFilter, RequestMetaDTO requestMetaDTO) {
public List<PersonDto> getPersons(PersonSearchFilterDto personFilter, RequestMetaDTO requestMetaDTO) {
PersonsRequest request = new PersonsRequest();
request.setPayload(new PersonsRequest.Parameters(personFilter), requestMetaDTO);
return personProcessingService.getPersons(request);
return (List<PersonDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.post-person}", response = PersonDto.class)
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public PersonDto createPerson(@RequestBody PersonDto person, RequestMetaDTO requestMetaDTO) {
public PersonDto createPerson(@RequestBody PersonDto person, RequestMetaDTO requestMetaDTO) {
CreatePersonRequest request = new CreatePersonRequest();
request.setPayload(new CreatePersonRequest.Parameters(person), requestMetaDTO);
return personProcessingService.createPerson(request);
return (PersonDto) service.sendAndReceive(request);
}
}
......@@ -6,10 +6,7 @@ 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 PersonProcessingService {
......@@ -23,22 +20,6 @@ public class PersonProcessingService {
throw new NoResponseFromRabbitException(requestDTO.getRequestMetaDTO().getRequestId());
}
PersonDto createPerson(CreatePersonRequest request) {
CreatePersonResponse response = (CreatePersonResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public List<PersonDto> getPersons(PersonsRequest requestDTO) {
PersonsResponse response = (PersonsResponse) gwRabbitTemplate.convertSendAndReceive(requestDTO.routingKey(), requestDTO);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(requestDTO.getRequestMetaDTO().getRequestId());
}
PersonDto updatePerson(UpdatePersonRequest request) {
UpdatePersonResponse response = (UpdatePersonResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
......@@ -59,11 +40,4 @@ public class PersonProcessingService {
updatePerson(updatePersonRequest);
}
PersonDto getLegalPerson(GetOrCreatePersonRequest requestDTO) {
GetOrCreatePersonResponse response = (GetOrCreatePersonResponse) gwRabbitTemplate.convertSendAndReceive(requestDTO.routingKey(), requestDTO);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(requestDTO.getRequestMetaDTO().getRequestId());
}
}
package ee.sm.ti.teis.commongateway.person;
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;
......@@ -18,16 +19,16 @@ import java.util.UUID;
@RequiredArgsConstructor
public class PersonTestController extends TeisBaseController {
private final PersonProcessingService personProcessingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.put-person}", response = PersonDto.class)
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.put-person-id}", required = true))
@PutMapping(value = "{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public PersonDto updatePerson(@PathVariable(name = "id") String id, @RequestBody PersonDto person, RequestMetaDTO requestMetaDTO) {
public PersonDto updatePerson(@PathVariable(name = "id") String id, @RequestBody PersonDto person, RequestMetaDTO requestMetaDTO) {
UpdatePersonRequest request = new UpdatePersonRequest();
person.setId(UUID.fromString(id));
request.setPayload(new UpdatePersonRequest.Parameters(person), requestMetaDTO);
return personProcessingService.updatePerson(request);
return (PersonDto) service.sendAndReceive(request);
}
}
......@@ -6,6 +6,7 @@ import ee.sm.ti.teis.commongateway.proceedings.proceeding.request.MessagePermiss
import ee.sm.ti.teis.commongateway.proceedings.proceeding.request.ProceedingPublicRequest;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.request.ProceedingsPublicRequest;
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;
......@@ -22,35 +23,35 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
@RequiredArgsConstructor
public class ProceedingController extends TeisBaseController {
private final ProceedingProcessingService processingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.proceeding.get-proceeding}", response = ProceedingPublicDto.class)
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.proceeding.get-proceeding-id}"))
@GetMapping(value = "{id}", produces = APPLICATION_JSON_VALUE)
public ProceedingPublicDto getProceeding(@PathVariable String id, RequestMetaDTO requestMetaDTO) {
public ProceedingPublicDto getProceeding(@PathVariable String id, RequestMetaDTO requestMetaDTO) {
ProceedingPublicRequest request = new ProceedingPublicRequest();
request.setPayload(id, requestMetaDTO);
return processingService.getProceeding(request);
return (ProceedingPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.get-proceedings}", response = ProceedingPublicDto.class)
@GetMapping(produces = APPLICATION_JSON_VALUE)
public List<ProceedingPublicDto> getProceedings(@RequestParam String legalPersonId, RequestMetaDTO requestMetaDTO) {
public List<ProceedingPublicDto> getProceedings(@RequestParam String legalPersonId, RequestMetaDTO requestMetaDTO) {
ProceedingsPublicRequest request = new ProceedingsPublicRequest();
request.setPayload(legalPersonId, requestMetaDTO);
return processingService.getProceedings(request);
return (List<ProceedingPublicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.get-message-permissions}", response = MessagePermissionDto.class)
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.proceeding.get-proceeding-id}"))
@GetMapping(value = "{id}/message-permissions")
public List<MessagePermissionDto> getMessagePermission(@PathVariable String id, RequestMetaDTO requestMetaDTO) {
public List<MessagePermissionDto> getMessagePermission(@PathVariable String id, RequestMetaDTO requestMetaDTO) {
MessagePermissionRequest request = new MessagePermissionRequest();
request.setPayload(id, requestMetaDTO);
return processingService.getMessagePermission(request);
return (List<MessagePermissionDto>) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.proceedings.proceeding;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.dto.MessagePermissionDto;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.dto.ProceedingPublicDto;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.request.MessagePermissionRequest;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.request.ProceedingPublicRequest;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.request.ProceedingsPublicRequest;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.response.MessagePermissionResponse;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.response.ProceedingPublicResponse;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.response.ProceedingsPublicResponse;
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 ProceedingProcessingService {
private final RabbitTemplate gwRabbitTemplate;
ProceedingPublicDto getProceeding(ProceedingPublicRequest request) {
ProceedingPublicResponse response =
(ProceedingPublicResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
List<ProceedingPublicDto> getProceedings(ProceedingsPublicRequest request) {
ProceedingsPublicResponse response =
(ProceedingsPublicResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public List<MessagePermissionDto> getMessagePermission(MessagePermissionRequest request) {
MessagePermissionResponse response =
(MessagePermissionResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
......@@ -8,6 +8,7 @@ import ee.sm.ti.teis.commongateway.weblink.CreateWebLinkRequest;
import ee.sm.ti.teis.commongateway.weblink.DeleteWebLinkRequest;
import ee.sm.ti.teis.commongateway.weblink.WebLinkDto;
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;
......@@ -24,49 +25,49 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
@RequiredArgsConstructor
public class ProceedingInspectionDocumentController extends TeisBaseController {
private final ProceedingInspectionDocumentProcessingService processingService;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.messages.proceeding.get-proceeding-inspection-documents}",
response = ProceedingInspectionDocumentPublicDto.class)
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.proceeding.get-proceeding-inspection-item-id}"))
@GetMapping(value = "proceedings/{id}/inspection-documents", produces = APPLICATION_JSON_VALUE)
public List<ProceedingInspectionDocumentPublicDto> getDocuments(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
public List<ProceedingInspectionDocumentPublicDto> getDocuments(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
ProceedingInspectionDocumentsPublicRequest request = new ProceedingInspectionDocumentsPublicRequest();
request.setPayload(id, requestMetaDTO);
return processingService.getProceedingDocuments(request);
return (List<ProceedingInspectionDocumentPublicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.create-proceeding-inspection-documents}",
response = ProceedingInspectionDocumentPublicDto.class)
@PostMapping(value = "proceedings/{id}/inspection-documents", produces = APPLICATION_JSON_VALUE)
public ProceedingInspectionDocumentPublicDto createDocument(@PathVariable UUID id, @RequestBody ClassifierItemLightDto document, RequestMetaDTO requestMetaDTO) {
public ProceedingInspectionDocumentPublicDto createDocument(@PathVariable UUID id, @RequestBody ClassifierItemLightDto document, RequestMetaDTO requestMetaDTO) {
CreateProceedingInspectionDocumentPublicRequest request = new CreateProceedingInspectionDocumentPublicRequest();
CreateProceedingInspectionDocumentPublicRequest.Parameters payload = new CreateProceedingInspectionDocumentPublicRequest.Parameters();
payload.setDocumentId(document.getCode());
payload.setProceedingId(id);
request.setPayload(payload, requestMetaDTO);
return processingService.createDocument(request);
return (ProceedingInspectionDocumentPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.create-proceeding-inspection-document-weblinks}",
response = WebLinkDto.class)
@ApiImplicitParams(@ApiImplicitParam(name = "id", value = "${teis.api.messages.proceeding.inspection-document-id}"))
@PostMapping(value = "proceeding-inspection-documents/{id}/weblink", produces = APPLICATION_JSON_VALUE)
public List<WebLinkDto> createWebLinks(@PathVariable UUID id, @RequestBody List<String> url, RequestMetaDTO requestMetaDTO) {
public List<WebLinkDto> createWebLinks(@PathVariable UUID id, @RequestBody List<String> url, RequestMetaDTO requestMetaDTO) {
CreateWebLinkRequest request = new CreateWebLinkRequest();
request.setPayload(new CreateWebLinkRequest.Parameters(url, id), requestMetaDTO);
return processingService.createWebLink(request);
return (List<WebLinkDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.messages.proceeding.delete-proceeding-inspection-document-weblinks}")
@DeleteMapping(value = "proceeding-inspection-documents/{documentId}/weblink/{webLinkId}", produces = APPLICATION_JSON_VALUE)
public void deleteWebLink(@PathVariable UUID documentId, @PathVariable UUID webLinkId, RequestMetaDTO requestMetaDTO) {
public void deleteWebLink(@PathVariable UUID documentId, @PathVariable UUID webLinkId, RequestMetaDTO requestMetaDTO) {
DeleteWebLinkRequest request = new DeleteWebLinkRequest();
request.setPayload(new DeleteWebLinkRequest.Parameters(documentId, webLinkId), requestMetaDTO);
processingService.deleteWebLink(request);
service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.proceedings.proceeding.inspection.document;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.dto.ProceedingInspectionDocumentPublicDto;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.request.CreateProceedingInspectionDocumentPublicRequest;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.request.ProceedingInspectionDocumentsPublicRequest;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.response.CreateProceedingsInspectionDocumentPublicResponse;
import ee.sm.ti.teis.commongateway.proceedings.proceeding.response.ProceedingsInspectionDocumentsPublicResponse;
import ee.sm.ti.teis.commongateway.weblink.*;
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 ProceedingInspectionDocumentProcessingService {
private final RabbitTemplate gwRabbitTemplate;
List<ProceedingInspectionDocumentPublicDto> getProceedingDocuments(ProceedingInspectionDocumentsPublicRequest request) {
ProceedingsInspectionDocumentsPublicResponse response =
(ProceedingsInspectionDocumentsPublicResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {