feat(规则): 支持名称代号,便于区分和管理

创建与更新规则时必填全局唯一 name,已有规则迁移回填为 rule-{id}。
This commit is contained in:
2026-08-17 00:01:34 +08:00
parent b3c42af53b
commit 0f9f154969
10 changed files with 76 additions and 13 deletions
+2
View File
@@ -116,6 +116,7 @@ func setupFixture(t *testing.T) *fixture {
})
rule := mustAdminJSON(t, client, base, adminKey, http.MethodPost, "/api/v1/rules", map[string]any{
"name": "e2e-rule-" + suffix,
"source_name": f.srcName,
"event": "trade.open",
"template_name": tmplName,
@@ -361,6 +362,7 @@ func TestNotifyFlow_DifferentTemplatesPerRule(t *testing.T) {
})
rule := mustAdminJSON(t, client, base, adminKey, http.MethodPost, "/api/v1/rules", map[string]any{
"name": "e2e-rule-" + r.event + "-" + suffix,
"source_name": srcName,
"event": r.event,
"template_name": tmplName,