chore: add interface for request to db for posts
This commit is contained in:
14
backend/internal/repositories/interface.go
Normal file
14
backend/internal/repositories/interface.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user