Added migrations

This commit is contained in:
KamilM1205 2025-09-20 18:16:26 +04:00
parent 4a16acc87e
commit 5b18009658
34 changed files with 929 additions and 154 deletions

View file

@ -7,18 +7,17 @@ import (
"58team_blog/internal/application/queries"
"58team_blog/internal/domain/entities"
"58team_blog/internal/domain/repository"
"fmt"
"time"
)
type PostService struct {
repo repository.PostRepository
postsService PostsService
repo repository.PostRepository
}
func CreatePostService(repo repository.PostRepository, postsService PostsService) PostService {
func CreatePostService(repo repository.PostRepository) PostService {
return PostService{
repo: repo,
postsService: postsService,
repo: repo,
}
}
@ -30,7 +29,7 @@ func (s *PostService) Create(cmd commands.CreatePostCommand) (*common.PostResult
post, err := s.repo.Create(&entity)
if err != nil {
return nil, err
return nil, fmt.Errorf("Db error: %s", err)
}
result := mapper.CreatePostResultFromEntity(post)