Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -14,10 +14,15 @@ type RidderCancelNotify struct {
|
|||||||
|
|
||||||
type RidderCancelConfirm struct {
|
type RidderCancelConfirm struct {
|
||||||
OrderID string `json:"orderId"`
|
OrderID string `json:"orderId"`
|
||||||
DadaOrderID int64 `json:"dadaOrderId"`
|
DadaOrderID int64 `json:"dadaOrderId,omitempty"`
|
||||||
IsConfirm int `json:"isConfirm"`
|
IsConfirm int `json:"isConfirm"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ConfirmMsg struct {
|
||||||
|
MessageType int `json:"messageType"`
|
||||||
|
MessageBody string `json:"messageBody"`
|
||||||
|
}
|
||||||
|
|
||||||
type NotifyMsg struct {
|
type NotifyMsg struct {
|
||||||
MessageType int `json:"messageType"`
|
MessageType int `json:"messageType"`
|
||||||
MessageBody string `json:"messageBody"`
|
MessageBody string `json:"messageBody"`
|
||||||
@@ -49,10 +54,13 @@ func (a *API) GetNotifyMsg(data []byte) (msg *NotifyMsg, notifyResponse *NotifyR
|
|||||||
// 消息确认
|
// 消息确认
|
||||||
// http://newopen.imdada.cn/#/development/file/merchantConfirm?_k=gqkja3
|
// http://newopen.imdada.cn/#/development/file/merchantConfirm?_k=gqkja3
|
||||||
func (a *API) ConfirmRidderCancel(orderID string, dadaOrderID int64, isConfirm bool) (err error) {
|
func (a *API) ConfirmRidderCancel(orderID string, dadaOrderID int64, isConfirm bool) (err error) {
|
||||||
_, err = a.AccessAPI("message/confirm", utils.Struct2FlatMap(&RidderCancelConfirm{
|
_, err = a.AccessAPI("api/message/confirm", utils.Struct2FlatMap(&ConfirmMsg{
|
||||||
OrderID: orderID,
|
MessageType: MessageTypeRidderCancel,
|
||||||
DadaOrderID: dadaOrderID,
|
MessageBody: string(utils.MustMarshal(&RidderCancelConfirm{
|
||||||
IsConfirm: utils.Bool2Int(isConfirm),
|
OrderID: orderID,
|
||||||
|
DadaOrderID: dadaOrderID,
|
||||||
|
IsConfirm: utils.Bool2Int(isConfirm),
|
||||||
|
})),
|
||||||
}))
|
}))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
12
platformapi/dadaapi/notify_test.go
Normal file
12
platformapi/dadaapi/notify_test.go
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package dadaapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestConfirmRidderCancel(t *testing.T) {
|
||||||
|
err := dadaapi.ConfirmRidderCancel("2123286796685127885", 0, true)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user