chore: add interface for request to db for posts

This commit is contained in:
d3m0k1d
2026-02-03 18:27:17 +03:00
parent 5560cf9699
commit 503f18d976
3 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
package repositories
import (
"context"
"gitea.d3m0k1d.ru/d3m0k1d/d3m0k1d.ru/backend/internal/storage"
)
type PostRepository interface {
GetAll(ctx context.Context) ([]storage.Post, error)
GetByID(ctx context.Context, id int) (storage.Post, error)
Create(ctx context.Context, post storage.Post) error
Update(ctx context.Context, id int, post storage.Post) error
Delete(ctx context.Context, id int) error
}