swagger支持填入页面地址
This commit is contained in:
@@ -306,7 +306,7 @@ public class DubboController {
|
|||||||
private List<DubboInfo> getDubboInfoByNacos() {
|
private List<DubboInfo> getDubboInfoByNacos() {
|
||||||
List<DubboInfo> providerList = new LinkedList<>();
|
List<DubboInfo> providerList = new LinkedList<>();
|
||||||
// 获取所有的服务列表
|
// 获取所有的服务列表
|
||||||
String serviceListStr = HttpUtil.get(nacosUrl + "/v1/ns/catalog/serviceList?startPg=1&pgSize=100000");
|
String serviceListStr = HttpUtil.get(nacosUrl + "/v1/ns/catalog/services?withInstances=false&pageNo=1&pageSize=100000");
|
||||||
NacosServiceInfoVo nacosServiceInfoVo = JSON.parseObject(serviceListStr, NacosServiceInfoVo.class);
|
NacosServiceInfoVo nacosServiceInfoVo = JSON.parseObject(serviceListStr, NacosServiceInfoVo.class);
|
||||||
if (nacosServiceInfoVo == null || nacosServiceInfoVo.getServiceList().isEmpty()) {
|
if (nacosServiceInfoVo == null || nacosServiceInfoVo.getServiceList().isEmpty()) {
|
||||||
return providerList;
|
return providerList;
|
||||||
|
|||||||
@@ -301,6 +301,11 @@ public class MgDocumentController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping(value = "/addSwaggerResources")
|
@PostMapping(value = "/addSwaggerResources")
|
||||||
public ResponseJson<Object> addSwaggerResources(String resourcesUrl, String rewriteDomainUrl, String oldUrl, Integer openVisit) {
|
public ResponseJson<Object> addSwaggerResources(String resourcesUrl, String rewriteDomainUrl, String oldUrl, Integer openVisit) {
|
||||||
|
// 总有些人喜欢填这个地址,那就替换来支持下吧
|
||||||
|
int htmlIndex = resourcesUrl.indexOf("/swagger-ui.html");
|
||||||
|
if (htmlIndex > 0) {
|
||||||
|
resourcesUrl = resourcesUrl.substring(0, htmlIndex) + "/swagger-resources";
|
||||||
|
}
|
||||||
String swaggerResourcesStr = storageService.get(StorageKeys.SWAGGER_RESOURCES_LIST);
|
String swaggerResourcesStr = storageService.get(StorageKeys.SWAGGER_RESOURCES_LIST);
|
||||||
// 转成set,防止重复
|
// 转成set,防止重复
|
||||||
List<SwaggerResourcesInfoVo> resourcesList = new LinkedList<>();
|
List<SwaggerResourcesInfoVo> resourcesList = new LinkedList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user