Added migrations
This commit is contained in:
parent
4a16acc87e
commit
5b18009658
34 changed files with 929 additions and 154 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue