diff --git a/app/annotation-service/src/main/kotlin/com/group6/annotationservice/controller/AnnotationController.kt b/app/annotation-service/src/main/kotlin/com/group6/annotationservice/controller/AnnotationController.kt index 8fcc8148..261f86eb 100644 --- a/app/annotation-service/src/main/kotlin/com/group6/annotationservice/controller/AnnotationController.kt +++ b/app/annotation-service/src/main/kotlin/com/group6/annotationservice/controller/AnnotationController.kt @@ -15,11 +15,13 @@ class AnnotationController( private val annotationService: AnnotationService ) { @PostMapping("parse-selector") + @CrossOrigin(origins = ["*"]) fun parseSelector(@RequestBody selector: SelectorDto): ResponseEntity { return ResponseEntity.ok("test") } @PostMapping("/create") + @CrossOrigin(origins = ["*"]) fun createAnnotation(@RequestBody annotationDto: AnnotationDto): ResponseEntity { val responseAnnotation = DtoConverter @@ -28,6 +30,7 @@ class AnnotationController( } @GetMapping("/{id}") + @CrossOrigin(origins = ["*"]) fun getAnnotation(@PathVariable id: String): ResponseEntity { val annotation = annotationService.getAnnotation(id) ?: return ResponseEntity(HttpStatus.NOT_FOUND) @@ -37,6 +40,7 @@ class AnnotationController( } @PostMapping("/get-annotations-by-target") + @CrossOrigin(origins = ["*"]) fun getAnnotationsByTarget(@RequestBody request: GetAnnotationsByTargetIdRequest): ResponseEntity> { val annotations = annotationService.getAnnotationsByTarget(request.targetId) val responseAnnotationList = annotations.map { DtoConverter.convertAnnotationToAnnotationDto(it) } @@ -44,6 +48,7 @@ class AnnotationController( } @DeleteMapping("/{id}") + @CrossOrigin(origins = ["*"]) fun deleteAnnotation(@PathVariable id: String): ResponseEntity { return if (annotationService.deleteAnnotation(id)) { ResponseEntity(HttpStatus.NO_CONTENT) @@ -51,4 +56,4 @@ class AnnotationController( ResponseEntity(HttpStatus.NOT_FOUND) } } -} \ No newline at end of file +}