|
|
@@ -16,6 +16,7 @@ import ( |
|
|
|
md3 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" |
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"github.com/google/uuid" |
|
|
|
"github.com/shopspring/decimal" |
|
|
|
"google.golang.org/protobuf/proto" |
|
|
@@ -405,6 +406,31 @@ func GetImUser(userId int64, phone string) (user *pb.User, err error) { |
|
|
|
Phone: phone, |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
fmt.Println("GetImUser>>>>>>>>>>>>>", err.Error()) |
|
|
|
var imUser model2.User |
|
|
|
if phone != "" { |
|
|
|
_, err = db.DbIm.Where("phone_number = ?", phone).Get(&imUser) |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if userId != 0 { |
|
|
|
_, err = db.DbIm.Where("id = ?", userId).Get(&imUser) |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
user = &pb.User{ |
|
|
|
UserId: imUser.Id, |
|
|
|
Nickname: imUser.Nickname, |
|
|
|
Sex: imUser.Sex, |
|
|
|
AvatarUrl: imUser.AvatarUrl, |
|
|
|
Extra: imUser.Extra, |
|
|
|
CreateTime: 0, |
|
|
|
UpdateTime: 0, |
|
|
|
IsAutoAddedFriends: 0, |
|
|
|
PhoneNumber: imUser.PhoneNumber, |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
return resp.User, nil |
|
|
|