fix(server-go): 巡检 roomId UUID 校验(400);文档更新

This commit is contained in:
weijuesen
2026-08-12 16:57:22 +08:00
parent 210bd6cefb
commit 22b6179c85
4 changed files with 75 additions and 0 deletions
@@ -0,0 +1,21 @@
package handler
import "testing"
func TestIsUUID(t *testing.T) {
valid := []string{
"1271e550-ccf1-443e-8964-980c6047e2f0",
"00000000-0000-0000-0000-000000000000",
}
invalid := []string{"smoke-room", "", "not-a-uuid", "1271e550ccf1443e8964980c6047e2f0"}
for _, s := range valid {
if !isUUID(s) {
t.Errorf("%q 应为合法 UUID", s)
}
}
for _, s := range invalid {
if isUUID(s) {
t.Errorf("%q 不应被当作 UUID", s)
}
}
}