Your Name
bdacc4452c
refactor(supply-api): deduplicate bootstrap assembly
2026-04-15 17:30:10 +08:00
Your Name
1776862768
refactor(supply-api): remove panic-only helper paths
...
Return explicit errors from AlertAPI construction instead of panicking inside the library layer, and let main own process-level failure handling.
Also delete the unused config.MustLoad helper and lock the supported config loading paths with tests.
2026-04-15 15:38:57 +08:00
Your Name
55a6e7424a
refactor(supply-api): remove inline idempotency fallback
2026-04-14 12:00:17 +08:00
Your Name
6d7ef661e6
feat(supply-api): persist audit alerts
2026-04-14 11:52:45 +08:00
Your Name
116eabf427
refactor(httpapi): 统一错误码格式
...
1. 创建 error_codes.go 定义标准化错误码常量
2. 替换所有硬编码错误码为常量引用
3. 修复 goroutine 未传递 context 的问题
错误码格式:
- HTTP 层通用错误: SUP_HTTP_XXXX
- 业务错误码: SUP_XXX_NNNN
修复:
- db_token_backend.go: goroutine 使用 ctx 而非 context.Background()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-04-12 23:04:59 +08:00
Your Name
90fc95bc27
fix(supply-api): add missing runtime support sources
...
Check in the healthcheck, structured logging, outbox broker, partition manager, and token status repository files that the committed supply-api runtime already imports. Verified with fresh go test runs for cmd/supply-api, internal/httpapi, internal/pkg/logging, internal/repository, and internal/outbox.
2026-04-11 09:45:37 +08:00
Your Name
4adeee2e06
fix: close p0 auth and release gate gaps
2026-04-11 09:25:31 +08:00
Your Name
40ab7cf851
feat: 初始化ForeignKeyValidator和CompensationProcessor
...
P0-07: 批量补偿处理器
- 添加NewCompensationProcessor构造函数
- 添加NoOpCompensationStats实现
- 添加defaultCompensationExecutor placeholder实现
- 在main.go中初始化CompensationProcessor
P0-09: 外键校验器
- 修改ForeignKeyValidator使用pgxpool替代sql.DB
- 在main.go中初始化ForeignKeyValidator
- 在创建账户前调用ValidateSupplyAccountOwner
- 在创建套餐前调用ValidatePackageSupplyAccount
- SupplyAPI添加fkValidator字段
修改的文件:
- cmd/supply-api/main.go: 初始化组件
- internal/httpapi/supply_api.go: 添加外键校验
- internal/domain/compensation.go: 添加构造函数和Stats实现
- internal/repository/foreign_key_validator.go: 改用pgxpool
2026-04-08 19:00:06 +08:00
Your Name
4bbd609ceb
fix: 修复C-04/C-05/C-06/C-07架构级问题
...
C-06: DBSettlementStore.GetWithdrawableBalance 使用AccountRepository真实查询余额
C-05: DBEarningStore 使用新建的UsageRepository实现ListRecords/GetBillingSummary
C-04: 供应商ID从cfg.Server.DefaultSupplierID配置读取
C-07: PDF链接从cfg.Server.StatementBaseURL配置读取
新增:
- internal/repository/usage.go: 用量记录仓储
2026-04-07 17:24:26 +08:00
Your Name
d5b5a8ece0
fix: 系统性修复安全问题、性能问题和错误处理
...
安全问题修复:
- X-Forwarded-For越界检查(auth.go)
- checkTokenStatus Context参数传递(auth.go)
- Type Assertion安全检查(auth.go)
性能问题修复:
- TokenCache过期清理机制
- BruteForceProtection过期清理
- InMemoryIdempotencyStore过期清理
错误处理修复:
- AuditStore.Emit返回error
- domain层emitAudit辅助方法
- List方法返回空slice而非nil
- 金额/价格负数验证
架构一致性:
- 统一使用model.RoleHierarchyLevels
新增功能:
- Alert API完整实现(CRUD+Resolve)
- pkg/error错误码集中管理
2026-04-07 07:41:25 +08:00
Your Name
ed0961d486
fix(supply-api): 修复编译错误和测试问题
...
- 添加 ErrNotFound 和 ErrConcurrencyConflict 错误定义
- 修复 pgx.NullTime 替换为 *time.Time
- 修复 db.go 事务类型 (pgx.Tx vs pgxpool.Tx)
- 移除未使用的导入和变量
- 修复 NewSupplyAPI 调用参数
- 修复中间件链路 handler 类型问题
- 修复适配器类型引用 (storage.InMemoryAccountStore 等)
- 所有测试通过
Test: go test ./...
2026-04-01 13:03:44 +08:00
Your Name
e9338dec28
feat: sync lijiaoqiao implementation and staging validation artifacts
2026-03-31 13:40:00 +08:00