Commit 51563694 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!162
parents e6e3fca8 ffd7de50
package ee.sm.ti.teis.commongateway.proceedings.violation;
import ee.sm.ti.teis.commongateway.proceedings.violation.dto.ViolationPublicDto;
import ee.sm.ti.teis.commongateway.proceedings.violation.request.UpdateViolationStatusPublicRequest;
import ee.sm.ti.teis.commongateway.proceedings.violation.request.ViolationPublicRequest;
import ee.sm.ti.teis.commongateway.proceedings.violation.request.ViolationsPublicRequest;
import ee.sm.ti.teis.commongateway.proceedings.violation.response.UpdateViolationStatusPublicResponse;
import ee.sm.ti.teis.commongateway.proceedings.violation.response.ViolationPublicResponse;
import ee.sm.ti.teis.commongateway.proceedings.violation.response.ViolationsPublicResponse;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
......@@ -36,4 +42,14 @@ public class ViolationProcessingService {
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public ViolationPublicDto updateStatus(UpdateViolationStatusPublicRequest request) {
UpdateViolationStatusPublicResponse response =
(UpdateViolationStatusPublicResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
package ee.sm.ti.teis.commongateway.tasks.task.actionplan;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.dto.TaskActionPlanDto;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.dto.UpdateTaskActionPlanDto;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.request.CreateTaskActionPlanRequest;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.request.DeleteTaskActionPlanRequest;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.request.UpdateTaskActionPlanRequest;
import ee.sm.ti.teis.commongateway.tasks.task.dto.TaskDto;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.UUID;
@RestController
@RequestMapping("tasks")
@RequiredArgsConstructor
public class TaskActionPlanController extends TeisBaseController {
private final TaskActionPlanProcessingService service;
@ApiOperation(value = "${teis.api.messages.task.action-plan.post}", response = TaskDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele"),
@ApiResponse(code = 404, message = "Kasutajal puudub vajalik privileeg")})
@PostMapping("action-plans")
public TaskDto create(@RequestBody TaskActionPlanDto dto, RequestMetaDTO requestMetaDTO) {
CreateTaskActionPlanRequest request = new CreateTaskActionPlanRequest();
request.setPayload(dto, requestMetaDTO);
return service.create(request);
}
@ApiOperation(value = "${teis.api.messages.task.action-plan.delete}", response = TaskDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal puudub nõutav privileeg."),
@ApiResponse(code = 404, message = "Sisendis viidatud ülesannet ei eksisteeri.")})
@DeleteMapping("{id}/action-plans")
public void delete(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
DeleteTaskActionPlanRequest request = new DeleteTaskActionPlanRequest();
request.setPayload(id, requestMetaDTO);
service.delete(request);
}
@ApiOperation(value = "${teis.api.messages.task.action-plan.put}", response = TaskDto.class)
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Sisend ei vasta nõuetele"),
@ApiResponse(code = 403, message = "Kasutajal puudub õigus ülesannet muuta"),
@ApiResponse(code = 404, message = "Sisendis viidatud ülesannet ei eksisteeri")})
@PutMapping("{id}/action-plans")
public TaskDto update(@PathVariable UUID id, @RequestBody UpdateTaskActionPlanDto dto, RequestMetaDTO requestMetaDTO) {
UpdateTaskActionPlanRequest request = new UpdateTaskActionPlanRequest();
dto.setId(id);
request.setPayload(dto, requestMetaDTO);
return service.update(request);
}
}
package ee.sm.ti.teis.commongateway.tasks.task.actionplan;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.request.CreateTaskActionPlanRequest;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.request.DeleteTaskActionPlanRequest;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.request.UpdateTaskActionPlanRequest;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.response.CreateTaskActionPlanResponse;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.response.DeleteTaskActionPlanResponse;
import ee.sm.ti.teis.commongateway.tasks.task.actionplan.response.UpdateTaskActionPlanResponse;
import ee.sm.ti.teis.commongateway.tasks.task.dto.TaskDto;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
public class TaskActionPlanProcessingService {
private final RabbitTemplate gwRabbitTemplate;
public TaskDto create(CreateTaskActionPlanRequest request) {
CreateTaskActionPlanResponse response =
(CreateTaskActionPlanResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public void delete(DeleteTaskActionPlanRequest request) {
DeleteTaskActionPlanResponse response =
(DeleteTaskActionPlanResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
response.processResponse();
return;
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
public TaskDto update(UpdateTaskActionPlanRequest request) {
UpdateTaskActionPlanResponse response =
(UpdateTaskActionPlanResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
......@@ -72,6 +72,7 @@ teis.api.messages.proceeding.delete-file: API salvestab kustutab faili ja puudus
teis.api.messages.proceeding.get-thumbnail-file: API tagastab puudusega seotud faili baasil genereeritud thumbnail pildi.
teis.api.messages.proceedings.violations.get-violations: API väljastab puuduste nimistu. Mõeldud puuduste nimekirja kuvamiseks iseteeninduses.
teis.api.messages.proceedings.violations.patch-violation: API muudab puuduse staatuse "Kontrollimisel" staatusesse ja seob puuduse parandamist tõendavad failid puuduse parandamise sõnumiga.
teis.api.messages.proceedings.get-violation-acts: API väljastab puuduse toimingute andmeobjektid ja nendega seotud andmeobjektid (ettekirjutus, sunniraha hoiatus, sunniraha määramine).
teis.api.messages.proceedings.get-violation-act: API väljastab puuduse toimingu andmeobjekti ja sellega seotud andmeobjektid (ettekirjutus, sunniraha hoiatus, sunniraha määramine).
......@@ -93,6 +94,8 @@ 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.action-plan.post: Teenus salvestab tegevusplaani lisatud uue ülesande. Teenust kasutab iseteeninduse kasutajaliides, et salvestada otse tegevusplaani lisatud ülesandeid.
teis.api.messages.task.action-plan.delete: Teenus kustutab ülesande andmed. Teenust kasutab iseteenindus, et kustutada otse tegevuskavasse lisatud ülesannet.
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.16.0
commonsVersion=1.16.0
theVersion=1.17.0
commonsVersion=1.17.0
pluginVersion=1.2.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