refactor: automation 中心落地 + 清理 delivery_rules/SystemMessage 死代码
把卡密自动发货从 engine.DeliveryService 收敛到统一的 automation.Center: WS 事件/计划任务/手动触发统一为 Task,trigger_key 持久化防重,付款发货、 评价赠品、超时求评价共用一套规则+动作编排。新增 internal/automation 包、 db.AutomationRules repository、00007 迁移。 同步删除被取代的并行死系统: - engine.DeliveryService + delivery_test.go(已无引用) - db.DeliveryRules/DeliveryRule + 3 个 Match 方法(生产零调用) - card_handlers 的 /delivery-rules CRUD(前端早已只走 automation-rules) - engine.SystemMessage + extractSystemMessage(dispatch 不再单独路由 message["3"]) - store.DeliveryRules 字段、Cards.IncrementDeliveryTimes - 00008 迁移 DROP delivery_rules/delivery_rule_variants + email_verifications/ captcha_codes/ai_item_cache/risk_control_logs + publish 批次 3 个死列 - isAPIPath 清理 ~15 个未挂载的前缀,stub_handlers.go 内联删除 - vite.config 删 /delivery-rules proxy 其它:orders.Upsert 注释改为诚实描述(version 列不参与并发控制); dispatch.cleanupDedupLocked 用 sort.Slice 取代 O(n²) 选择排序; 删自定义 min 用内置;deliveryRuleItemOwned 改名 itemOwnedByUser。 Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
5546494577
commit
57f9090dd2
29 files changed
+2469
-2382
No files matched your search
@@ -11,6 +11,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"xianyu-go/internal/account"
|
||||
"xianyu-go/internal/automation"
|
||||
"xianyu-go/internal/db"
|
||||
"xianyu-go/internal/engine"
|
||||
)
|
||||
@@ -53,7 +54,7 @@ func (f roundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
type noopHandler struct{}
|
||||
|
||||
func (noopHandler) HandleChatMessage(context.Context, engine.ChatMessage) error { return nil }
|
||||
func (noopHandler) HandleSystemMessage(context.Context, engine.SystemMessage) error { return nil }
|
||||
func (noopHandler) HandleSystemEvent(context.Context, automation.Task) error { return nil }
|
||||
func (noopHandler) OnPasswordLoginRefresh(context.Context, string) bool { return false }
|
||||
|
||||
// TestLoginVerifyLogout 登录→verify→登出 全链路。
|
||||
|
||||
Reference in new issue
Block a user