feat():修复forest请求nacospi接口为路径参数的问题

master
86191 2024-08-06 19:38:23 +08:00
parent 526ae6a395
commit b469085934
2 changed files with 4 additions and 3 deletions

View File

@ -4,6 +4,7 @@ package com.muyu.common.nacos.remote;
import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Body;
import com.dtflys.forest.annotation.GetRequest;
import com.dtflys.forest.annotation.Query;
import com.muyu.common.core.constant.Constants;
import com.muyu.common.nacos.remote.interceptor.NacosNamespaceInterceptor;
import com.muyu.common.nacos.remote.req.ServiceListReq;
@ -14,11 +15,11 @@ import com.muyu.common.nacos.remote.resp.ServiceListResp;
*/
@BaseRequest(
baseURL = Constants.HTTP+"#{nacos.addr}/nacos/v1/ns/service",
interceptor = {NacosNamespaceInterceptor.class }
interceptor = {NacosNamespaceInterceptor.class}
)
public interface NacosServiceRemote {
@GetRequest(
url = "/list"
)
public ServiceListResp serviceList(@Body ServiceListReq serviceListReq);
public ServiceListResp serviceList(@Query ServiceListReq serviceListReq);
}

View File

@ -18,7 +18,7 @@ public class NacosService {
private NacosServiceRemote nacosServiceRemote;
public List<String> nacosServerAllList() {
ArrayList<String> serverList = new ArrayList<>();
List<String> serverList = new ArrayList<>();
ServiceListResp serviceListResp = null;
int pageNo = 0,pageSize = 2;
do {