1
This commit is contained in:
@@ -26,7 +26,7 @@ func init() {
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_kYOJ_jIKPYCvQgkDdCJMug") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_kYOJ_jIKPYCvQgkDdCJMug") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
cookieStr := `
|
||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
`
|
||||
|
||||
@@ -506,39 +506,6 @@ func (a *API) OrderGetOrderDetail(orderID int64, isMTLogistics bool) (orderInfo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a *API) OrderGetOrderDetail2(orderID int64, isMTLogistics bool) (orderInfo *OrderInfo, err error) {
|
||||
orderMap, err := a.OrderGetOrderDetail(orderID, isMTLogistics)
|
||||
if err == nil {
|
||||
if err = utils.Map2StructByJson(orderMap, &orderInfo, false); err == nil {
|
||||
if orderInfo.Detail != "" {
|
||||
err = utils.UnmarshalUseNumber([]byte(orderInfo.Detail), &orderInfo.DetailList)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if orderInfo.Extras != "" {
|
||||
err = utils.UnmarshalUseNumber([]byte(orderInfo.Extras), &orderInfo.ExtraList)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if orderInfo.SkuBenefitDetail != "" {
|
||||
err = utils.UnmarshalUseNumber([]byte(orderInfo.SkuBenefitDetail), &orderInfo.SkuBenefitDetailList)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if orderInfo.PoiReceiveDetail != "" {
|
||||
err = utils.UnmarshalUseNumber([]byte(orderInfo.PoiReceiveDetail), &orderInfo.PoiReceiveDetailPtr)
|
||||
}
|
||||
}
|
||||
}
|
||||
return orderInfo, err
|
||||
}
|
||||
|
||||
func (a *API) OrderGetPartRefundFoods(orderID int64) (canRefundFoodList []*CanRefundFoodInfo, err error) {
|
||||
params := map[string]interface{}{
|
||||
KeyOrderID: orderID,
|
||||
|
||||
@@ -30,7 +30,7 @@ func getTimeFromTimestamp(timeStamp int64) time.Time {
|
||||
}
|
||||
|
||||
func TestOrderGetOrderDetail(t *testing.T) {
|
||||
result, err := api.OrderGetOrderDetail(601120932924530076, false)
|
||||
result, err := api.OrderGetOrderDetail(301135342863962437, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -53,14 +53,6 @@ func StandardPrice2Int2(value float64) int64 {
|
||||
return int64(math.Round(value * 100))
|
||||
}
|
||||
|
||||
func TestOrderGetOrderDetail2(t *testing.T) {
|
||||
result, err := api.OrderGetOrderDetail2(1100687990339131759, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestOrderGetPartRefundFoods(t *testing.T) {
|
||||
result, err := api.OrderGetPartRefundFoods(93475541926981203)
|
||||
if err != nil {
|
||||
@@ -150,7 +142,15 @@ func TestOrderGetRiderInfoPhoneNumber(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetOrderRefundDetail(t *testing.T) {
|
||||
result, err := api.GetOrderRefundDetail(3801105140856800486, 0)
|
||||
result, err := api.GetOrderRefundDetail(301135342863962437, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestGetOrderRefundDetail2(t *testing.T) {
|
||||
result, err := api.GetOrderRefundDetail(601112850243823799, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -63,7 +63,8 @@ type PoiInfo struct {
|
||||
// 经常会奇怪的报错:商家已接入美团配送,不可修改门店配送相关信息,但实际并没有修改任何与配送相关的东西
|
||||
// 参见:https://developer.waimai.meituan.com/home/myquestionDetail/6194
|
||||
func (a *API) PoiSave(poiCode string, poiParams map[string]interface{}) (err error) {
|
||||
_, err = a.AccessAPI("poi/save", false, utils.MergeMaps(utils.Params2Map(KeyAppPoiCode, poiCode), poiParams))
|
||||
result, err := a.AccessAPI("poi/save", false, utils.MergeMaps(utils.Params2Map(KeyAppPoiCode, poiCode), poiParams))
|
||||
fmt.Println(result)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ func TestPoiSave(t *testing.T) {
|
||||
//}
|
||||
poiParams := map[string]interface{}{}
|
||||
//utils.FilterMapNilMembers(utils.Struct2FlatMap(result[0]))
|
||||
poiParams["address"] = "云南省昆明市官渡区太和街道办事处双龙桥32号院临江路693号"
|
||||
poiParams["pic_url"] = "https://image.jxc4.com/image/9a280909d07c46100756bf3fd0b68063.jpg"
|
||||
//poiParams["pic_url"] = "https://image.jxc4.com/image/259873ec6392f963d2f3d30669d1c0a9.jpg"
|
||||
//poiParams["name"] = "京西菜市(礼嘉桥村市场店)"
|
||||
err := api.PoiSave("3664790", poiParams)
|
||||
err := api.PoiSave("7290541", poiParams)
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user