Commit fa3d239b authored by Enriko Käsper's avatar Enriko Käsper
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Enriko Käsper

See merge request teis/common-api-gateway!114
parents 458219f7 4c3a3304
package ee.sm.ti.teis.commongateway.file;
import ee.sm.ti.teis.types.enums.FileScanStatusType;
import ee.sm.ti.teis.types.enums.FileStatusType;
import ee.sm.ti.teis.types.enums.ObjectStatus;
import lombok.AllArgsConstructor;
......@@ -23,6 +24,7 @@ public class FileMetadataDto {
private String contentType;
private UUID objectId;
private FileStatusType fileStatusType;
private FileScanStatusType scanStatus;
private Boolean signed;
private LocalDateTime signedAt;
private ObjectStatus objectStatus;
......
package ee.sm.ti.teis.commongateway.file;
import ee.sm.ti.teis.commongateway.classifier.ClassifierItemLightDto;
import ee.sm.ti.teis.types.enums.FileScanStatusType;
import ee.sm.ti.teis.types.enums.FileStatusType;
import ee.sm.ti.teis.types.enums.ObjectStatus;
import lombok.AllArgsConstructor;
......@@ -31,6 +32,7 @@ public class FileReferenceDto {
private ClassifierItemLightDto creatorType;
private String fileName;
private FileStatusType fileStatus;
private FileScanStatusType scanStatus;
private ObjectStatus objectStatus;
private LocalDateTime createdAt;
}
......@@ -14,7 +14,7 @@ import java.util.List;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PrivilegeDto {
public class PrivilegePublicDto {
private RolePrivilegeCode privilege;
private String name;
......
......@@ -2,9 +2,9 @@ package ee.sm.ti.teis.commongateway.role.privilege.response;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.commongateway.role.privilege.dto.PrivilegeDto;
import ee.sm.ti.teis.commongateway.role.privilege.dto.PrivilegePublicDto;
public class PrivilegeResponse extends AbstractDTO<PrivilegeDto, ErrorDTO> {
public class PrivilegeResponse extends AbstractDTO<PrivilegePublicDto, ErrorDTO> {
public static final String ROUTING_KEY = "api.PrivilegeResponse";
......
package ee.sm.ti.teis.commongateway.tasks.task.definition.request;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
public class TaskDefinitionsRequest extends AbstractDTO<Void, ErrorDTO> {
public static final String ROUTING_KEY = "api.TaskDefinitionsRequest";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
package ee.sm.ti.teis.commongateway.tasks.task.definition.response;
import ee.sm.ti.teis.AbstractDTO;
import ee.sm.ti.teis.ErrorDTO;
import ee.sm.ti.teis.commongateway.tasks.task.definition.TaskDefinitionDto;
import java.util.List;
public class TaskDefinitionsResponse extends AbstractDTO<List<TaskDefinitionDto>, ErrorDTO> {
public static final String ROUTING_KEY = "api.TaskDefinitionsResponse";
@Override
public String routingKey() {
return ROUTING_KEY;
}
}
package ee.sm.ti.teis.commongateway.tasks.task.definition;
import ee.sm.ti.teis.commongateway.CommonApiGatewayTestBase;
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 org.junit.jupiter.api.Assertions.assertThrows;
public class TaskDefinitionControllerTest extends CommonApiGatewayTestBase {
@Autowired
TaskDefinitionController controller;
@Test
void getTaskDefinitions() {
assertThrows(NoResponseFromRabbitException.class, () ->
controller.getTaskDefinitions(new RequestMetaDTO()));
}
}
package ee.sm.ti.teis.commongateway.role.privilege;
import ee.sm.ti.teis.commongateway.role.privilege.dto.PrivilegeDto;
import ee.sm.ti.teis.commongateway.role.privilege.dto.PrivilegeLightDto;
import ee.sm.ti.teis.commongateway.role.privilege.dto.PrivilegePublicDto;
import ee.sm.ti.teis.commongateway.role.privilege.request.PrivilegeRequest;
import ee.sm.ti.teis.commongateway.role.privilege.request.PrivilegesRequest;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
......@@ -29,12 +29,12 @@ public class PrivilegeController extends TeisBaseController {
return service.getPrivileges(request);
}
@ApiOperation(value = "${teis.api.messages.get-privilege}", response = PrivilegeDto.class)
@ApiOperation(value = "${teis.api.messages.get-privilege}", response = PrivilegePublicDto.class)
@GetMapping("{privilege}")
public PrivilegeDto getPrivilege(@PathVariable RolePrivilegeCode privilege,
@RequestParam(required = false) boolean includeRelatedPrivileges,
@RequestParam(required = false) boolean includeRoles,
@ApiIgnore RequestMetaDTO requestMetaDTO) {
public PrivilegePublicDto getPrivilege(@PathVariable RolePrivilegeCode privilege,
@RequestParam(required = false) boolean includeRelatedPrivileges,
@RequestParam(required = false) boolean includeRoles,
@ApiIgnore RequestMetaDTO requestMetaDTO) {
PrivilegeRequest request = new PrivilegeRequest();
request.setPayload(new PrivilegeRequest.Parameters(privilege, includeRelatedPrivileges, includeRoles), requestMetaDTO);
return service.getPrivilege(request);
......
package ee.sm.ti.teis.commongateway.role.privilege;
import ee.sm.ti.teis.commongateway.role.privilege.dto.PrivilegeDto;
import ee.sm.ti.teis.commongateway.role.privilege.dto.PrivilegeLightDto;
import ee.sm.ti.teis.commongateway.role.privilege.dto.PrivilegePublicDto;
import ee.sm.ti.teis.commongateway.role.privilege.request.PrivilegeRequest;
import ee.sm.ti.teis.commongateway.role.privilege.request.PrivilegesRequest;
import ee.sm.ti.teis.commongateway.role.privilege.response.PrivilegeResponse;
......@@ -27,7 +27,7 @@ public class PrivilegeProcessingService {
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public PrivilegeDto getPrivilege(PrivilegeRequest request) {
public PrivilegePublicDto getPrivilege(PrivilegeRequest request) {
PrivilegeResponse response = (PrivilegeResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
......
package ee.sm.ti.teis.commongateway.tasks.task.definition;
import ee.sm.ti.teis.commongateway.tasks.task.definition.request.TaskDefinitionsRequest;
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.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@RestController
@RequestMapping("task-definitions")
@RequiredArgsConstructor
public class TaskDefinitionController extends TeisBaseController {
private final TaskDefinitionProcessingService service;
@ApiOperation(value = "${teis.api.messages.task.definitions.get-task-definitions}", response = TaskDefinitionDto.class)
@GetMapping
public List<TaskDefinitionDto> getTaskDefinitions(@ApiIgnore RequestMetaDTO requestMetaDTO) {
TaskDefinitionsRequest request = new TaskDefinitionsRequest();
request.setRequestMetaDTO(requestMetaDTO);
return service.getTaskDefinitions(request);
}
}
package ee.sm.ti.teis.commongateway.tasks.task.definition;
import ee.sm.ti.teis.commongateway.tasks.task.definition.request.TaskDefinitionsRequest;
import ee.sm.ti.teis.commongateway.tasks.task.definition.response.TaskDefinitionsResponse;
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
@RequiredArgsConstructor
public class TaskDefinitionProcessingService {
private final RabbitTemplate gwRabbitTemplate;
public List<TaskDefinitionDto> getTaskDefinitions(TaskDefinitionsRequest request) {
TaskDefinitionsResponse response =
(TaskDefinitionsResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
......@@ -93,7 +93,6 @@ teis.api.messages.task.get-tasks: Teenus väljastab ülesande andmeobjektid. Tee
teis.api.messages.task.delete-task: Teenus kustutab ülesande andmed. Teenust kasutatakse siis, kui kustutatakse andmeobjekt, millega seoses ülesanne loodi.
teis.api.messages.task.assignees.create-task-assignee: Teenus lisab ülesandele või ülesannetele täitja.
teis.api.messages.task.assignees.delete-task-assignee: Teenus eemaldab ülesande (ülesannetelt) täitja (täitjad).
teis.api.messages.task.definitions.get-task-definitions: Teenus väljastab ülesannete definitsioonide andmeobjektid.
teis.api.messages.deadline.get: Teenus arvutab etteantud parameetrite alusel tähtaegu.
teis.api.messages.message.get-messages: Teenus väljastab sõnumi andmeobjektid.
......
theGroup=ee.sm.ti.teis
//commonApiGatewayVersion=forSearch ^commonApiGatewayVersion=.*?-SNAPSHOT
theVersion=1.6.1
commonsVersion=1.6.0
theVersion=1.7.0
commonsVersion=1.7.0
pluginVersion=1.0.1
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