Files
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

617 B

Pattern: Repository

Responsibility

Persistence only. Parameterized SQL. Map rows ↔ model.

Shape

func (r *ReportRepository) SaveReport(ctx context.Context, m *model.Report) error {
    const q = `INSERT INTO report (id, user_id, kind, payload, created_at, updated_at)
               VALUES ($1,$2,$3,$4,now(),now())`
    _, err := r.db.ExecContext(ctx, q, m.ID, m.UserID, m.Kind, m.Payload)
    if err != nil {
        return fmt.Errorf("insert report: %w", err)
    }
    return nil
}

Never

  • SELECT * in new code
  • Business policy (VIP checks) here — return data, let service decide