haixunMaster/haixun-backend/internal/model/knowledge_graph/domain/usecase/usecase.go

51 lines
1.0 KiB
Go
Raw Normal View History

2026-06-24 10:02:42 +00:00
package usecase
import (
"context"
libkg "haixun-backend/internal/library/knowledge"
)
type GraphSummary struct {
ID string
BrandID string
Seed string
Nodes []libkg.Node
Edges []libkg.Edge
BraveSources []libkg.BraveSource
PainTagCount int
GeneratedAt int64
CreateAt int64
UpdateAt int64
}
type UpsertRequest struct {
TenantID string
OwnerUID string
BrandID string
Seed string
Nodes []libkg.Node
Edges []libkg.Edge
BraveSources []libkg.BraveSource
PainTagCount int
GeneratedAt int64
}
type NodeSelectionUpdate struct {
NodeID string
SelectedForScan bool
}
type UpdateNodesRequest struct {
TenantID string
OwnerUID string
BrandID string
Updates []NodeSelectionUpdate
}
type UseCase interface {
Get(ctx context.Context, tenantID, ownerUID, brandID string) (*GraphSummary, error)
Upsert(ctx context.Context, req UpsertRequest) (*GraphSummary, error)
UpdateNodeSelections(ctx context.Context, req UpdateNodesRequest) (*GraphSummary, error)
}