feat():更改auto以及扫描到远程包

master
86191 2024-08-04 16:05:20 +08:00
parent b55a6dbb29
commit b626f18866
3 changed files with 22 additions and 3 deletions

View File

@ -0,0 +1,19 @@
package com.muyu.common.nacos;
import com.dtflys.forest.springboot.annotation.ForestScan;
import com.muyu.common.nacos.remote.interceptor.NacosNamespaceInterceptor;
import com.muyu.common.nacos.service.NacosService;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
* nacos
*/
@Configuration
@ForestScan(basePackages = "com.muyu.common.nacos.remote")
@Import(value = {
NacosNamespaceInterceptor.class,
NacosService.class
})
public class NacosRemoteConfig {
}

View File

@ -3,6 +3,7 @@ package com.muyu.common.nacos.service;
import com.muyu.common.nacos.remote.NacosServiceRemote;
import com.muyu.common.nacos.remote.req.ServiceListReq;
import com.muyu.common.nacos.remote.resp.ServiceListResp;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -13,7 +14,7 @@ import java.util.List;
*/
public class NacosService {
@Resource
@Autowired
private NacosServiceRemote nacosServiceRemote;
public List<String> nacosServerAllList() {

View File

@ -1,2 +1 @@
com.muyu.common.nacos.remote.interceptor.NacosNamespaceInterceptor
com.muyu.common.nacos.service.NacosService
com.muyu.common.nacos.NacosRemoteConfig