- big big refactor.
This commit is contained in:
53
platformapi/jdapi/order.go
Normal file
53
platformapi/jdapi/order.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package jdapi
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
OrderStatusNew = "32000"
|
||||
OrderStatusAdjust = "33080"
|
||||
OrderStatusUserCancel = "20030"
|
||||
OrderStatusWaitOutStore = "32001"
|
||||
)
|
||||
|
||||
func (a API) OrderQuery(jdParams map[string]interface{}) (retVal []interface{}, err error) {
|
||||
retVal, err = a.AccessAPIHavePage("order/es/query", jdParams, nil, nil, nil)
|
||||
return
|
||||
}
|
||||
|
||||
func (a API) QuerySingleOrder(orderId string) ([]interface{}, error) {
|
||||
jdParams := make(map[string]interface{})
|
||||
jdParams["orderId"] = orderId
|
||||
return a.AccessAPIHavePage("order/es/query", jdParams, nil, nil, nil)
|
||||
}
|
||||
|
||||
func (a API) LegacyQuerySingleOrder(orderId string) (map[string]interface{}, error) {
|
||||
jdParams := make(map[string]interface{})
|
||||
jdParams["orderId"] = orderId
|
||||
|
||||
result, err := a.AccessAPI("order/es/query", jdParams)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dataStr, _ := result["data"].(string)
|
||||
var data map[string]interface{}
|
||||
utils.UnmarshalUseNumber([]byte(dataStr), &data)
|
||||
result["data"] = data
|
||||
|
||||
var dataResult map[string]interface{}
|
||||
utils.UnmarshalUseNumber([]byte(data["result"].(string)), &dataResult)
|
||||
data["result"] = dataResult
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (a API) OrderAcceptOperate(orderId string, isAgreed bool) (interface{}, error) {
|
||||
jdParams := map[string]interface{}{
|
||||
"orderId": orderId,
|
||||
"isAgreed": utils.Bool2String(isAgreed),
|
||||
"operator": utils.GetAPIOperator(),
|
||||
}
|
||||
return a.AccessAPINoPage("ocs/orderAcceptOperate", jdParams, nil, nil)
|
||||
}
|
||||
Reference in New Issue
Block a user