initial commit
This commit is contained in:
29
internal/domain/asset/repository.go
Normal file
29
internal/domain/asset/repository.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package asset
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type AssetRepository interface {
|
||||
Create(ctx context.Context, asset *Asset) error
|
||||
FindByID(ctx context.Context, id uuid.UUID) (*Asset, error)
|
||||
Update(ctx context.Context, asset *Asset) error
|
||||
Delete(ctx context.Context, asset *Asset) error
|
||||
FindByProfileID(ctx context.Context, profileID uuid.UUID) ([]*Asset, error)
|
||||
FindLatest(ctx context.Context, limit, offset int) ([]*Asset, error)
|
||||
FindLatestByCategory(ctx context.Context, categoryID uuid.UUID, limit int) ([]*Asset, error)
|
||||
FindLatestByCategoryPaginated(ctx context.Context, categoryID uuid.UUID, limit, offset int) ([]*Asset, error)
|
||||
CountByCategory(ctx context.Context, categoryID uuid.UUID) (int, error)
|
||||
Count(ctx context.Context) (int, error)
|
||||
}
|
||||
|
||||
type CategoryRepository interface {
|
||||
Create(ctx context.Context, category *Category) error
|
||||
FindByID(ctx context.Context, id uuid.UUID) (*Category, error)
|
||||
Update(ctx context.Context, category *Category) error
|
||||
Delete(ctx context.Context, id uuid.UUID) error
|
||||
FindAll(ctx context.Context) ([]*Category, error)
|
||||
FindByIDs(ctx context.Context, ids []uuid.UUID) ([]*Category, error)
|
||||
}
|
||||
Reference in New Issue
Block a user