mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-08 10:14:03 +08:00
解决相同类名的冲突
This commit is contained in:
parent
64d10d961c
commit
d52eb0da7b
@ -2,11 +2,13 @@ package xyz.playedu.api;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import xyz.playedu.api.config.UniqueNameGenerator;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAsync
|
||||
@ComponentScan(nameGenerator = UniqueNameGenerator.class)
|
||||
public class PlayeduApiApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -0,0 +1,16 @@
|
||||
package xyz.playedu.api.config;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.context.annotation.AnnotationBeanNameGenerator;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
* @create 2023/3/2 21:53
|
||||
*/
|
||||
public class UniqueNameGenerator extends AnnotationBeanNameGenerator {
|
||||
@Override
|
||||
public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
|
||||
return definition.getBeanClassName();
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package xyz.playedu.api.controller.frontend;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
* @create 2023/3/2 21:51
|
||||
*/
|
||||
@RestController
|
||||
public class LoginController {
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user