del user field

test-errcode
wangchuxiao 2 years ago
parent 5017c61e28
commit 07309b872b

@ -187,11 +187,6 @@ func (s *userServer) UserRegister(ctx context.Context, req *pbuser.UserRegisterR
UserID: user.UserID,
Nickname: user.Nickname,
FaceURL: user.FaceURL,
Gender: user.Gender,
AreaCode: user.AreaCode,
PhoneNumber: user.PhoneNumber,
Birth: time.UnixMilli(user.Birth),
Email: user.Email,
Ex: user.Ex,
CreateTime: now,
AppMangerLevel: user.AppMangerLevel,

@ -168,11 +168,6 @@ const (
MinioDurationTimes = 3600
//Aws
AwsDurationTimes = 3600
// verificationCode used for
VerificationCodeForRegister = 1
VerificationCodeForReset = 2
VerificationCodeForRegisterSuffix = "_forRegister"
VerificationCodeForResetSuffix = "_forReset"
//callbackCommand
CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand"

@ -17,7 +17,7 @@ var errIndex = errors.New("err index")
type metaCache interface {
ExecDel(ctx context.Context) error
// delete key rapid
DeleteKey(ctx context.Context, key string) error
DelKey(ctx context.Context, key string) error
AddKeys(keys ...string)
GetPreDeleteKeys() []string
}
@ -38,7 +38,7 @@ func (m *metaCacheRedis) ExecDel(ctx context.Context) error {
return nil
}
func (m *metaCacheRedis) DeleteKey(ctx context.Context, key string) error {
func (m *metaCacheRedis) DelKey(ctx context.Context, key string) error {
return m.rcClient.TagAsDeleted2(ctx, key)
}

@ -3,11 +3,12 @@ package log
import (
"context"
"fmt"
"time"
"github.com/pkg/errors"
"gorm.io/gorm"
gormLogger "gorm.io/gorm/logger"
gormUtils "gorm.io/gorm/utils"
"time"
)
type SqlLogger struct {
@ -42,7 +43,7 @@ func (SqlLogger) Error(ctx context.Context, msg string, args ...interface{}) {
ZError(ctx, msg, nil, args)
}
func (l SqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
func (l *SqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) {
if l.LogLevel <= gormLogger.Silent {
return
}

File diff suppressed because it is too large Load Diff

@ -65,15 +65,10 @@ message UserInfo{
string userID = 1;
string nickname = 2;
string faceURL = 3;
int32 gender = 4;
string areaCode = 5;
string phoneNumber = 6;
int64 birth = 7;
string email = 8;
string ex = 9;
int64 createTime = 10;
int32 appMangerLevel = 11;
int32 globalRecvMsgOpt = 12;
string ex = 4;
int64 createTime = 5;
int32 appMangerLevel = 6;
int32 globalRecvMsgOpt = 7;
}
message FriendInfo{

@ -2,6 +2,8 @@ package check
import (
"context"
"strings"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
@ -10,7 +12,6 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/user"
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
"google.golang.org/grpc"
"strings"
)
func NewUserCheck(client discoveryregistry.SvcDiscoveryRegistry) *UserCheck {
@ -78,7 +79,6 @@ func (u *UserCheck) GetPublicUserInfos(ctx context.Context, userIDs []string, co
UserID: e.UserID,
Nickname: e.Nickname,
FaceURL: e.FaceURL,
Gender: e.Gender,
Ex: e.Ex,
}
}), nil

@ -129,11 +129,9 @@ func (db *DBFriendRequest) DB2PB(ctx context.Context, friendRequests []*relation
pbFriendRequest.FromUserID = users[v.FromUserID].UserID
pbFriendRequest.FromNickname = users[v.FromUserID].Nickname
pbFriendRequest.FromFaceURL = users[v.FromUserID].FaceURL
pbFriendRequest.FromGender = users[v.FromUserID].Gender
pbFriendRequest.ToUserID = users[v.ToUserID].UserID
pbFriendRequest.ToNickname = users[v.ToUserID].Nickname
pbFriendRequest.ToFaceURL = users[v.ToUserID].FaceURL
pbFriendRequest.ToGender = users[v.ToUserID].Gender
pbFriendRequest.CreateTime = v.CreateTime.Unix()
pbFriendRequest.HandleTime = v.HandleTime.Unix()
pbFriendRequest.HandlerUserID = v.HandlerUserID
@ -162,14 +160,12 @@ func (db *DBFriendRequest) Convert(ctx context.Context) (*sdk.FriendRequest, err
}
pbFriendRequest.FromNickname = user.Nickname
pbFriendRequest.FromFaceURL = user.FaceURL
pbFriendRequest.FromGender = user.Gender
user, err = db.userCheck.GetUserInfo(ctx, db.ToUserID)
if err != nil {
return nil, err
}
pbFriendRequest.ToNickname = user.Nickname
pbFriendRequest.ToFaceURL = user.FaceURL
pbFriendRequest.ToGender = user.Gender
pbFriendRequest.CreateTime = db.CreateTime.Unix()
pbFriendRequest.HandleTime = db.HandleTime.Unix()
return pbFriendRequest, nil
@ -474,7 +470,6 @@ func (*DBUser) DB2PB(users []*relation.UserModel) (PBUsers []*sdk.UserInfo, err
func (pb *PBUser) Convert() (*relation.UserModel, error) {
dst := &relation.UserModel{}
utils.CopyStructFields(dst, pb)
dst.Birth = utils.UnixSecondToTime(pb.Birth)
dst.CreateTime = utils.UnixSecondToTime(pb.CreateTime)
return dst, nil
}
@ -483,7 +478,6 @@ func (db *DBUser) Convert() (*sdk.UserInfo, error) {
dst := &sdk.UserInfo{}
utils.CopyStructFields(dst, db)
dst.CreateTime = db.CreateTime.Unix()
dst.Birth = db.Birth.Unix()
return dst, nil
}

Loading…
Cancel
Save