Browse Source

update

master
dengbiao 4 days ago
parent
commit
3853a8d000
3 changed files with 55 additions and 0 deletions
  1. +37
    -0
      internal/business/domain/user/model/business/user.go
  2. +10
    -0
      internal/business/domain/user/model/business/user_level.go
  3. +8
    -0
      pkg/proto/business.ext.proto

+ 37
- 0
internal/business/domain/user/model/business/user.go View File

@@ -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,
}
}

+ 10
- 0
internal/business/domain/user/model/business/user_level.go View File

@@ -0,0 +1,10 @@
package business

// User 账户
type User struct {
Id int64 // 用户id
Level int //用户等级id
IsRealName int //是否实名(0:未实名 1.已实名)
CreateAt string // 创建时间
UpdateAt string // 更新时间
}

+ 8
- 0
pkg/proto/business.ext.proto View File

@@ -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 {


Loading…
Cancel
Save