modified: internal/handlers/user.go

modified:   internal/models/user.go
	modified:   internal/repository/user_repository.go
	modified:   internal/service/auth_service.go
	new file:   internal/service/user_service.go

	modified:   ../../begushiybashkir/bbvue/src/views/ProfileEdit.vue
fix bag not editable profile
This commit is contained in:
2025-10-12 10:16:52 +05:00
parent 8447dbe882
commit 38bee8e077
5 changed files with 122 additions and 76 deletions
+11
View File
@@ -24,6 +24,17 @@ type User struct {
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
type UserUpdate struct {
ID uint `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Phone string `json:"phone"`
Experience string `json:"experience"`
Goals string `json:"goals"`
Newsletter bool `json:"newsletter"`
UpdatedAt time.Time `json:"updated_at"`
}
// HashPassword хеширует пароль перед сохранением
func (u *User) HashPassword() error {
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(u.Password), bcrypt.DefaultCost)