From b09025c0c345fbd2985265205955c2c8ce65d425 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Sat, 14 Jan 2023 09:55:15 +0800 Subject: [PATCH] 1 --- platformapi/uuptapi/uupt_test.go | 17 ++++++++--------- platformapi/uuptapi/uuptapi.go | 9 +-------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/platformapi/uuptapi/uupt_test.go b/platformapi/uuptapi/uupt_test.go index 9d50b923..05b701e7 100644 --- a/platformapi/uuptapi/uupt_test.go +++ b/platformapi/uuptapi/uupt_test.go @@ -43,19 +43,18 @@ func init() { //计算运单价格 func TestGetWaybillPrice(t *testing.T) { param := &GetOrderPriceReq{ - OriginID: "T00001", - FromAddress: "郑州国际会展中心", - ToAddress: "商务外环路17号", - CityName: "郑州市", + OriginID: "T20230114M", + FromAddress: "万科加州湾V派", + ToAddress: "嘉华酒店", + CityName: "成都市", SendType: "0", - ToLat: "34.784275", - ToLng: "113.736445", - FromLat: "34.778494", - FromLng: "113.736858", + ToLat: "30.691134", + ToLng: "104.042307", + FromLat: "30.693001", + FromLng: "104.04546", } price := utils.Struct2Map(param, "", false) needPayMoney, priceToken, err := api.GetOrderPrice(price) - fmt.Println(needPayMoney, priceToken, err) } diff --git a/platformapi/uuptapi/uuptapi.go b/platformapi/uuptapi/uuptapi.go index 43011599..0da22d5b 100644 --- a/platformapi/uuptapi/uuptapi.go +++ b/platformapi/uuptapi/uuptapi.go @@ -55,16 +55,9 @@ func (a *API) signParam(params map[string]interface{}) (sign string) { for k, v := range params { if k != signKey { temp := fmt.Sprint(v) - if k == "goods_weight" && temp == "0" { + if (k == "goods_weight" || k == "shop_id" || k == "goods_price") && temp == "0" { continue } - if k == "shop_id" && temp == "0" { - continue - } - if k == "goods_price" && temp == "0" { - continue - } - if temp != "" { keyValues = append(keyValues, k+"="+temp) }