- 添加 ErrNotFound 和 ErrConcurrencyConflict 错误定义 - 修复 pgx.NullTime 替换为 *time.Time - 修复 db.go 事务类型 (pgx.Tx vs pgxpool.Tx) - 移除未使用的导入和变量 - 修复 NewSupplyAPI 调用参数 - 修复中间件链路 handler 类型问题 - 修复适配器类型引用 (storage.InMemoryAccountStore 等) - 所有测试通过 Test: go test ./...
13 lines
319 B
Go
13 lines
319 B
Go
package repository
|
|
|
|
import "errors"
|
|
|
|
// 仓储层错误定义
|
|
var (
|
|
// ErrNotFound 资源不存在
|
|
ErrNotFound = errors.New("resource not found")
|
|
|
|
// ErrConcurrencyConflict 并发冲突(乐观锁失败)
|
|
ErrConcurrencyConflict = errors.New("concurrency conflict: resource was modified by another transaction")
|
|
)
|