thread-master/internal/model/scan_post/domain/repository/repository.go

42 lines
1.9 KiB
Go
Raw Permalink Normal View History

2026-06-26 08:37:04 +00:00
package repository
import (
"context"
"haixun-backend/internal/model/scan_post/domain/entity"
)
type ListFilter struct {
BrandID string
TopicID string
Priority string
ProductFitMin int
Recent7dOnly bool
Limit int
}
type PersonaListFilter struct {
PersonaID string
CopyMissionID string
Flow string
Limit int
}
type Repository interface {
EnsureIndexes(ctx context.Context) error
ClearForPlacementScan(ctx context.Context, tenantID, ownerUID, brandID, topicID string) error
UpsertBatchForScan(ctx context.Context, tenantID, ownerUID, brandID, topicID string, posts []entity.ScanPost) (int, error)
PruneScanJobPosts(ctx context.Context, tenantID, ownerUID, brandID, topicID, scanJobID string, keepPermalinks []string) error
ReplaceForScan(ctx context.Context, tenantID, ownerUID, brandID, scanJobID string, posts []entity.ScanPost) error
ReplaceForViralScan(ctx context.Context, tenantID, ownerUID, personaID, copyMissionID, scanJobID string, posts []entity.ScanPost) error
Get(ctx context.Context, tenantID, ownerUID, brandID, postID string) (*entity.ScanPost, error)
GetForPersona(ctx context.Context, tenantID, ownerUID, personaID, postID string) (*entity.ScanPost, error)
UpdateOutreach(ctx context.Context, tenantID, ownerUID, brandID, postID string, patch entity.OutreachPatch) (*entity.ScanPost, error)
Delete(ctx context.Context, tenantID, ownerUID, brandID, topicID, postID string) error
DeleteMany(ctx context.Context, tenantID, ownerUID, brandID, topicID string, postIDs []string) (int, error)
List(ctx context.Context, tenantID, ownerUID string, filter ListFilter) ([]entity.ScanPost, error)
ListForPersona(ctx context.Context, tenantID, ownerUID string, filter PersonaListFilter) ([]entity.ScanPost, error)
CountByBrand(ctx context.Context, tenantID, ownerUID, brandID string) (int, error)
AttachTopicID(ctx context.Context, tenantID, ownerUID, brandID, topicID string) error
}