package goods_add import ( "ai_scheduler/internal/config" "context" "fmt" "testing" ) // Test_Call func Test_Call(t *testing.T) { req := &GoodsAddRequest{ Unit: "元", IsComposeGoods: 2, GoodsAttributes: "

商品规格参数

", Introduction: "

商品卖点

", GoodsIllustration: "

商品说明

", IsHot: 2, Title: "fu测试001", GoodsNum: "futest001sku", SpuCode: "futest001spu", SpuName: "fu测试001", Price: 100, SalesPrice: 80, Discount: 15, TaxRate: 13, FreightId: 3, Remark: "备注说明", SellByDate: 180, ExternalPrice: 120, GoodsBarCode: "futest001code2", GoodsCode: "futest001code1", SellByDateUnit: "天", BrandId: 3, ExternalUrl: "https://www.baidu.com", } cfg := config.ToolConfig{ BaseURL: "https://gateway.dev.cdlsxd.cn/goods-admin/api/v1/goods/add", } client := New(cfg) toolResp, err := client.Call(context.Background(), req) if err != nil { t.Errorf("Call() error = %v", err) return } fmt.Printf("toolResp: %v\n", toolResp) }