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>
610 B
610 B
Pattern: Service
Responsibility
Business rules, authorization, orchestration, transactions.
Shape
type ReportRepo interface {
SaveReport(ctx context.Context, r *model.Report) error
}
type ReportService struct {
repo ReportRepo
}
func (s *ReportService) Decode(ctx context.Context, in DecodeInput) (*DecodeOutput, error) {
if err := in.Validate(); err != nil {
return nil, fmt.Errorf("validate decode: %w", err)
}
// rules / engine
// persist via repo
return out, nil
}
Never
- Import
gin - Bypass repo with ad-hoc SQL drivers scattered around