fix: implement resource reconciliation and update handling in media supply favorites
Frontend CI / Frontend (push) Successful in 2m55s
Backend CI / Backend (push) Failing after 8m41s

This commit is contained in:
2026-06-23 23:34:45 +08:00
parent 04bd3e42e0
commit a406971187
6 changed files with 167 additions and 14 deletions
@@ -616,6 +616,38 @@ func TestDecodeMeijiequanMediaListAcceptsStringNumbers(t *testing.T) {
}
}
func TestMeijiequanListMediaKeepsRawItemCountForPaging(t *testing.T) {
client, cleanup := testMeijiequanClientWithUploadServer(t, func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/advSupply/media/getMediaInfo" {
http.NotFound(w, r)
return
}
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{
"status": "1",
"page": "1",
"all_page": "0",
"all_num": "0",
"data": [
{"id":"1","name":"有效媒体","sale_price":"12.5"},
{"id":"2","sale_price":"18.0"}
]
}`))
})
defer cleanup()
page, err := client.ListMedia(context.Background(), 1, 1, 2)
if err != nil {
t.Fatalf("list media: %v", err)
}
if page.RawItemCount != 2 {
t.Fatalf("expected raw count to include invalid upstream rows, got %d", page.RawItemCount)
}
if len(page.Items) != 1 {
t.Fatalf("expected only valid rows to be upserted, got %d", len(page.Items))
}
}
func TestDecodeMeijiequanSearchOptions(t *testing.T) {
groups, err := decodeMeijiequanSearchOptions([]byte(`{
"pindaoleixing": {"name": "频道类型", "list": ["IT科技", "财经金融"]},