mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 10:05:58 +08:00
add
This commit is contained in:
@@ -74,3 +74,15 @@ func GetRegisterUserNum(ip string) ([]string, error) {
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.Register{}).Where("register_ip=?", ip).Pluck("user_id", &userIDList).Error
|
||||
return userIDList, err
|
||||
}
|
||||
|
||||
func InsertIpRecord(userID, createIp string) error {
|
||||
record := &db.UserIpRecord{UserID: userID, CreateIp: createIp, LastLoginTime: time.Now(), LoginTimes: 1}
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.UserIpRecord{}).Create(record).Error
|
||||
return err
|
||||
}
|
||||
|
||||
func UpdateIpReocord(userID, ip string) error {
|
||||
record := &db.UserIpRecord{UserID: userID, LastLoginIp: ip, LastLoginTime: time.Now()}
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.UserIpRecord{}).Updates(record).Updates("login_times = login_times + 1").Error
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -43,9 +43,6 @@ func UserRegister(user db.User) error {
|
||||
if user.Birth.Unix() < 0 {
|
||||
user.Birth = utils.UnixSecondToTime(0)
|
||||
}
|
||||
// user.LastLoginTime = time.Now()
|
||||
// user.LoginTimes = 0
|
||||
// user.LastLoginIp = user.CreateIp
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("users").Create(&user).Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
+310
-363
File diff suppressed because it is too large
Load Diff
@@ -72,15 +72,9 @@ message UserInfo{
|
||||
uint32 birth = 6;
|
||||
string email = 7;
|
||||
string ex = 8;
|
||||
string createIp = 9;
|
||||
uint32 createTime = 10;
|
||||
string LastLoginIp =11;
|
||||
uint32 LastLoginTime = 12;
|
||||
int32 LoginTimes = 13;
|
||||
int32 LoginLimit = 14;
|
||||
int32 appMangerLevel = 15;
|
||||
int32 globalRecvMsgOpt = 16;
|
||||
string invitationCode = 17;
|
||||
uint32 createTime = 9;
|
||||
int32 appMangerLevel = 10;
|
||||
int32 globalRecvMsgOpt = 11;
|
||||
}
|
||||
|
||||
message FriendInfo{
|
||||
|
||||
Reference in New Issue
Block a user