mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
clean: removed use of "." in imports
This commit is contained in:
@@ -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,
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user