Commit 123f6d78 authored by Javi Corvi's avatar Javi Corvi
Browse files

refactorization of packages and swagger

parent 95bb807d
Pipeline #32024 failed with stage
in 0 seconds
......@@ -68,7 +68,12 @@
<artifactId>spring-security-oauth2-jose</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
......
package es.bsc.inb.ades.rest.api;
package es.bsc.inb.etransafe.pretox.rest.api;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......@@ -6,7 +6,7 @@ import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan("es.bsc.inb.ades")
@ComponentScan("es.bsc.inb.etransafe")
public class App {
public static void main(String[] args) {
......
package es.bsc.inb.ades.rest.api.config;
package es.bsc.inb.etransafe.pretox.rest.api.config;
import org.springframework.context.annotation.Configuration;
......
package es.bsc.inb.ades.rest.api.config;
package es.bsc.inb.etransafe.pretox.rest.api.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
......
package es.bsc.inb.ades.rest.api.controllers;
package es.bsc.inb.etransafe.pretox.rest.api.controllers;
import java.security.Principal;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import es.bsc.inb.ades.rest.api.model.Document;
import es.bsc.inb.ades.rest.api.model.DocumentAnnotations;
import es.bsc.inb.ades.rest.api.model.DocumentTracking;
import es.bsc.inb.ades.rest.api.model.Status;
import es.bsc.inb.ades.rest.api.services.DocumentService;
import es.bsc.inb.etransafe.pretox.rest.api.model.Document;
import es.bsc.inb.etransafe.pretox.rest.api.model.DocumentAnnotations;
import es.bsc.inb.etransafe.pretox.rest.api.model.DocumentTracking;
import es.bsc.inb.etransafe.pretox.rest.api.model.Status;
import es.bsc.inb.etransafe.pretox.rest.api.services.DocumentService;
@RestController
@CrossOrigin(origins="*")
public class DocumentController {
@Autowired
public DocumentService documentService;
......@@ -52,11 +46,6 @@ public class DocumentController {
return documentService.findDocumentSRDomainByDocumentId(id);
}
// @RequestMapping("/documents/{id}")
// public Document find2(@PathVariable(value="id") Long id) {
// return documentService.findByDocumentId2(id);
// }
@RequestMapping("/documents/{id}/finding/{findingId}")
public String findFinding(@PathVariable(value="id") Long id, @PathVariable(value="findingId") Integer findingId) {
String snippet = documentService.findFindingEvidenceByDocumentIdAndFindingId(id, findingId);
......@@ -126,12 +115,7 @@ public class DocumentController {
String snippet = documentService.findTextByDocumentId(id);
return snippet;
}
// @RequestMapping("/documents/{id}/finding2/{findingId}")
// public String findFinding2(@PathVariable(value="id") Long id, @PathVariable(value="findingId") Integer findingId) {
// String snippet = documentService.findTextSnippetByDocumentIdAndFindingId2(id, findingId);
// return snippet;
// }
@RequestMapping(value = "/documents/export/{id}")
public ResponseEntity<byte[]> generateReport(@PathVariable("id") long documentId){
......
package es.bsc.inb.ades.rest.api.controllers;
package es.bsc.inb.etransafe.pretox.rest.api.controllers;
import java.util.ArrayList;
......@@ -21,9 +21,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder;
import es.bsc.inb.ades.rest.api.model.FileMessage;
import es.bsc.inb.ades.rest.api.model.FileModel;
import es.bsc.inb.ades.rest.api.services.FileService;
import es.bsc.inb.etransafe.pretox.rest.api.model.FileMessage;
import es.bsc.inb.etransafe.pretox.rest.api.model.FileModel;
import es.bsc.inb.etransafe.pretox.rest.api.services.FileService;
@Controller
@CrossOrigin("*")
......
package es.bsc.inb.ades.rest.api.controllers;
package es.bsc.inb.etransafe.pretox.rest.api.controllers;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
public enum Action {
MOVE, REJECT, ACCEPT, EXPORT_SR_FINDING, NOT_EXPORT_SR_FINDING
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
import java.util.ArrayList;
import java.util.List;
import org.springframework.data.mongodb.core.mapping.Field;
import es.bsc.inb.ades.rest.api.util.VisualizationHTMLUtil;
import es.bsc.inb.etransafe.pretox.rest.api.util.VisualizationHTMLUtil;
/**
*
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
import java.util.List;
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
import java.util.ArrayList;
import java.util.List;
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
import java.util.ArrayList;
import java.util.List;
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
/**
*
* @author jcorvi
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
public class FileMessage {
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
/**
* File model
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
import java.util.ArrayList;
import java.util.List;
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
public enum RecordState {
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
import java.util.ArrayList;
import java.util.List;
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
import org.apache.tomcat.util.bcel.classfile.Constant;
import es.bsc.inb.ades.rest.api.util.Constants;
import es.bsc.inb.etransafe.pretox.rest.api.util.Constants;
/**
* This class describes a finding in SR-Domain format.
......
package es.bsc.inb.ades.rest.api.model;
package es.bsc.inb.etransafe.pretox.rest.api.model;
public enum Status {
DRAFT, IN_PROGRESS, FINISHED, CLOSED
......
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