feat():修复forest请求nacospi接口为路径参数的问题
parent
526ae6a395
commit
b469085934
|
@ -4,6 +4,7 @@ package com.muyu.common.nacos.remote;
|
||||||
import com.dtflys.forest.annotation.BaseRequest;
|
import com.dtflys.forest.annotation.BaseRequest;
|
||||||
import com.dtflys.forest.annotation.Body;
|
import com.dtflys.forest.annotation.Body;
|
||||||
import com.dtflys.forest.annotation.GetRequest;
|
import com.dtflys.forest.annotation.GetRequest;
|
||||||
|
import com.dtflys.forest.annotation.Query;
|
||||||
import com.muyu.common.core.constant.Constants;
|
import com.muyu.common.core.constant.Constants;
|
||||||
import com.muyu.common.nacos.remote.interceptor.NacosNamespaceInterceptor;
|
import com.muyu.common.nacos.remote.interceptor.NacosNamespaceInterceptor;
|
||||||
import com.muyu.common.nacos.remote.req.ServiceListReq;
|
import com.muyu.common.nacos.remote.req.ServiceListReq;
|
||||||
|
@ -14,11 +15,11 @@ import com.muyu.common.nacos.remote.resp.ServiceListResp;
|
||||||
*/
|
*/
|
||||||
@BaseRequest(
|
@BaseRequest(
|
||||||
baseURL = Constants.HTTP+"#{nacos.addr}/nacos/v1/ns/service",
|
baseURL = Constants.HTTP+"#{nacos.addr}/nacos/v1/ns/service",
|
||||||
interceptor = {NacosNamespaceInterceptor.class }
|
interceptor = {NacosNamespaceInterceptor.class}
|
||||||
)
|
)
|
||||||
public interface NacosServiceRemote {
|
public interface NacosServiceRemote {
|
||||||
@GetRequest(
|
@GetRequest(
|
||||||
url = "/list"
|
url = "/list"
|
||||||
)
|
)
|
||||||
public ServiceListResp serviceList(@Body ServiceListReq serviceListReq);
|
public ServiceListResp serviceList(@Query ServiceListReq serviceListReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class NacosService {
|
||||||
private NacosServiceRemote nacosServiceRemote;
|
private NacosServiceRemote nacosServiceRemote;
|
||||||
|
|
||||||
public List<String> nacosServerAllList() {
|
public List<String> nacosServerAllList() {
|
||||||
ArrayList<String> serverList = new ArrayList<>();
|
List<String> serverList = new ArrayList<>();
|
||||||
ServiceListResp serviceListResp = null;
|
ServiceListResp serviceListResp = null;
|
||||||
int pageNo = 0,pageSize = 2;
|
int pageNo = 0,pageSize = 2;
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in New Issue