diff --git a/internal/business/domain/user/model/business/user.go b/internal/business/domain/user/model/business/user.go new file mode 100644 index 0000000..8134ec2 --- /dev/null +++ b/internal/business/domain/user/model/business/user.go @@ -0,0 +1,37 @@ +package model + +import ( + "egg-im/pkg/pb" + "time" +) + +// User 账户 +type User struct { + Id int64 // 用户id + PhoneNumber string // 手机号 + Nickname string // 昵称 + Sex int32 // 性别,1:男;2:女 + AvatarUrl string // 用户头像 + Extra string // 附加属性 + CreateTime time.Time // 创建时间 + UpdateTime time.Time // 更新时间 + IsAutoAddedFriends int // 是否自动被添加好友 +} + +func (u *User) ToProto() *pb.User { + if u == nil { + return nil + } + + return &pb.User{ + UserId: u.Id, + Nickname: u.Nickname, + Sex: u.Sex, + AvatarUrl: u.AvatarUrl, + Extra: u.Extra, + CreateTime: u.CreateTime.Unix(), + UpdateTime: u.UpdateTime.Unix(), + IsAutoAddedFriends: int64(u.IsAutoAddedFriends), + PhoneNumber: u.PhoneNumber, + } +} diff --git a/internal/business/domain/user/model/business/user_level.go b/internal/business/domain/user/model/business/user_level.go new file mode 100644 index 0000000..da30839 --- /dev/null +++ b/internal/business/domain/user/model/business/user_level.go @@ -0,0 +1,10 @@ +package business + +// User 账户 +type User struct { + Id int64 // 用户id + Level int //用户等级id + IsRealName int //是否实名(0:未实名 1.已实名) + CreateAt string // 创建时间 + UpdateAt string // 更新时间 +} diff --git a/pkg/proto/business.ext.proto b/pkg/proto/business.ext.proto index 968a10f..1d8159a 100644 --- a/pkg/proto/business.ext.proto +++ b/pkg/proto/business.ext.proto @@ -145,12 +145,20 @@ message User { string phone_number = 9; // 手机号 } +message BusinessInfo { + int64 Uid = 1; // 用户id + string LevelName = 2; // 会员等级名称 + int32 LevelId = 3; // 会员等级 + bool IsRealName = 4; // 是否实名 +} + message GetUserReq { int64 user_id = 1; // 用户id string phone = 2; // 用户手机号 } message GetUserResp { User user = 1; // 用户信息 + BusinessInfo businessInfo = 2; // 用户业务信息 } message UpdateUserReq {