func (i *UserGuestInter) scopeModel(user *domain.User) error { user.CreatedAt = time.Time{} user.UpdatedAt = time.Time{} user.Account = domain.Account{} return nil }
func (i *UserInter) scopeModel(user *domain.User) error { user.CreatedAt = time.Time{} user.UpdatedAt = time.Time{} user.Account = domain.Account{} if user.Password != "" { hashedPassword, err := bcrypt.GenerateFromPassword([]byte(user.Password), 0) if err != nil { return err } user.Password = string(hashedPassword) } return nil }