package admin import ( "context" "errors" "github.com/google/uuid" "github.com/jackc/pgx/v5" "github.com/yuxingu/digital-psychology/apps/api/internal/repository" ) var ErrSystemPromptNotFound = errString("system prompt not found") // ListSystemPrompts returns SystemPrompt catalog. func (s *Service) ListSystemPrompts(ctx context.Context) ([]repository.SystemPromptRow, error) { items, err := s.Repo.ListSystemPrompts(ctx) if err != nil { return nil, err } if items == nil { items = []repository.SystemPromptRow{} } return items, nil } // GetSystemPrompt loads one prompt. func (s *Service) GetSystemPrompt(ctx context.Context, id uuid.UUID) (*repository.SystemPromptRow, error) { row, err := s.Repo.GetSystemPrompt(ctx, id) if errors.Is(err, pgx.ErrNoRows) { return nil, ErrSystemPromptNotFound } return row, err }