|
@@ -39,6 +39,9 @@ func (u *userCenter) newClient() zrpc.Client {
|
|
|
//获取身份列表
|
|
|
func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
|
|
|
client := u.newClient()
|
|
|
+ if client == nil {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
defer client.Conn().Close()
|
|
|
resp, err := usercenter.NewUserCenter(client).IdentityList(context.Background(), &pb.IdentityReq{
|
|
|
Id: userId,
|
|
@@ -53,6 +56,9 @@ func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
|
|
|
//获取账号id获取个人身份信息
|
|
|
func (u *userCenter) IdentityByUserId(userId int64) *pb.Identity {
|
|
|
client := u.newClient()
|
|
|
+ if client == nil {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
defer client.Conn().Close()
|
|
|
resp, err := usercenter.NewUserCenter(client).IdentityByUserId(context.Background(), &pb.IdentityReq{
|
|
|
Id: userId,
|
|
@@ -67,6 +73,9 @@ func (u *userCenter) IdentityByUserId(userId int64) *pb.Identity {
|
|
|
//根据职位id获取身份信息
|
|
|
func (u *userCenter) IdentityByPositionId(positionId int64) *pb.Identity {
|
|
|
client := u.newClient()
|
|
|
+ if client == nil {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
defer client.Conn().Close()
|
|
|
resp, err := usercenter.NewUserCenter(client).IdentityByPositionId(context.Background(), &pb.IdentityReq{
|
|
|
Id: positionId,
|
|
@@ -81,6 +90,9 @@ func (u *userCenter) IdentityByPositionId(positionId int64) *pb.Identity {
|
|
|
//根据企业员工id获取身份信息
|
|
|
func (u *userCenter) IdentityByEntUserId(entUserId int64) *pb.Identity {
|
|
|
client := u.newClient()
|
|
|
+ if client == nil {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
defer client.Conn().Close()
|
|
|
resp, err := usercenter.NewUserCenter(client).IdentityByEntUserId(context.Background(), &pb.IdentityReq{
|
|
|
Id: entUserId,
|