modified: main_dc/docker-compose.yml

modified:   main_dc/yalarba/api_yal/cmd/main.go
	modified:   main_dc/yalarba/api_yal/internal/domain/auth/dto.go
	modified:   main_dc/yalarba/api_yal/internal/domain/auth/handler.go
	modified:   main_dc/yalarba/api_yal/internal/domain/auth/servcie.go
add AuthRes and UserInfo structs for request after auth
This commit is contained in:
2026-03-10 00:07:19 +05:00
parent 0108b981ce
commit 5561a9ee8c
5 changed files with 58 additions and 8 deletions
@@ -1,6 +1,13 @@
package auth
import ()
import (
"errors"
"api_yal/internal/logger"
"api_yal/internal/models"
"golang.org/x/crypto/bcrypt"
)
type AuthService struct {
}
@@ -8,4 +15,20 @@ type AuthService struct {
func NewAuthService() *AuthService {
return &AuthService{
}
}
}
func (s *AuthService) Register(regReq RegisterRequest) (AuthResponse, error) {
l := logger.Get()
l.Debug("Регистрация пользователя AuthSerice")
// Хешируем пароль
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(regReq.Password), bcrypt.DefaultCost)
if err != nil {
return nil, err
}
newAcc := &models.Account{
Email: regReq.Email,
}
}