修改服务名称映射

This commit is contained in:
2025-07-13 14:13:54 +08:00
parent 0927ab9adb
commit e72fee531c
2 changed files with 7 additions and 7 deletions

View File

@ -24,15 +24,15 @@ public class CustomRouteConfig {
@Bean
public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
return builder.routes()
.route("sczx_user", r -> r.path("/zc/user/**")
.route("sczx-user", r -> r.path("/zc/user/**")
.filters(f -> f.rewritePath("/zc/user/(?<segment>.*)", "/${segment}"))
.uri(uriWithCustomLoadBalance("sczx_user")))
.route("sczx_store", r -> r.path("/zc/store/**")
.uri(uriWithCustomLoadBalance("sczx-user")))
.route("sczx-store", r -> r.path("/zc/store/**")
.filters(f -> f.rewritePath("/zc/store/(?<segment>.*)", "/${segment}"))
.uri(uriWithCustomLoadBalance("sczx_store")))
.route("sczx_car", r -> r.path("/zc/car/**")
.uri(uriWithCustomLoadBalance("sczx-store")))
.route("sczx-car", r -> r.path("/zc/car/**")
.filters(f -> f.rewritePath("/zc/car/(?<segment>.*)", "/${segment}"))
.uri(uriWithCustomLoadBalance("sczx_car")))
.uri(uriWithCustomLoadBalance("sczx-car")))
.build();
// .route("sczx_user", r -> r.path("/zc/user/**")
// .uri("lb://sczx_user"))

View File

@ -4,7 +4,7 @@ server:
spring:
application:
name: sczx_gateway
name: sczx-gateway
cloud:
# gateway:
# discovery: