|
|
@@ -4,7 +4,7 @@ import com.github.microservice.models.openAPI.OpenApiInfo;
|
|
|
import com.github.microservice.models.openAPI.RefreshApiParam;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.utils.OpenAPIScan;
|
|
|
-import com.zhongshu.gateway.client.type.ApiType;
|
|
|
+import com.zhongshu.opengateway.client.type.ApiType;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
@@ -31,14 +31,14 @@ public class OpenAPIRegisterService {
|
|
|
|
|
|
public ResultContent initRegisterPAIS() {
|
|
|
String str = restTemplate.getForObject("http://" + serviceId + "/v3/api-docs", String.class);
|
|
|
- List<OpenApiInfo> openAPIS = OpenAPIScan.scanAPI(str, "物联网");
|
|
|
+ String sign = "oitOpenAPI";
|
|
|
+ List<OpenApiInfo> openAPIS = OpenAPIScan.scanAPI(str, "物联网", sign);
|
|
|
RefreshApiParam param = new RefreshApiParam();
|
|
|
param.setServerName(serviceId.toLowerCase());
|
|
|
- param.setPredicateArgs("/openAPI/**");
|
|
|
+ param.setPredicateArgs(String.format("/%s/**", sign));
|
|
|
param.setOpenApiInfo(openAPIS);
|
|
|
param.setApiType(ApiType.IOT.name());
|
|
|
-
|
|
|
- ResultContent content = restTemplate.postForObject("http://openapiserver/openapi/manager/api/refresh", param, ResultContent.class);
|
|
|
+ ResultContent content = restTemplate.postForObject("http://openapiserver-wjf/manager/apiManager/refresh", param, ResultContent.class);
|
|
|
if (content == null) {
|
|
|
content = ResultContent.buildSuccess();
|
|
|
}
|