Add user registration with password hashing and restructure handlers directory

This commit is contained in:
2025-05-15 12:10:16 +03:30
parent 7aa8c26da9
commit b3fae6b80c
12 changed files with 124 additions and 45 deletions
+17
View File
@@ -1 +1,18 @@
package services
import (
"CatsOfMastodonBotGo/internal/models"
"gorm.io/gorm"
)
type UserService struct {
db *gorm.DB
}
func NewUserService(db *gorm.DB) *UserService {
return &UserService{db: db}
}
func (us *UserService) CreateUser(user models.ComUser) int {
return int(us.db.Create(&user).RowsAffected)
}