Files
digital-psychology/.ai/examples/good-service.go
T
jackyu66gitandCursor 2fb1dfee14 chore: seal Design Vision v1 and monorepo scaffold
Archive the differentiated YuXinGu product docs, AI engineering system,
design contract, and Go/Vue scaffold. Next execution prioritizes Cece-parity
over early innovation (see .ai/product/STRATEGY.md).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 16:00:44 +08:00

30 lines
749 B
Go

//go:build ignore
// EXAMPLE — reference shape for AI. Not compiled into apps/api.
package examples
import (
"context"
"fmt"
)
type DecodeRepo interface {
SaveDecode(ctx context.Context, userID string, summary string) error
}
type DecodeServiceImpl struct {
Repo DecodeRepo
}
func (s *DecodeServiceImpl) Decode(ctx context.Context, in DecodeInput) (*DecodeOutput, error) {
if in.Year < 1900 || in.Month < 1 || in.Month > 12 || in.Day < 1 || in.Day > 31 {
return nil, fmt.Errorf("invalid birth date")
}
// engine would run here
summary := "简版结论占位"
if err := s.Repo.SaveDecode(ctx, "user-from-ctx", summary); err != nil {
return nil, fmt.Errorf("save decode: %w", err)
}
return &DecodeOutput{Summary: summary}, nil
}