package ${vhGrpcBuilder_packageName}.${vhGrpcBuilder_sprojectName}.config;

import ${vhGrpcBuilder_packageName}.${vhGrpcBuilder_sprojectName}.svc.certificate.proto.CertificateServiceGrpc;
import ${vhGrpcBuilder_packageName}.${vhGrpcBuilder_sprojectName}.svc.user.proto.UserServiceGrpc;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.grpc.Channel;
import net.devh.springboot.autoconfigure.grpc.client.GrpcClient;

@Configuration
public class GrpcSvcConfig {

    //用户中心
    @GrpcClient("epro-user-svc")
    private Channel eproUserSvcChannel;
    //证件中心
    @GrpcClient("epro-certificate-svc")
    private Channel eproCertificateSvcChannel;
    @Bean
    public UserServiceGrpc.UserServiceBlockingStub userServiceBlockingStub() {
        return UserServiceGrpc.newBlockingStub(eproUserSvcChannel);
    }
    @Bean
    public CertificateServiceGrpc.CertificateServiceBlockingStub certificateServiceBlockingStub(){
        return CertificateServiceGrpc.newBlockingStub(eproCertificateSvcChannel);
    }
}
