Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -15,6 +15,8 @@ func (a *API) PreCreateOrder(preOrder *PreCreateOrderReq) (price float64, err er
|
|||||||
preOrder.PushTime = time.Now().Unix()
|
preOrder.PushTime = time.Now().Unix()
|
||||||
preOrder.DevId = a.devId
|
preOrder.DevId = a.devId
|
||||||
resp := a.HttpPostJson("precreateorder", preOrder)
|
resp := a.HttpPostJson("precreateorder", preOrder)
|
||||||
|
globals.SugarLogger.Debugf("sfps PreCreateOrder:preOrder=%s", utils.Format4Output(preOrder, false))
|
||||||
|
globals.SugarLogger.Debugf("sfps PreCreateOrder:resp=%s", utils.Format4Output(resp, false))
|
||||||
if resp.HttpStatusCode != HttpStatusSuccessCode {
|
if resp.HttpStatusCode != HttpStatusSuccessCode {
|
||||||
return 0, errors.New("HTTP请求错误,请检查重试")
|
return 0, errors.New("HTTP请求错误,请检查重试")
|
||||||
}
|
}
|
||||||
@@ -36,8 +38,9 @@ func (a *API) CreateOrder(order *CreateOrderReq) (sfOrderID, sfBillID string, to
|
|||||||
order.PushTime = time.Now().Unix()
|
order.PushTime = time.Now().Unix()
|
||||||
order.Version = DefaultVersion
|
order.Version = DefaultVersion
|
||||||
order.DevId = a.devId
|
order.DevId = a.devId
|
||||||
globals.SugarLogger.Debugf("CreateOrder req=%s", utils.Format4Output(order, false))
|
globals.SugarLogger.Debugf("sfps CreateOrder req=%s", utils.Format4Output(order, false))
|
||||||
resp := a.HttpPostJson("createorder", order)
|
resp := a.HttpPostJson("createorder", order)
|
||||||
|
globals.SugarLogger.Debugf("sfps CreateOrder:resp=%s", utils.Format4Output(resp, false))
|
||||||
if resp.HttpStatusCode != HttpStatusSuccessCode {
|
if resp.HttpStatusCode != HttpStatusSuccessCode {
|
||||||
return "", "", 0, 0, errors.New("HTTP请求错误,请检查重试")
|
return "", "", 0, 0, errors.New("HTTP请求错误,请检查重试")
|
||||||
}
|
}
|
||||||
@@ -62,6 +65,8 @@ func (a *API) PreCancelOrder(sfOrderID string) (deductionFee float64, err error)
|
|||||||
PushTime: time.Now().Unix(),
|
PushTime: time.Now().Unix(),
|
||||||
}
|
}
|
||||||
resp := a.HttpPostJson("precancelorder", param)
|
resp := a.HttpPostJson("precancelorder", param)
|
||||||
|
globals.SugarLogger.Debugf("sfps precancelorder:param=%s", utils.Format4Output(param, false))
|
||||||
|
globals.SugarLogger.Debugf("sfps precancelorder:resp=%s", utils.Format4Output(resp, false))
|
||||||
if resp.HttpStatusCode != HttpStatusSuccessCode {
|
if resp.HttpStatusCode != HttpStatusSuccessCode {
|
||||||
return 0, errors.New("HTTP请求错误,请检查重试")
|
return 0, errors.New("HTTP请求错误,请检查重试")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const (
|
|||||||
FailCode = -1
|
FailCode = -1
|
||||||
FailMsg = "fail"
|
FailMsg = "fail"
|
||||||
//SFShopStoreID = "3263670062849" //测试店铺ID
|
//SFShopStoreID = "3263670062849" //测试店铺ID
|
||||||
SFShopStoreID = "3270246375697" //正式店铺ID
|
SFShopStoreID = "3270357468929" //正式店铺ID
|
||||||
DefaultVersion = 19 //参照文档主版本号填写 如:文档版本号1.9,version=19,推荐使用版本19
|
DefaultVersion = 19 //参照文档主版本号填写 如:文档版本号1.9,version=19,推荐使用版本19
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ type PreCreateOrderReq struct {
|
|||||||
type PreCreateOrderResp struct {
|
type PreCreateOrderResp struct {
|
||||||
ChargePriceList *ChargePriceList `json:"charge_price_list"`
|
ChargePriceList *ChargePriceList `json:"charge_price_list"`
|
||||||
DeliveryType float64 `json:"delivery_type"` //0:预约送达单 1:立即单 3:预约上门单
|
DeliveryType float64 `json:"delivery_type"` //0:预约送达单 1:立即单 3:预约上门单
|
||||||
EstimateCouponDetail []interface{} `json:"estimate_coupon_detail"`
|
EstimateCouponDetail interface{} `json:"estimate_coupon_detail"`
|
||||||
EstimateCouponTotalFee float64 `json:"estimate_coupon_total_fee"`
|
EstimateCouponTotalFee float64 `json:"estimate_coupon_total_fee"`
|
||||||
EstimatePayMoney float64 `json:"estimate_pay_money"`
|
EstimatePayMoney float64 `json:"estimate_pay_money"`
|
||||||
ExpectTime float64 `json:"expect_time"`
|
ExpectTime float64 `json:"expect_time"`
|
||||||
|
|||||||
Reference in New Issue
Block a user