|
@@ -6,7 +6,7 @@ import (
|
|
"github.com/dmitriygnatenko/internal/models"
|
|
"github.com/dmitriygnatenko/internal/models"
|
|
)
|
|
)
|
|
|
|
|
|
-type IArticleRepository interface {
|
|
|
|
|
|
+type ArticleRepository interface {
|
|
GetAll(ctx context.Context) ([]models.Article, error)
|
|
GetAll(ctx context.Context) ([]models.Article, error)
|
|
GetAllPreview(ctx context.Context) ([]models.ArticlePreview, error)
|
|
GetAllPreview(ctx context.Context) ([]models.ArticlePreview, error)
|
|
GetPreviewByTagID(ctx context.Context, tagID int) ([]models.ArticlePreview, error)
|
|
GetPreviewByTagID(ctx context.Context, tagID int) ([]models.ArticlePreview, error)
|
|
@@ -17,7 +17,7 @@ type IArticleRepository interface {
|
|
Delete(ctx context.Context, ID int) error
|
|
Delete(ctx context.Context, ID int) error
|
|
}
|
|
}
|
|
|
|
|
|
-type ITagRepository interface {
|
|
|
|
|
|
+type TagRepository interface {
|
|
GetAll(ctx context.Context) ([]models.Tag, error)
|
|
GetAll(ctx context.Context) ([]models.Tag, error)
|
|
GetAllUsed(ctx context.Context) ([]models.Tag, error)
|
|
GetAllUsed(ctx context.Context) ([]models.Tag, error)
|
|
IsUsed(ctx context.Context, ID int) (bool, error)
|
|
IsUsed(ctx context.Context, ID int) (bool, error)
|
|
@@ -29,7 +29,7 @@ type ITagRepository interface {
|
|
Delete(ctx context.Context, ID int) error
|
|
Delete(ctx context.Context, ID int) error
|
|
}
|
|
}
|
|
|
|
|
|
-type IArticleTagRepository interface {
|
|
|
|
|
|
+type ArticleTagRepository interface {
|
|
Add(ctx context.Context, articleID int, tagIDs []int) error
|
|
Add(ctx context.Context, articleID int, tagIDs []int) error
|
|
Delete(ctx context.Context, articleID int, tagIDs []int) error
|
|
Delete(ctx context.Context, articleID int, tagIDs []int) error
|
|
DeleteByArticleID(ctx context.Context, articleID int) error
|
|
DeleteByArticleID(ctx context.Context, articleID int) error
|