This commit is contained in:
richboo111
2023-09-08 17:33:48 +08:00
parent 419df0dc52
commit 678545131a
2 changed files with 11 additions and 7 deletions

View File

@@ -147,17 +147,21 @@ func (a *API) GetCallbackUrlIndex(request *http.Request) (map[string]interface{}
}
var (
urlIndex = ""
temp = map[string]interface{}{}
urlIndex = ""
orderStatus float64
temp = map[string]interface{}{}
)
if err = json.Unmarshal(data, &temp); err == nil {
globals.SugarLogger.Debugf("GetCallbackUrlIndex temp=%s", utils.Format4Output(temp, false))
urlIndex = temp["url_index"].(string)
fmt.Println(urlIndex)
orderStatus = temp["order_status"].(float64)
globals.SugarLogger.Debugf("GetCallbackUrlIndex urlIndex=%s,orderStatus=%d", urlIndex, orderStatus)
}
result := make(map[string]interface{}, 0)
if orderStatus == OrderStatusFinished {
urlIndex = UrlIndexOrderComplete
}
switch urlIndex {
case UrlIndexRiderStatus:
retVal := RiderStatus{}

View File

@@ -65,12 +65,12 @@ func TestCreateOrder(t *testing.T) {
DevId: AppID,
ShopId: TestSFStoreID,
ShopType: 1,
ShopOrderId: "20230908Test",
ShopOrderId: "20230908-2",
OrderSequence: "测试",
OrderSource: OrderSourceELM,
OrderTime: 1694163550,
OrderTime: 1694165402,
LbsType: LbsTypeGD,
PushTime: 1694163550,
PushTime: 1694165402,
Version: 19,
ReturnFlag: 511,
Receive: &ReceiveAddress{