fix comment again

This commit is contained in:
Hoang 2021-11-05 16:24:53 +07:00
parent 9905ab89ae
commit 85c9692da0
3 changed files with 24 additions and 27 deletions

View File

@ -68,7 +68,7 @@ func (payload CreateOptions) newDevice() (result Device, err error) {
IP: payload.IP,
Language: getLanguage(payload.Language),
AuthToken: payload.AuthToken,
LastActivityAt: timeNow,
LastActivatedAt: timeNow,
CreatedAt: timeNow,
FCMToken: payload.FCMToken,
}

View File

@ -26,12 +26,9 @@ func (s Service) isDeviceIDExisted(ctx context.Context, deviceID string) bool {
"deviceID": deviceID,
"err": err.Error(),
})
}
if !device.ID.IsZero() {
return true
}
return false
return !device.ID.IsZero()
}
func getOSName(userAgent string) string {

View File

@ -16,7 +16,7 @@ type Device struct {
AppVersion string `bson:"appVersion" json:"appVersion"`
Language string `bson:"language" json:"language"` // vi, en
IsMobile bool `bson:"isMobile" json:"isMobile"`
LastActivityAt time.Time `bson:"lastActivityAt" json:"lastActivityAt"`
LastActivatedAt time.Time `bson:"lastActivatedAt" json:"lastActivatedAt"`
UserID primitive.ObjectID `bson:"userID" json:"userId"`
AuthToken string `bson:"authToken" json:"authToken"`
FCMToken string `bson:"fcmToken" json:"fcmToken"`