feat: 统一蝦皮与顺运宝 PDD 关联入口 (#68)

This commit is contained in:
chengma
2026-08-09 22:40:58 +08:00
parent eb0e296b7c
commit 518e6df349
14 changed files with 429 additions and 98 deletions
+18
View File
@@ -38,6 +38,24 @@ func assertRedirectQuery(t *testing.T, recorder *httptest.ResponseRecorder, want
}
func Test列表写操作跳转保留筛选和页码(t *testing.T) {
t.Run("蝦皮", func(t *testing.T) {
context, recorder := listPostContext(t, "/shopee/save", url.Values{
"list_goods_id": {"1001"}, "status": {"no_link"}, "page": {"2"},
})
(&Handler{}).shopeeRedirect(context, "完成")
assertRedirectQuery(t, recorder, "/shopee", map[string]string{
"goods_id": "1001", "status": "no_link", "page": "2", "msg": "完成",
})
})
t.Run("顺运宝", func(t *testing.T) {
context, recorder := listPostContext(t, "/syb/associate-pdd", url.Values{
"order_no": {"SYB-1"}, "stage": {"pdd_missing"}, "page": {"3"},
})
(&Handler{}).sybRedirect(context, "完成")
assertRedirectQuery(t, recorder, "/syb", map[string]string{
"order_no": "SYB-1", "stage": "pdd_missing", "page": "3", "msg": "完成",
})
})
t.Run("PDD", func(t *testing.T) {
context, recorder := listPostContext(t, "/pdd/delete", url.Values{
"q": {"737"}, "status": {"pending"}, "page": {"3"},