1
This commit is contained in:
@@ -14,13 +14,28 @@ func TestShippingSave(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestShippingList(t *testing.T) {
|
||||
result, err := api.ShippingList("7996691")
|
||||
result, err := api.ShippingList("32054188")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
shippingList := make([]ShippingList, 0, 0)
|
||||
for _, v := range result {
|
||||
shippingList = append(shippingList, ShippingList{
|
||||
TimeRange: utils.Interface2String(v["time_range"]),
|
||||
MinPrice: utils.MustInterface2Float64(v["min_price"]),
|
||||
ShippingFee: utils.MustInterface2Float64(v["shipping_fee"]),
|
||||
})
|
||||
}
|
||||
t.Log(utils.Format4Output(shippingList, false))
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
type ShippingList struct {
|
||||
TimeRange string `json:"time_range"` // 配送生效时间范围
|
||||
MinPrice float64 `json:"min_price"` // 最小起送价
|
||||
ShippingFee float64 `json:"shipping_fee"` // 配送费
|
||||
}
|
||||
|
||||
func TestShippingFetch(t *testing.T) {
|
||||
result, err := api.ShippingFetch("7963096")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user