sofa-boot icon indicating copy to clipboard operation
sofa-boot copied to clipboard

考虑添加一个SofaBean注解

Open Kunple-w opened this issue 3 years ago • 1 comments

In what area(s)?

/area runtime

/area operator /area placement /area docs /area test-and-release

Describe the feature

对应@SofaService@Service/@Component的对应关系,是否应该有个@SofaBean对应Bean,以免去在配置类中重复写@Bean

目前的写法

public class MultiSofaServiceConfiguration {

    @Bean("multiSofaService")
    @SofaService
    SampleService service() {
        return new DefaultSampleService();
    }
}

期望的写法:

public class MultiSofaServiceConfiguration {

    @SofaBean("multiSofaService")
    SampleService service() {
        return new DefaultSampleService();
    }
}

Kunple-w avatar Dec 23 '21 01:12 Kunple-w

May refer to sofa-rpc issue #1031

MingJunDuan avatar Jan 24 '22 09:01 MingJunDuan

已支持 @SofaServiceBean 注解,同时包含了 @SofaServic 和 @ Component 的能力

HzjNeverStop avatar Jul 05 '23 07:07 HzjNeverStop