From 89c0e3cbe4c4075ad095d0672c187183b4d6fc53 Mon Sep 17 00:00:00 2001 From: kor-Chipmunk Date: Thu, 15 Feb 2024 17:56:53 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20`/v1/api`=20=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/NotificationController.java | 2 +- .../src/main/resources/application.yml | 28 +++++++++---------- .../music/controller/AlbumController.java | 2 +- .../music/controller/ArtistController.java | 2 +- .../music/controller/MusicController.java | 2 +- .../music/service/MusicUploaderService.java | 4 +-- .../src/routes/{ => v1/api}/upload/index.ts | 0 src/backend/storage-server/main.go | 2 +- .../lalala/streaming/config/ws/WsConfig.kt | 4 +-- .../controller/StreamingRestController.kt | 2 +- .../streaming/handler/StreamingHandler.kt | 2 +- .../user/controller/UserController.java | 2 +- 12 files changed, 26 insertions(+), 26 deletions(-) rename src/backend/music-uploader-server/src/routes/{ => v1/api}/upload/index.ts (100%) diff --git a/src/backend/alarm-server/alarm-api/src/main/java/com/lalala/alarm/controller/NotificationController.java b/src/backend/alarm-server/alarm-api/src/main/java/com/lalala/alarm/controller/NotificationController.java index c40b67cd..75a01dd9 100644 --- a/src/backend/alarm-server/alarm-api/src/main/java/com/lalala/alarm/controller/NotificationController.java +++ b/src/backend/alarm-server/alarm-api/src/main/java/com/lalala/alarm/controller/NotificationController.java @@ -19,7 +19,7 @@ @RestController @RequiredArgsConstructor -@RequestMapping("/api/v1/notifications") +@RequestMapping("/v1/api/notifications") public class NotificationController { private final NotificationService service; diff --git a/src/backend/gateway-server/src/main/resources/application.yml b/src/backend/gateway-server/src/main/resources/application.yml index c04c62e5..db09b0ba 100644 --- a/src/backend/gateway-server/src/main/resources/application.yml +++ b/src/backend/gateway-server/src/main/resources/application.yml @@ -28,7 +28,7 @@ spring: predicates: - Path=/alarm/** filters: - - RewritePath=/alarm/?(?.*), /$\{segment} + - RewritePath=/alarm/?(?.*), /v1/api/$\{segment} - id: AUTH-SERVICE uri: lb://AUTH-SERVER @@ -42,21 +42,21 @@ spring: predicates: - Path=/chart/** filters: - - RewritePath=/chart/?(?.*), /$\{segment} + - RewritePath=/chart/?(?.*), /v1/api/$\{segment} - - id: CHATTING-CHAT + - id: CHATTING-SERVICE-API uri: lb://CHATTING-SERVER predicates: - - Path=/chatting/chat/** + - Path=/chatting/v1/api/ filters: - - RewritePath=/chatting/chat/(?/?.*), /chat/$\{segment} + - RewritePath=/chatting/v1/api/(?/?.*), /v1/api/$\{segment} - - id: CHATTING-ROOM - uri: lb://CHATTING-SERVER + - id: CHATTING-SERVICE-STOMP + uri: lb:ws://CHATTING-SERVER predicates: - - Path=/chatting/room/** + - Path=/chatting/** filters: - - RewritePath=/chatting/room/(?/?.*), /api/v1/rooms/$\{segment} + - RewritePath=/chatting/(?/?.*), /$\{segment} - id: FEED uri: lb://FEED-SERVER @@ -70,7 +70,7 @@ spring: predicates: - Path=/music/** filters: - - RewritePath=/music/?(?.*), /api/v1/$\{segment} + - RewritePath=/music/?(?.*), /v1/api/$\{segment} - id: PLAYLIST uri: lb://PLAYLIST-SERVER @@ -84,21 +84,21 @@ spring: predicates: - Path=/search/** filters: - - RewritePath=/search/?(?.*), /$\{segment} + - RewritePath=/search/?(?.*), /v1/api/$\{segment} - id: STREAMING - uri: lb://ws://STREAMING-SERVER + uri: lb:ws://STREAMING-SERVER predicates: - Path=/streaming/** filters: - - RewritePath=/streaming/?(?.*), /streaming/$\{segment} + - RewritePath=/streaming/?(?.*), /v1/ws/streaming/$\{segment} - id: USER uri: lb://USER-SERVER predicates: - Path=/user/** filters: - - RewritePath=/user/?(?.*), /api/v1/$\{segment} + - RewritePath=/user/?(?.*), /v1/api/$\{segment} default-filters: - name: AuthorizationFilter diff --git a/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/AlbumController.java b/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/AlbumController.java index bbdc463b..0c144ca6 100644 --- a/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/AlbumController.java +++ b/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/AlbumController.java @@ -25,7 +25,7 @@ @RestController @RequiredArgsConstructor -@RequestMapping("/api/v1/albums") +@RequestMapping("/v1/api/albums") public class AlbumController { private final AlbumService service; diff --git a/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/ArtistController.java b/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/ArtistController.java index 25e95103..ef7afb8c 100644 --- a/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/ArtistController.java +++ b/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/ArtistController.java @@ -25,7 +25,7 @@ @RestController @RequiredArgsConstructor -@RequestMapping("/api/v1/artists") +@RequestMapping("/v1/api/artists") public class ArtistController { private final ArtistService service; diff --git a/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/MusicController.java b/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/MusicController.java index cf17b724..a256a88e 100644 --- a/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/MusicController.java +++ b/src/backend/music-server/music-api/src/main/java/com/lalala/music/controller/MusicController.java @@ -27,7 +27,7 @@ @RestController @RequiredArgsConstructor -@RequestMapping("/api/v1/musics") +@RequestMapping("/v1/api/musics") public class MusicController { private final MusicService service; private final MusicUploaderService uploaderService; diff --git a/src/backend/music-server/music-api/src/main/java/com/lalala/music/service/MusicUploaderService.java b/src/backend/music-server/music-api/src/main/java/com/lalala/music/service/MusicUploaderService.java index e77a7ce8..3f6d42ab 100644 --- a/src/backend/music-server/music-api/src/main/java/com/lalala/music/service/MusicUploaderService.java +++ b/src/backend/music-server/music-api/src/main/java/com/lalala/music/service/MusicUploaderService.java @@ -102,7 +102,7 @@ public String getFilename() { return restClient .post() - .uri("/upload") + .uri("/v1/api/upload") .headers(httpHeaders -> httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA)) .body(parts) .retrieve() @@ -138,7 +138,7 @@ public String getFilename() { return restClient .post() - .uri("/upload") + .uri("/v1/api/upload") .headers(httpHeaders -> httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA)) .body(parts) .retrieve() diff --git a/src/backend/music-uploader-server/src/routes/upload/index.ts b/src/backend/music-uploader-server/src/routes/v1/api/upload/index.ts similarity index 100% rename from src/backend/music-uploader-server/src/routes/upload/index.ts rename to src/backend/music-uploader-server/src/routes/v1/api/upload/index.ts diff --git a/src/backend/storage-server/main.go b/src/backend/storage-server/main.go index b13b1347..3ee898b2 100644 --- a/src/backend/storage-server/main.go +++ b/src/backend/storage-server/main.go @@ -69,7 +69,7 @@ func listenServe() { func registerHandlers() { http.HandleFunc("/", handleMusicStaticFiles) - http.HandleFunc("/upload", handleUploadMusic) + http.HandleFunc("/v1/api/upload", handleUploadMusic) } func handleMusicStaticFiles(w http.ResponseWriter, r *http.Request) { diff --git a/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/config/ws/WsConfig.kt b/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/config/ws/WsConfig.kt index 05b9a1b1..435c33d8 100644 --- a/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/config/ws/WsConfig.kt +++ b/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/config/ws/WsConfig.kt @@ -20,10 +20,10 @@ class WsConfig( ) : WebSocketConfigurer { override fun registerWebSocketHandlers(registry: WebSocketHandlerRegistry) { registry - .addHandler(streamingHandler(), "/streaming") + .addHandler(streamingHandler(), "/v1/ws/streaming") .setAllowedOrigins("*") registry - .addHandler(streamingHandler(), "/streaming") + .addHandler(streamingHandler(), "/v1/ws/streaming") .setAllowedOrigins("*") .withSockJS() } diff --git a/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/controller/StreamingRestController.kt b/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/controller/StreamingRestController.kt index 8bde00e5..4132db08 100644 --- a/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/controller/StreamingRestController.kt +++ b/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/controller/StreamingRestController.kt @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController @RestController @RequiredArgsConstructor -@RequestMapping("api/v1/streaming") +@RequestMapping("/v1/api/streaming") class StreamingRestController( val audioLocation: String = "./static" ) { diff --git a/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/handler/StreamingHandler.kt b/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/handler/StreamingHandler.kt index cd572280..a518fb2a 100644 --- a/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/handler/StreamingHandler.kt +++ b/src/backend/streaming-server/src/main/kotlin/com/lalala/streaming/handler/StreamingHandler.kt @@ -82,7 +82,7 @@ class StreamingHandler( fun getMusic(session: WebSocketSession, musicId: String): MusicDetailDTO { return musicClient.get() - .uri("/api/v1/musics/${musicId}") + .uri("/v1/api/musics/${musicId}") .accept(MediaType.APPLICATION_JSON) .retrieve() .onStatus(HttpStatusCode::is4xxClientError) { _, _ -> diff --git a/src/backend/user-server/src/main/java/com/lalala/user/controller/UserController.java b/src/backend/user-server/src/main/java/com/lalala/user/controller/UserController.java index ef0bdf54..568a6403 100644 --- a/src/backend/user-server/src/main/java/com/lalala/user/controller/UserController.java +++ b/src/backend/user-server/src/main/java/com/lalala/user/controller/UserController.java @@ -20,7 +20,7 @@ @Slf4j @RestController -@RequestMapping("/api/v1/users") +@RequestMapping("/v1/api/users") @RequiredArgsConstructor public class UserController {