From 18ceb8a077384cebd0a0aca95279ec54c9979d31 Mon Sep 17 00:00:00 2001 From: timerzz Date: Wed, 20 Nov 2024 21:14:15 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B7=BB=E5=8A=A0ImageGroups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/coach-client/client_us.go | 16 +++++++++------- pkg/coach-client/client_us_test.go | 5 +++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pkg/coach-client/client_us.go b/pkg/coach-client/client_us.go index 50f2ca5..b94116d 100644 --- a/pkg/coach-client/client_us.go +++ b/pkg/coach-client/client_us.go @@ -99,13 +99,14 @@ func (c *US) RequestInventory(ctx context.Context, pid string) (inv Inventory, e } type ProductData struct { - Id string `json:"id"` - Name string `json:"name"` - Brand string `json:"brand"` - Inventory Inventory `json:"inventory"` - Url string `json:"url"` - MasterId string `json:"masterId"` - Prices struct { + Id string `json:"id"` + Name string `json:"name"` + Brand string `json:"brand"` + Inventory Inventory `json:"inventory"` + Url string `json:"url"` + MasterId string `json:"masterId"` + ImageGroups []ImageGroup `json:"imageGroups"` + Prices struct { CurrentPrice float64 `json:"currentPrice"` } `json:"prices"` Remark string `json:"-"` @@ -147,6 +148,7 @@ type PageDataResponse struct { Products []Product `json:"products"` } `json:"pageData"` } + type Product struct { Name string `json:"name"` Colors []Color `json:"colors"` diff --git a/pkg/coach-client/client_us_test.go b/pkg/coach-client/client_us_test.go index dd792c7..f49f3b7 100644 --- a/pkg/coach-client/client_us_test.go +++ b/pkg/coach-client/client_us_test.go @@ -2,15 +2,16 @@ package coach_client import ( "context" - "gitea.timerzz.com/kedaya_haitao/common/pkg/proxy" "testing" + + "gitea.timerzz.com/kedaya_haitao/common/pkg/proxy" ) func TestClient(t *testing.T) { subs := []string{"https://us.timerzz.com:26106/vmess/sub"} pool := proxy.NewProxyPool(subs) client := USClient(pool) - resp, err := client.ViewAllBags(context.Background(), 1) + resp, err := client.RequestProductDetail(context.Background(), "CU808-CHK") if err != nil { t.Fatal(err) }