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>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Pattern: Repository
|
||||
|
||||
## Responsibility
|
||||
|
||||
Persistence only. Parameterized SQL. Map rows ↔ model.
|
||||
|
||||
## Shape
|
||||
|
||||
```go
|
||||
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
|
||||
Reference in New Issue
Block a user