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

将账号、认证、管理员、分析、自动化、卡券、聊天、商品、关键词、设置和订单能力迁移到 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

+2 -2
View File
@@ -6,7 +6,7 @@ import (
"github.com/go-chi/chi/v5/middleware"
"xianyu-go/internal/db"
accountapp "xianyu-go/internal/application/account"
"xianyu-go/internal/httpapi"
)
@@ -98,7 +98,7 @@ func writeErrDetails(w http.ResponseWriter, status int, code, msg, requestID str
// writeCredentialVerificationError 将当前密码校验失败区分为认证失败或内部故障。
func writeCredentialVerificationError(w http.ResponseWriter, err error) {
if errors.Is(err, db.ErrPasswordMismatch) {
if errors.Is(err, accountapp.ErrPasswordMismatch) {
writeErrCode(w, http.StatusUnauthorized, "authentication_failed", "当前密码错误", "")
return
}