Skip to content

Commit

Permalink
Update AnnotationController.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafakucuk-dev committed Dec 26, 2023
1 parent e0a8d5d commit 419d734
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class AnnotationController(
private val annotationService: AnnotationService
) {
@PostMapping("parse-selector")
@CrossOrigin(origins = ["http://localhost:3000", "http://game-lounge.com", "http://167.99.242.175"])
@CrossOrigin(origins = ["http://localhost:3000", "http://167.99.242.175", "http://167.99.242.175:3000", "http://game-lounge.com", "http://game-lounge.com:3000", "http://www.game-lounge.com", "http://www.game-lounge.com:3000", "https://game-lounge.com", "https://www.game-lounge.com"])
fun parseSelector(@RequestBody selector: SelectorDto): ResponseEntity<String> {

return ResponseEntity.ok("test")
}
@PostMapping("/create")
@CrossOrigin(origins = ["http://localhost:3000", "http://game-lounge.com", "http://167.99.242.175"])
@CrossOrigin(origins = ["http://localhost:3000", "http://167.99.242.175", "http://167.99.242.175:3000", "http://game-lounge.com", "http://game-lounge.com:3000", "http://www.game-lounge.com", "http://www.game-lounge.com:3000", "https://game-lounge.com", "https://www.game-lounge.com"])
fun createAnnotation(@RequestBody annotationDto: AnnotationDto): ResponseEntity<AnnotationDto> {

val responseAnnotation = DtoConverter
Expand All @@ -30,7 +30,7 @@ class AnnotationController(
}

@GetMapping("/{id}")
@CrossOrigin(origins = ["http://localhost:3000", "http://game-lounge.com", "http://167.99.242.175"])
@CrossOrigin(origins = ["http://localhost:3000", "http://167.99.242.175", "http://167.99.242.175:3000", "http://game-lounge.com", "http://game-lounge.com:3000", "http://www.game-lounge.com", "http://www.game-lounge.com:3000", "https://game-lounge.com", "https://www.game-lounge.com"])
fun getAnnotation(@PathVariable id: String): ResponseEntity<AnnotationDto> {
val annotation = annotationService.getAnnotation(id) ?: return ResponseEntity(HttpStatus.NOT_FOUND)

Expand All @@ -40,15 +40,15 @@ class AnnotationController(
}

@PostMapping("/get-annotations-by-target")
@CrossOrigin(origins = ["http://localhost:3000", "http://game-lounge.com", "http://167.99.242.175"])
@CrossOrigin(origins = ["http://localhost:3000", "http://167.99.242.175", "http://167.99.242.175:3000", "http://game-lounge.com", "http://game-lounge.com:3000", "http://www.game-lounge.com", "http://www.game-lounge.com:3000", "https://game-lounge.com", "https://www.game-lounge.com"])
fun getAnnotationsByTarget(@RequestBody request: GetAnnotationsByTargetIdRequest): ResponseEntity<List<AnnotationDto>> {
val annotations = annotationService.getAnnotationsByTarget(request.targetId)
val responseAnnotationList = annotations.map { DtoConverter.convertAnnotationToAnnotationDto(it) }
return ResponseEntity.ok(responseAnnotationList)
}

@DeleteMapping("/{id}")
@CrossOrigin(origins = ["http://localhost:3000", "http://game-lounge.com", "http://167.99.242.175"])
@CrossOrigin(origins = ["http://localhost:3000", "http://167.99.242.175", "http://167.99.242.175:3000", "http://game-lounge.com", "http://game-lounge.com:3000", "http://www.game-lounge.com", "http://www.game-lounge.com:3000", "https://game-lounge.com", "https://www.game-lounge.com"])
fun deleteAnnotation(@PathVariable id: String): ResponseEntity<Void> {
return if (annotationService.deleteAnnotation(id)) {
ResponseEntity<Void>(HttpStatus.NO_CONTENT)
Expand Down

0 comments on commit 419d734

Please sign in to comment.