Commit e83a444f authored by 黎博's avatar 黎博

/k8s/dubbo/port优化

parent 4ea69848
......@@ -479,7 +479,6 @@ public class K8sController {
@RequestParam String serviceType,
@RequestParam String serviceName,
@RequestParam String key) {
log.info("获取dubbo接口收到参数:{}, {}, {}, {}", namespace, serviceType, serviceName, key);
List<ServicePort> servicePortList = k8sService.getServiceDetail(namespace, serviceName).getSpec().getPorts();
Map<String, Object> serviceMap = new HashMap<>();
List<Map<String, Object>> portMappingList = new ArrayList<>();
......@@ -500,7 +499,10 @@ public class K8sController {
serviceMap.put("portMappings", portMappingList);
serviceMap.put("serviceName", serviceName);
serviceMap.put("namespace", namespace);
log.info("返回结果为:{}", JSON.toJSONString(serviceMap));
if (serviceMap.containsKey(key)) {
return serviceMap.get(key).toString();
} else {
return JSON.toJSONString(serviceMap);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment