refactor(*): 平台架构 - 拆分后端领域模块并同步插件协议与模型能力

This commit is contained in:
ddCat committed 2026-09-11 14:02:49 +08:00
1 parent 916043fb5a
commit 6e5cbc8b05
644 files changed
+62731 -2320

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package app
import "testing"
func TestIsTextReplayTaskRequest(t *testing.T) {
cases := []struct {
name string
input map[string]any
want bool
}{
{"replay 布尔 true", map[string]any{"replay": true}, true},
{"replay 字符串 true", map[string]any{"replay": "true"}, true},
{"replay 字符串 True 大小写", map[string]any{"replay": "TRUE"}, true},
{"replay 布尔 false", map[string]any{"replay": false}, false},
{"无 replay 字段", map[string]any{"mode": "text"}, false},
{"replay 空字符串", map[string]any{"replay": ""}, false},
{"replay 数字", map[string]any{"replay": 1}, false},
{"replay nil", map[string]any{"replay": nil}, false},
}
for _, tc := range cases {
if got := isTextReplayTaskRequest(tc.input); got != tc.want {
t.Errorf("%s: isTextReplayTaskRequest(%v) = %v, want %v", tc.name, tc.input, got, tc.want)
}
}
}