Skip to content

Commit

Permalink
feat: #1 web 조회 api 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
chs98412 committed Jun 15, 2024
1 parent f61b8a7 commit 16f8232
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.springframework.web.reactive.function.server.coRouter
@Configuration
class ItemInternalRouter(private val itemHandler: ItemHandler) {
@Bean
fun itemBackOfficeRoute(): RouterFunction<ServerResponse> {
fun itemInternalRoute(): RouterFunction<ServerResponse> {
return coRouter {
(accept(MediaType.APPLICATION_JSON) and "/internal/common/item").nest {
POST("", itemHandler::createItem)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.soon.common.presentation.router.item

import com.soon.common.presentation.handler.ItemHandler
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.http.MediaType
import org.springframework.web.reactive.function.server.RouterFunction
import org.springframework.web.reactive.function.server.ServerResponse
import org.springframework.web.reactive.function.server.coRouter

@Configuration
class ItemRouter(private val itemHandler: ItemHandler) {
@Bean
fun itemRoute(): RouterFunction<ServerResponse> {
return coRouter {
(accept(MediaType.APPLICATION_JSON) and "/common/item").nest {
GET("", itemHandler::getItem)
}
}
}
}
5 changes: 5 additions & 0 deletions src/test/http/common-game.http
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ Service-Code:eyJubyI6MSwidGl0bGUiOiJ0aXRsZSJ9
GET localhost:8083/internal/common/item?itemNo=1
Content-Type: application/json
Service-Code:eyJubyI6MSwidGl0bGUiOiJ0aXRsZSJ9

### 아이템 조회 (web)
GET localhost:8083/common/item?itemNo=1
Content-Type: application/json
Service-Code:eyJubyI6MSwidGl0bGUiOiJ0aXRsZSJ9

0 comments on commit 16f8232

Please sign in to comment.