changes...

This commit is contained in:
KamilM1205 2025-09-22 22:12:49 +04:00
parent 41944884b4
commit ab4b53fd40
26 changed files with 600 additions and 51 deletions

View file

@ -15,7 +15,7 @@ type UserService struct {
repo repository.UsersRepository
}
func NewUserService(repo repository.UsersRepository) UserService {
func CreateUserService(repo repository.UsersRepository) UserService {
return UserService{
repo: repo,
}
@ -26,7 +26,7 @@ func (s *UserService) Create(cmd commands.CreateUserCommand) (*common.UserResult
{
user, err := s.repo.FindByName(cmd.Username)
if err != nil {
return nil, err
return nil, fmt.Errorf("User.create findByName error: %s", err)
}
if user != nil {