重构:统一应用服务与基础设施适配边界

将账号、认证、管理员、分析、自动化、卡券、聊天、商品、关键词、设置和订单能力迁移到 application 与 adapter,删除 Server 内对应的旧仓储和业务服务实现,并收紧架构检查。

完善批量发布与订单刷新生命周期、凭证写回、账号任务补偿、订单 reconciliation、通知和敏感数据边界;补充正常、失败、取消、并发、越权及多方言回归测试,并修正 MySQL 延迟任务表的 InnoDB 配置。

修复空卡密响应为 null 时前端加载失败的问题,重建嵌入式前端资产;重写重构总计划,清除历史流水并明确阶段 1 至 10 各对应一次完整迭代和一个 PR。

验证:make check;make test-server-race;npm test/typecheck/comments:check/build;Docker SQLite/MySQL 8.4/PostgreSQL 17 TestMultiDB_*。
This commit is contained in:
Christ committed 2026-08-16 23:51:06 +08:00
1 parent 19a7d5f924
commit 375e84d663
239 files changed
+23870 -7871

No files matched your search

@@ -70,6 +70,13 @@ type ManualShipRepository interface {
UpsertOrder(ctx context.Context, orderID string, options UpsertOptions) error
}
// ReconciliationRecorder 定义外部订单动作成功后创建补偿记录的最小应用 Port。
// 该接口由订单应用层声明,由基础设施适配器实现,避免应用层暴露数据库模型。
type ReconciliationRecorder interface {
// RecordReconciliation 创建外部成功、本地状态待补偿的记录。
RecordReconciliation(ctx context.Context, orderID, cookieID, kind, message string) (string, error)
}
// ManualShipRuntime 定义手动发货访问平台、自动化、运行时和补偿能力的最小 Port。
type ManualShipRuntime interface {
// MTopAvailable 判断平台客户端是否已装配。
@@ -86,8 +93,8 @@ type ManualShipRuntime interface {
UpdateRunningCookie(ctx context.Context, cookieID, value string)
// NotifyDelivery 发送手动发货结果通知。
NotifyDelivery(cookieID, buyerID, itemID, chatID, message string)
// RecordReconciliation 创建外部成功、本地状态待补偿的记录。
RecordReconciliation(ctx context.Context, orderID, cookieID, kind, message string) (string, error)
// ReconciliationRecorder 嵌入外部动作成功后的补偿记录能力。
ReconciliationRecorder
// ReportPersistenceFailure 记录本地订单状态持久化失败。
ReportPersistenceFailure(orderID string, err error)
}