Commit 513711e8 authored by Kristel Meikas's avatar Kristel Meikas
Browse files

TEIS-2120: added new field to GET message permission request

parent 7bd2a292
......@@ -2,12 +2,30 @@ package ee.sm.ti.teis.commongateway.proceedings.proceeding.request;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
public class MessagePermissionRequest extends AbstractDTO<String, ErrorDTO> {
import javax.validation.constraints.NotNull;
import java.util.UUID;
public class MessagePermissionRequest extends AbstractDTO<MessagePermissionRequest.Parameters, ErrorDTO> {
public static final String ROUTING_KEY = "api.MessagePermissionRequest";
@Override
public String routingKey() {
return ROUTING_KEY;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class Parameters {
@NotNull
private UUID id;
private ClassifierItemLightDto contextType;
}
}
package ee.sm.ti.teis.commongateway.proceedings.proceeding;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
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;
......@@ -51,9 +52,10 @@ public class ProceedingController extends TeisBaseController {
@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 UUID id,
@RequestParam(required = false) ClassifierItemLightDto contextType, RequestMetaDTO requestMetaDTO) {
MessagePermissionRequest request = new MessagePermissionRequest();
request.setPayload(id, requestMetaDTO);
request.setPayload(new MessagePermissionRequest.Parameters(id, contextType), requestMetaDTO);
return (List<MessagePermissionDto>) service.sendAndReceive(request);
}
......
theGroup=ee.sm.ti.teis
theVersion=1.23.0
commonsVersion=1.23.0
theVersion=1.24.0-SNAPSHOT
commonsVersion=1.24.0-SNAPSHOT
pluginVersion=1.3.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment