重构:统一应用服务与基础设施适配边界
将账号、认证、管理员、分析、自动化、卡券、聊天、商品、关键词、设置和订单能力迁移到 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:
1 parent
19a7d5f924
commit
375e84d663
239 files changed
+23870
-7871
No files matched your search
@@ -316,28 +316,10 @@ func TestPublishBatchHelpers(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestParsePublishCardActions 负责TestParse发布卡密动作列表相关处理。
|
||||
func TestParsePublishCardActions(t *testing.T) {
|
||||
// actions、parseErr 保存actions、parseErr,供当前处理流程使用
|
||||
actions, parseErr := parsePublishCardActions("101:1:0; 102:2:3")
|
||||
if parseErr != "" {
|
||||
t.Fatalf("parsePublishCardActions: %s", parseErr)
|
||||
}
|
||||
if len(actions) != 2 {
|
||||
t.Fatalf("actions=%+v", actions)
|
||||
}
|
||||
if actions[0].CardID != 101 || actions[0].DeliveryCount != 1 || actions[0].DelaySeconds != 0 {
|
||||
t.Fatalf("actions[0]=%+v", actions[0])
|
||||
}
|
||||
if actions[1].CardID != 102 || actions[1].DeliveryCount != 2 || actions[1].DelaySeconds != 3 {
|
||||
t.Fatalf("actions[1]=%+v", actions[1])
|
||||
}
|
||||
if // parseErr 保存parseErr,供当前处理流程使用
|
||||
_, parseErr := parsePublishCardActions("101:0"); parseErr == "" {
|
||||
t.Fatal("每件份数为0时应返回格式错误")
|
||||
}
|
||||
if // got 保存got,供当前处理流程使用
|
||||
got := normalizePublishHeader("付款后发送的卡密"); got != "paid_delivery_contents" {
|
||||
// TestNormalizePublishCardHeader 验证批量发布卡密字段的历史表头兼容映射。
|
||||
func TestNormalizePublishCardHeader(t *testing.T) {
|
||||
// got 表示历史中文表头归一化后的字段名。
|
||||
if got := normalizePublishHeader("付款后发送的卡密"); got != "paid_delivery_contents" {
|
||||
t.Fatalf("normalizePublishHeader=%q", got)
|
||||
}
|
||||
}
|
||||
@@ -361,23 +343,6 @@ func TestNormalizePublishHeaderCategoryFallbackLabels(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestParsePublishAutomationSupportsMultipleCards 负责TestParse发布自动化SupportsMultiple卡密列表相关处理。
|
||||
func TestParsePublishAutomationSupportsMultipleCards(t *testing.T) {
|
||||
// cfg 保存cfg,供当前处理流程使用
|
||||
cfg := parsePublishAutomation(map[string]any{
|
||||
"paid_delivery_enabled": "是",
|
||||
"paid_delivery_contents": "101:1:0;102:2:0",
|
||||
"review_gift_enabled": "true",
|
||||
"review_gift_contents": "201:1",
|
||||
})
|
||||
if !cfg.PaidDelivery.Enabled || len(cfg.PaidDelivery.Actions) != 2 {
|
||||
t.Fatalf("paid delivery=%+v", cfg.PaidDelivery)
|
||||
}
|
||||
if !cfg.ReviewGift.Enabled || len(cfg.ReviewGift.Actions) != 1 {
|
||||
t.Fatalf("review gift=%+v", cfg.ReviewGift)
|
||||
}
|
||||
}
|
||||
|
||||
// TestPublicIPValidation 负责TestPublicIPValidation相关处理。
|
||||
func TestPublicIPValidation(t *testing.T) {
|
||||
// raw 表示当前遍历过程中的原始
|
||||
|
||||
Reference in new issue
Block a user