- jd storepage GetStoreOrderInfo add param stationNo
This commit is contained in:
@@ -25,6 +25,9 @@ func init() {
|
||||
// prod
|
||||
// jdapi = New("ccb10daf-e6f5-4a58-ada5-b97f9073a137", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
|
||||
|
||||
// 天天果园
|
||||
// jdapi = New("b9f98667-9856-45e9-a31c-9a8862b1bfde", "5d5577a2506f41b8b4ec520ba83490f5", "0b01b9eeb15b41dab1c3d05d95c17a26")
|
||||
|
||||
jdapi.SetStoreCookie("YYJV3NHVBPHLD36FWP6F3EM5PTXJ2XZQS7U4HWRIDPP4IWGUKUIB4XG5N26CZRDLDF7PKOXBPD6BNTUAJLETLZOIWMCVFI3K6MYZIY4QBIXIMXYDJNUKFGJVQTN5356SAD6WPCIHWNQAG7DDMF7L7S3SHBUOPCIUXDX4MQEAYEPUFFOAD4WJECT4R3K22T24MKC7OMIRDLX7S55243TDVXLO25PP4UYSPTTPMNRUFXDNP4WPE566Q6V4AH32F7HT")
|
||||
}
|
||||
|
||||
|
||||
@@ -66,16 +66,20 @@ func (a *API) AccessStorePage(subURL string) (retVal map[string]interface{}, err
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
func (a *API) GetRealMobile4Order(orderId string) (mobile string, err error) {
|
||||
retVal, err := a.GetStoreOrderInfo(orderId)
|
||||
func (a *API) GetRealMobile4Order(orderId, stationNo string) (mobile string, err error) {
|
||||
retVal, err := a.GetStoreOrderInfo(orderId, stationNo)
|
||||
if err == nil {
|
||||
return retVal["mobile"].(string), nil
|
||||
}
|
||||
return "", err
|
||||
}
|
||||
|
||||
func (a *API) GetStoreOrderInfo(orderId string) (storeOrderInfo map[string]interface{}, err error) {
|
||||
retVal, err := a.AccessStorePage(fmt.Sprintf("order/newManager/search?pageNo=1&pageSize=1&orderBy=&desc=true¶m=%s&stationNo=", orderId))
|
||||
func (a *API) GetStoreOrderInfo(orderId, stationNo string) (storeOrderInfo map[string]interface{}, err error) {
|
||||
urlStr := "order/newManager/search?pageNo=1&pageSize=1&orderBy=&desc=true¶m=" + orderId
|
||||
if stationNo != "" {
|
||||
urlStr += "&stationNo=" + stationNo
|
||||
}
|
||||
retVal, err := a.AccessStorePage(urlStr)
|
||||
// baseapi.SugarLogger.Debug(utils.Format4Output(retVal, false))
|
||||
if err == nil {
|
||||
newOrderinfoMains := retVal["result"].(map[string]interface{})["newOrderinfoMains"].(map[string]interface{})
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
func TestGetRealMobileNumber4Order(t *testing.T) {
|
||||
orderId := "900658736000042"
|
||||
desiredMobile := "18569035610"
|
||||
mobile, err := jdapi.GetRealMobile4Order(orderId)
|
||||
mobile, err := jdapi.GetRealMobile4Order(orderId, "11738115")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -23,7 +23,7 @@ func TestGetRealMobileNumber4Order(t *testing.T) {
|
||||
func TestGetStoreOrderInfo(t *testing.T) {
|
||||
orderId := "826309564000021"
|
||||
// desiredMobile := "18569035610"
|
||||
orderInfo, err := jdapi.GetStoreOrderInfo(orderId)
|
||||
orderInfo, err := jdapi.GetStoreOrderInfo(orderId, "11738115")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user