SpringConfig.java 480 B

1234567891011121314151617
  1. package cn.hhj.config;
  2. import cn.hhj.constant.Constant;
  3. import cn.hhj.server.RpcServer;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.ComponentScan;
  6. import org.springframework.context.annotation.Configuration;
  7. @Configuration
  8. @ComponentScan(basePackages = "cn.hhj.service")
  9. public class SpringConfig {
  10. @Bean(name="rpcService")
  11. public RpcServer gpRpcServer(){
  12. return new RpcServer(Constant.SERVER_PORT);
  13. }
  14. }