将账号、认证、管理员、分析、自动化、卡券、聊天、商品、关键词、设置和订单能力迁移到 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_*。
32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
package adapter
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
automationapp "xianyu-go/internal/application/automation"
|
|
"xianyu-go/internal/db"
|
|
)
|
|
|
|
// AutomationCredentialWakeRepository 将自动化任务唤醒 Port 适配为数据库仓储。
|
|
type AutomationCredentialWakeRepository struct {
|
|
// store 保存自动化任务数据库仓储入口。
|
|
store *db.Store
|
|
}
|
|
|
|
// NewAutomationCredentialWakeRepository 构造自动化凭证唤醒数据库适配器。
|
|
func NewAutomationCredentialWakeRepository(store *db.Store) *AutomationCredentialWakeRepository {
|
|
return &AutomationCredentialWakeRepository{store: store}
|
|
}
|
|
|
|
// WakeCredentialBlocked 唤醒指定账号因凭证失效而暂停的自动化任务。
|
|
func (r *AutomationCredentialWakeRepository) WakeCredentialBlocked(ctx context.Context, accountID string) error {
|
|
if r == nil || r.store == nil || r.store.Automation == nil {
|
|
return errors.New("自动化任务存储未初始化")
|
|
}
|
|
return r.store.Automation.WakeCredentialBlocked(ctx, accountID)
|
|
}
|
|
|
|
// 确保数据库适配器覆盖凭证恢复唤醒应用 Port。
|
|
var _ automationapp.CredentialWakeRepository = (*AutomationCredentialWakeRepository)(nil)
|