package docflow import ( "context" "chat-agent-system/internal/docquery" ) // Query is the authorized read model for controlled documents. type Query struct { Docs *docquery.Service } func (q *Query) Get(ctx context.Context, userID int64, docID string) (*docquery.ContentView, error) { if q == nil || q.Docs == nil { return nil, docquery.ErrClosed } return q.Docs.Get(ctx, docquery.Principal{UserID: userID}, docquery.DocRef{DocID: docID}) } func (q *Query) BatchGet(ctx context.Context, userID int64, docIDs []string) ([]*docquery.ContentView, error) { if q == nil || q.Docs == nil { return nil, docquery.ErrClosed } refs := make([]docquery.DocRef, len(docIDs)) for i, id := range docIDs { refs[i] = docquery.DocRef{DocID: id} } return q.Docs.BatchGet(ctx, docquery.Principal{UserID: userID}, refs) }