clean: removed use of "." in imports

This commit is contained in:
Florian Sylvain
2023-08-13 02:48:19 +02:00
parent 2525a64d0a
commit c6bd7731cc
14 changed files with 82 additions and 75 deletions
+9 -6
View File
@@ -1,13 +1,13 @@
package useCases
import (
. "GohCMS2/adapters/secondary/gateways"
. "GohCMS2/domain/article"
"GohCMS2/adapters/secondary/gateways"
"GohCMS2/domain/article"
"gorm.io/gorm"
)
type CreateArticleUseCase struct {
articleRepository ArticleRepository
articleRepository gateways.ArticleRepository
}
type CreateArticleCommand struct {
@@ -17,10 +17,13 @@ type CreateArticleCommand struct {
func NewCreateArticleUseCase(db *gorm.DB) *CreateArticleUseCase {
return &CreateArticleUseCase{
articleRepository: *NewArticleRepository(db),
articleRepository: *gateways.NewArticleRepository(db),
}
}
func (g *CreateArticleUseCase) CreateArticle(article CreateArticleCommand) (Article, error) {
return g.articleRepository.Create(FromApi(article.Title, article.Body))
func (g *CreateArticleUseCase) CreateArticle(createArticle CreateArticleCommand) (article.Article, error) {
return g.articleRepository.Create(article.FromApi(
createArticle.Title,
createArticle.Body,
))
}