1234567891011121314151617181920212223242526 |
- package interfaces
- import (
- "context"
- "github.com/dmitriygnatenko/internal/models"
- )
- type IArticleRepository interface {
- GetAllPreview(ctx context.Context) ([]models.ArticlePreview, error)
- GetPreviewByTagID(ctx context.Context, tagID int) ([]models.ArticlePreview, error)
- GetByURL(ctx context.Context, url string) (*models.Article, error)
- GetByID(ctx context.Context, ID int) (*models.Article, error)
- }
- type ITagRepository interface {
- GetAll(ctx context.Context) ([]models.Tag, error)
- GetAllUsed(ctx context.Context) ([]models.Tag, error)
- IsUsed(ctx context.Context, ID int) (bool, error)
- GetByArticleID(ctx context.Context, ID int) ([]models.Tag, error)
- GetByURL(ctx context.Context, tag string) (*models.Tag, error)
- GetByID(ctx context.Context, ID int) (*models.Tag, error)
- Add(ctx context.Context, m models.Tag) error
- Update(ctx context.Context, m models.Tag) error
- Delete(ctx context.Context, ID int) error
- }
|