1
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user