feat(seckill): 增加只读预演并强化代理风控切换

This commit is contained in:
yml
2026-11-22 14:52:46 +08:00
parent 70612a8f0c
commit e20907800d
20 changed files with 1916 additions and 40 deletions
+12
View File
@@ -16,6 +16,18 @@ import (
"douyu_go/internal/types"
)
func TestOrderErrorIncludesCode(t *testing.T) {
err := (&OrderError{
Kind: "锁定兑换商品失败",
Code: 1644400007,
Msg: "活动火爆,请稍后再试",
}).Error()
want := "锁定兑换商品失败(error=1644400007): 活动火爆,请稍后再试"
if err != want {
t.Fatalf("OrderError.Error()=%q, want %q", err, want)
}
}
func TestGenerateCSRFUseCTNReusesCookie(t *testing.T) {
var called atomic.Bool
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {