huang
6821e5abcf
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 4m36s
refactor: 统一错误消息数据源,优化错误码与映射表管理
主要改动:
- 改造 errors.New() 和 Wrap() 函数签名为可变参数,优先使用 errorMessages 映射表
- 添加 allErrorCodes 注册表和 init() 启动时校验,确保错误码与映射表一致
- 添加 TestAllCodesHaveMessages 和 TestNoOrphanMessages 测试防止映射表腐化
- 清理 109 处与映射表一致的冗余硬编码(service 层)
- 保留业务特定消息覆盖能力
新增 API 用法:
- errors.New(errors.CodeUnauthorized) // 使用映射表默认消息
- errors.New(errors.CodeNotFound, "提现申请不存在") // 覆盖为自定义消息
2026-01-22 18:27:42 +08:00
..
2026-01-09 18:02:46 +08:00
2026-01-09 12:25:50 +08:00
2026-01-09 12:25:50 +08:00
2026-01-10 11:42:38 +08:00
2026-01-10 09:51:52 +08:00
2026-01-10 15:08:11 +08:00
2026-01-12 17:43:12 +08:00
2026-01-12 15:44:23 +08:00
2026-01-12 16:01:53 +08:00
2026-01-13 15:47:32 +08:00
2026-01-13 16:52:37 +08:00
2026-01-14 10:53:42 +08:00
2026-01-14 17:00:30 +08:00
2026-01-14 12:15:57 +08:00
2026-01-15 18:15:17 +08:00
2026-01-15 18:15:17 +08:00
2026-01-16 18:15:32 +08:00
2026-01-21 18:20:44 +08:00
2026-01-21 18:20:44 +08:00
2026-01-21 18:20:44 +08:00
2026-01-21 18:20:44 +08:00
2026-01-21 18:20:44 +08:00
2026-01-21 18:20:44 +08:00
2026-01-21 18:20:44 +08:00
2026-01-21 18:20:44 +08:00
2026-01-22 14:38:43 +08:00
2026-01-22 18:27:42 +08:00