100 lines
2.3 KiB
Go
100 lines
2.3 KiB
Go
|
|
package usecase
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"haixun-backend/internal/library/placement"
|
||
|
|
)
|
||
|
|
|
||
|
|
type ScanReplySummary struct {
|
||
|
|
ExternalID string
|
||
|
|
Author string
|
||
|
|
Text string
|
||
|
|
Permalink string
|
||
|
|
LikeCount int
|
||
|
|
PostedAt string
|
||
|
|
}
|
||
|
|
|
||
|
|
type ScanPostSummary struct {
|
||
|
|
ID string
|
||
|
|
BrandID string
|
||
|
|
PersonaID string
|
||
|
|
Flow string
|
||
|
|
GraphNodeID string
|
||
|
|
SearchTag string
|
||
|
|
QueryDimension string
|
||
|
|
ExternalID string
|
||
|
|
Permalink string
|
||
|
|
Author string
|
||
|
|
Text string
|
||
|
|
Priority string
|
||
|
|
LikeCount int
|
||
|
|
ReplyCount int
|
||
|
|
EngagementScore int
|
||
|
|
PlacementScore int
|
||
|
|
ProductFitScore int
|
||
|
|
SolvedByProduct bool
|
||
|
|
Source string
|
||
|
|
ScanJobID string
|
||
|
|
OutreachStatus string
|
||
|
|
PublishedReplyID string
|
||
|
|
PublishedPermalink string
|
||
|
|
OutreachUpdateAt int64
|
||
|
|
Replies []ScanReplySummary
|
||
|
|
CreateAt int64
|
||
|
|
}
|
||
|
|
|
||
|
|
type ListRequest struct {
|
||
|
|
TenantID string
|
||
|
|
OwnerUID string
|
||
|
|
BrandID string
|
||
|
|
Priority string
|
||
|
|
ProductFitMin int
|
||
|
|
Recent7dOnly bool
|
||
|
|
Limit int
|
||
|
|
}
|
||
|
|
|
||
|
|
type ReplaceRequest struct {
|
||
|
|
TenantID string
|
||
|
|
OwnerUID string
|
||
|
|
BrandID string
|
||
|
|
GraphID string
|
||
|
|
ScanJobID string
|
||
|
|
Posts []placement.ScanCandidate
|
||
|
|
}
|
||
|
|
|
||
|
|
type ViralReplaceRequest struct {
|
||
|
|
TenantID string
|
||
|
|
OwnerUID string
|
||
|
|
PersonaID string
|
||
|
|
ScanJobID string
|
||
|
|
Posts []placement.ScanCandidate
|
||
|
|
}
|
||
|
|
|
||
|
|
type PersonaListRequest struct {
|
||
|
|
TenantID string
|
||
|
|
OwnerUID string
|
||
|
|
PersonaID string
|
||
|
|
Limit int
|
||
|
|
}
|
||
|
|
|
||
|
|
type UpdateOutreachRequest struct {
|
||
|
|
TenantID string
|
||
|
|
OwnerUID string
|
||
|
|
BrandID string
|
||
|
|
PostID string
|
||
|
|
Status string
|
||
|
|
PublishedReplyID string
|
||
|
|
PublishedPermalink string
|
||
|
|
}
|
||
|
|
|
||
|
|
type UseCase interface {
|
||
|
|
ReplaceFromScan(ctx context.Context, req ReplaceRequest) (int, error)
|
||
|
|
ReplaceFromViralScan(ctx context.Context, req ViralReplaceRequest) (int, error)
|
||
|
|
Get(ctx context.Context, tenantID, ownerUID, brandID, postID string) (*ScanPostSummary, error)
|
||
|
|
GetForPersona(ctx context.Context, tenantID, ownerUID, personaID, postID string) (*ScanPostSummary, error)
|
||
|
|
UpdateOutreach(ctx context.Context, req UpdateOutreachRequest) (*ScanPostSummary, error)
|
||
|
|
List(ctx context.Context, req ListRequest) ([]ScanPostSummary, error)
|
||
|
|
ListForPersona(ctx context.Context, req PersonaListRequest) ([]ScanPostSummary, error)
|
||
|
|
}
|