Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db837877b6 |
@ -1,14 +1,13 @@
|
||||
package com.iqser.red.service.redaction.report.v1.api.resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.common.JSONPrimitive;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.ReportTemplate;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.common.JSONPrimitive;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.ReportTemplate;
|
||||
import java.util.List;
|
||||
|
||||
public interface ReportTemplateResource {
|
||||
|
||||
@ -16,6 +15,8 @@ public interface ReportTemplateResource {
|
||||
|
||||
String REPORT_TEMPLATE_UPLOAD_PATH = "/upload-template";
|
||||
|
||||
String REPORT_TEMPLATE_DELETE_PATH = "/delete-template";
|
||||
|
||||
String TEMPLATE_ID = "templateId";
|
||||
|
||||
String TEMPLATE_ID_PATH_VARIABLE = "/template-id/{" + TEMPLATE_ID + "}";
|
||||
@ -32,4 +33,8 @@ public interface ReportTemplateResource {
|
||||
@PostMapping(value = REPORT_TEMPLATE_UPLOAD_PATH + TEMPLATE_ID_PATH_VARIABLE)
|
||||
void uploadTemplate(@PathVariable(TEMPLATE_ID) String templateId);
|
||||
|
||||
|
||||
@PostMapping(value = REPORT_TEMPLATE_DELETE_PATH + TEMPLATE_ID_PATH_VARIABLE)
|
||||
void deleteTemplate(@PathVariable(TEMPLATE_ID) String templateId);
|
||||
|
||||
}
|
||||
|
||||
@ -1,19 +1,17 @@
|
||||
package com.iqser.red.service.redaction.report.v1.server.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.common.JSONPrimitive;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.ReportTemplate;
|
||||
import com.iqser.red.service.redaction.report.v1.api.resource.ReportTemplateResource;
|
||||
import com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService;
|
||||
import com.iqser.red.service.redaction.report.v1.server.utils.TemplateCache;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@ -41,4 +39,16 @@ public class ReportTemplateController implements ReportTemplateResource {
|
||||
TemplateCache.evictCache(templateId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If a template is deleted we evict it from the cache.
|
||||
*
|
||||
* @param templateId The id for the template to delete
|
||||
*/
|
||||
@Override
|
||||
public void deleteTemplate(String templateId) {
|
||||
|
||||
TemplateCache.evictCache(templateId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user