1
This commit is contained in:
@@ -2,6 +2,7 @@ package jdshopapi
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
@@ -71,6 +72,7 @@ func (a *API) GetCallbackMsg(request *http.Request) (call *CallBackResult, err e
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
values, err := utils.HTTPBody2Values(data, false)
|
values, err := utils.HTTPBody2Values(data, false)
|
||||||
|
globals.SugarLogger.Debugf("------test GetCallbackMsg := %s", utils.Format4Output(data, false))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSignRSA(t *testing.T) {
|
func TestSignRSA(t *testing.T) {
|
||||||
@@ -124,3 +125,8 @@ func TestTLTLQueryTerm(t *testing.T) {
|
|||||||
}
|
}
|
||||||
api.TLQueryTerm(param)
|
api.TLQueryTerm(param)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test111(t *testing.T) {
|
||||||
|
aa := time.Since(time.Now().AddDate(0, 0, -5)) > 7*24*time.Hour
|
||||||
|
fmt.Println(aa)
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package weixinapi
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -90,7 +89,6 @@ func (a *API) AccessAPI(action string, params map[string]interface{}, body strin
|
|||||||
if accessToken == "" {
|
if accessToken == "" {
|
||||||
panic("token is empty!")
|
panic("token is empty!")
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("-------token := %s, action := %s", accessToken, action)
|
|
||||||
params2["access_token"] = accessToken
|
params2["access_token"] = accessToken
|
||||||
}
|
}
|
||||||
fullURL := utils.GenerateGetURL(prodURL, action, params2)
|
fullURL := utils.GenerateGetURL(prodURL, action, params2)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestGetUnlimited(t *testing.T) {
|
func TestGetUnlimited(t *testing.T) {
|
||||||
|
api.CBSetToken("103_WpV0UHqL-2svlix1nc_3LOkRmlrlvaWy-B5ZBRkAtNZ5TwyYRcwIB3BBWfIVCaccl3bSSNlA7yet9VPfOrIaxQfGugNSZRPmagxyb4H4j2MjYYQt7CakU9H8zT0LHPaAFAYUC")
|
||||||
result, err := api.GetUnlimited("storeID=103197", "")
|
result, err := api.GetUnlimited("storeID=103197", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err.Error())
|
t.Fatal(err.Error())
|
||||||
|
|||||||
Reference in New Issue
Block a user