apis = serviceApiInfo.getApis();
- for (ServiceApiInfo.ApiMeta apiMeta : apis) {
- Route route = this.buildRoute(serviceId, apiMeta);
- nameVersionServiceIdMap.put(apiMeta.fetchNameVersion(), route);
- }
- serviceIdMd5Map.put(serviceId, serviceApiInfo.getMd5());
- }
-
- @Override
- public Route getRoute(String nameVersion) {
- Route route = nameVersionServiceIdMap.get(nameVersion);
- if (route == null) {
- throw ErrorEnum.ISV_INVALID_METHOD.getErrorMeta().getException();
- }
- return route;
- }
-
- protected Route buildRoute(String serviceId, ServiceApiInfo.ApiMeta apiMeta) {
- return new Route(apiMeta.getName(), apiMeta.getPath(), serviceId, null, false, null);
- }
-
-}
diff --git a/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/DefaultApiMetaManager.java b/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/DefaultApiMetaManager.java
deleted file mode 100644
index 44ef79c1..00000000
--- a/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/DefaultApiMetaManager.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.gitee.sop.gatewaycommon.manager;
-
-import com.alibaba.fastjson.JSON;
-import com.gitee.sop.gatewaycommon.bean.ServiceApiInfo;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.data.redis.core.StringRedisTemplate;
-
-import java.util.Map;
-
-/**
- * 保存在redis中,结构为HSET。格式如下:
- *
- * com.gitee.sop.api
- * <serviceId>:{ md5:"xxx", apis:[{name:"", version:""}] }
- *
- * @author tanghc
- */
-@Getter
-@Slf4j
-public class DefaultApiMetaManager implements ApiMetaManager {
-
- private StringRedisTemplate redisTemplate;
- private ApiMetaContext apiMetaContext;
-
- public DefaultApiMetaManager(StringRedisTemplate redisTemplate, ApiMetaContext apiMetaContext) {
- this.redisTemplate = redisTemplate;
- this.apiMetaContext = apiMetaContext;
- }
-
- @Override
- public void refresh() {
- log.info("刷新本地接口信息");
- Map