138 lines
3.0 KiB
Go
138 lines
3.0 KiB
Go
package mtwmapi
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
func TestOrderViewStatus(t *testing.T) {
|
|
result, err := api.OrderViewStatus(33762863658107006)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(result)
|
|
}
|
|
|
|
func TestOrderGetOrderDetail(t *testing.T) {
|
|
result, err := api.OrderGetOrderDetail(73322892924405911, false)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(result) == 0 {
|
|
t.Fatal("result should have value")
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestOrderGetOrderDetail2(t *testing.T) {
|
|
result, err := api.OrderGetOrderDetail2(73322892924405911, false)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestOrderGetPartRefundFoods(t *testing.T) {
|
|
result, err := api.OrderGetPartRefundFoods(25236870562694625)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestOrderReceived(t *testing.T) {
|
|
err := api.OrderReceived(25236872740350976)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestOrderConfirm(t *testing.T) {
|
|
err := api.OrderConfirm(25236872740350976)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestOrderApplyPartRefund(t *testing.T) {
|
|
err := api.OrderApplyPartRefund(25236872740350976, "缺货", []*RefundSku{
|
|
&RefundSku{
|
|
AppFoodCode: "30831",
|
|
Count: 1,
|
|
},
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestOrderLogisticsStatus(t *testing.T) {
|
|
result, err := api.OrderLogisticsStatus(33762863658107006)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(result) == 0 {
|
|
t.Fatal("result should have value")
|
|
}
|
|
// t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestOrderBatchPullPhoneNumber(t *testing.T) {
|
|
result, err := api.OrderBatchPullPhoneNumber(testPoiCode, 0, MaxBatchPullPhoneNumberLimit)
|
|
t.Log(utils.Format4Output(result, false))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestOrderGetRiderInfoPhoneNumber(t *testing.T) {
|
|
result, err := api.OrderGetRiderInfoPhoneNumber(testPoiCode, 0, MaxBatchPullPhoneNumberLimit)
|
|
t.Log(utils.Format4Output(result, false))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestGetOrderRefundDetail(t *testing.T) {
|
|
result, err := api.GetOrderRefundDetail(25236870166465610, RefundTypePart)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestGetOrderActDetaill(t *testing.T) {
|
|
result, err := api.GetOrderActDetail([]*GetOrderActDetailParam{
|
|
&GetOrderActDetailParam{
|
|
OrderID: 69760842061320598,
|
|
// ActParam: []*GetOrderActDetailParamAct{
|
|
// &GetOrderActDetailParamAct{
|
|
// Type: 1,
|
|
// },
|
|
// },
|
|
},
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestGetOrderIdByDaySeq(t *testing.T) {
|
|
result, err := api.GetOrderIdByDaySeq("7111597", utils.Time2Date(time.Now()), 1, MaxGap4GetOrderIdByDaySeq)
|
|
t.Log(utils.Format4Output(result, false))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func TestGetOrderIdByDaySeqSingle(t *testing.T) {
|
|
result, err := api.GetOrderIdByDaySeqSingle("7111597", utils.Time2Date(time.Now()), 1)
|
|
t.Log(utils.Format4Output(result, false))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|