refactor(all): 简化代码 componentScan 注解的使用

This commit is contained in:
2023-05-01 15:54:03 +08:00
parent c076298683
commit a8f3b4c9bf
5 changed files with 32 additions and 31 deletions

View File

@@ -9,8 +9,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.scheduling.annotation.EnableAsync;
/**
@@ -19,10 +17,10 @@ import org.springframework.scheduling.annotation.EnableAsync;
* @author lanyuanxiaoyao
* @date 2023-04-21
*/
@SpringBootApplication(exclude = {GsonAutoConfiguration.class})
@ComponentScans({
@ComponentScan("com.lanyuanxiaoyao.service")
})
@SpringBootApplication(
scanBasePackages = {"com.lanyuanxiaoyao.service"},
exclude = {GsonAutoConfiguration.class}
)
@EnableDiscoveryClient
@EnableAsync
@EnableCaching