40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package bizdev
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"chat-agent-system/internal/ctxmgr"
|
|
)
|
|
|
|
type snapshotDialogueInputs struct {
|
|
Dialogue []string
|
|
Decisions []string
|
|
ExcludedPrivate int
|
|
ExcludedNoAccess int
|
|
}
|
|
|
|
func (s *Service) collectSnapshotDialogueInputs(ctx context.Context, projectID, userID int64) snapshotDialogueInputs {
|
|
out := snapshotDialogueInputs{}
|
|
if s == nil || projectID <= 0 || s.ctxMgr == nil {
|
|
return out
|
|
}
|
|
|
|
if coll, err := s.getProjectContextForUser(ctx, projectID, userID); err == nil && coll != nil {
|
|
for _, d := range coll.MilestoneDecisions {
|
|
out.Decisions = append(out.Decisions, fmt.Sprintf("[%s] %s (%s)", d.ActivityType, d.Title, d.UserName))
|
|
}
|
|
}
|
|
|
|
dialogue, err := s.ctxMgr.CollectProjectDialogue(ctx, projectID, ctxmgr.CollectProjectDialogueOptions{
|
|
Limit: 120,
|
|
})
|
|
if err != nil || dialogue == nil {
|
|
return out
|
|
}
|
|
out.Dialogue = dialogue.Lines
|
|
out.ExcludedPrivate = dialogue.ExcludedPrivate
|
|
out.ExcludedNoAccess = dialogue.ExcludedNoAccess
|
|
return out
|
|
}
|