Skip to content

Commit

Permalink
use const path
Browse files Browse the repository at this point in the history
  • Loading branch information
xtyuns committed Jul 23, 2023
1 parent a395d94 commit 81c84ac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Expand Up @@ -3,8 +3,12 @@ package org.example.order.client
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.RequestMapping

@FeignClient("order-service", path = "order")
@FeignClient("order-service", path = OrderClient.PATH)
interface OrderClient {
companion object {
const val PATH = "/order"
}

@RequestMapping("/add")
fun add(): String
}
Expand Up @@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/order")
@RequestMapping(OrderClient.PATH)
class OrderController(
val orderService: OrderService
): OrderClient {
Expand Down
Expand Up @@ -3,8 +3,12 @@ package org.example.stock.client
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.GetMapping

@FeignClient("stock-service", path = "stock")
@FeignClient("stock-service", path = StockClient.PATH)
interface StockClient {
companion object {
const val PATH = "/stock"
}

@GetMapping("/getName")
fun getName(): String
}
}
Expand Up @@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/stock")
@RequestMapping(StockClient.PATH)
class StockController(
val stockService: StockService
) : StockClient {
Expand Down

0 comments on commit 81c84ac

Please sign in to comment.