package com.usoft.credit.rest.domain;


import com.usoft.credit.grpc.api.protobuf.GrpcQueryServiceGrpc;
import com.usoft.credit.grpc.api.protobuf.PersonJsonResponse;
import com.usoft.credit.grpc.api.protobuf.PersonQueryRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liuam
 * @since 2018/8/7 0007 下午 14:31
 */
@Service
public class PersonJsonDomain {

    @Autowired
    private GrpcQueryServiceGrpc.GrpcQueryServiceBlockingStub grpcQueryServiceBlockingStub;

    /**
     * erp对个人进行查询
     */
    public PersonJsonResponse.Builder queryPerson(PersonQueryRequest request) throws Exception {
        PersonJsonResponse response = grpcQueryServiceBlockingStub.queryPerson(request);
        return response.toBuilder();
    }
}
