- fix unittest bug caused by sugarLogger.
This commit is contained in:
@@ -192,13 +192,13 @@ func (m *MTPSAPI) AccessMTPS(action string, params map[string]interface{}) (retV
|
||||
retVal = &MTPSResult{
|
||||
Code: code,
|
||||
}
|
||||
baseapi.SugarLogger.Debug(jsonResult1)
|
||||
if code == ResponseCodeSuccess {
|
||||
if innerData, ok := jsonResult1["data"]; ok {
|
||||
retVal.Data, _ = innerData.(map[string]interface{})
|
||||
}
|
||||
return common.PAErrorLevelSuccess, nil
|
||||
}
|
||||
baseapi.SugarLogger.Debug(jsonResult1)
|
||||
retVal.Message = jsonResult1["message"].(string)
|
||||
return common.PAErrorLevelGeneralFail, utils.NewErrorIntCode(retVal.Message, code)
|
||||
})
|
||||
@@ -216,20 +216,20 @@ func (m *MTPSAPI) result2OrderResponse(result *MTPSResult) (order *MtpsOrderResp
|
||||
|
||||
func (m *MTPSAPI) CreateOrderByShop(basicParams *MtpsCreateOrderByShopInfo, addParams map[string]interface{}) (order *MtpsOrderResponse, err error) {
|
||||
params := make(map[string]interface{})
|
||||
params["delivery_id"] = utils.Int64ToStr(basicParams.DeliveryId)
|
||||
params["delivery_id"] = basicParams.DeliveryId
|
||||
params["order_id"] = basicParams.OrderId
|
||||
params["shop_id"] = basicParams.ShopId
|
||||
params["delivery_service_code"] = utils.Int2Str(basicParams.DeliveryServiceCode)
|
||||
params["delivery_service_code"] = basicParams.DeliveryServiceCode
|
||||
params["receiver_name"] = basicParams.ReceiverName
|
||||
params["receiver_address"] = basicParams.ReceiverAddress
|
||||
params["receiver_phone"] = basicParams.ReceiverPhone
|
||||
params["receiver_lng"] = utils.Int2Str(basicParams.ReceiverLng)
|
||||
params["receiver_lat"] = utils.Int2Str(basicParams.ReceiverLat)
|
||||
params["coordinate_type"] = utils.Int2Str(basicParams.CoordinateType)
|
||||
params["receiver_lng"] = basicParams.ReceiverLng
|
||||
params["receiver_lat"] = basicParams.ReceiverLat
|
||||
params["coordinate_type"] = basicParams.CoordinateType
|
||||
params["goods_value"] = strconv.FormatFloat(basicParams.GoodsValue, 'f', 2, 64)
|
||||
params["goods_weight"] = strconv.FormatFloat(basicParams.GoodsWeight, 'f', 2, 64)
|
||||
params["expected_delivery_time"] = utils.Int64ToStr(basicParams.ExpectedDeliveryTime)
|
||||
params["order_type"] = utils.Int2Str(basicParams.OrderType)
|
||||
params["expected_delivery_time"] = basicParams.ExpectedDeliveryTime
|
||||
params["order_type"] = basicParams.OrderType
|
||||
if addParams != nil {
|
||||
for k, v := range addParams {
|
||||
params[k] = v
|
||||
|
||||
Reference in New Issue
Block a user