eureka
tanghc 4 years ago
parent e09f332fe6
commit 8efd1fc7b4
  1. 6
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/controller/RestfulController.java

@ -35,8 +35,12 @@ public class RestfulController {
return proxy.uri(uri).forward(); return proxy.uri(uri).forward();
} }
/**
* 从path中解析出serviceId
* @param path 格式/rest/<serviceId><real_path>
* @return 返回serviceId
*/
private String getServiceId(String path) { private String getServiceId(String path) {
// /rest/story-service/food/getFoodById
path = path.substring(PREFIX_LEN); path = path.substring(PREFIX_LEN);
int index = path.indexOf('/'); int index = path.indexOf('/');
path = path.substring(0, index); path = path.substring(0, index);

Loading…
Cancel
Save