This commit is contained in:
苏尹岚
2021-02-08 11:45:00 +08:00
parent a376ce1e48
commit 9c2c0930fd
11 changed files with 67 additions and 22 deletions

View File

@@ -85,6 +85,7 @@ func New(appID, secret, callbackURL, token string, config ...*platformapi.APICon
return &API{
appID: appID,
secret: secret,
token: token,
callbackURL: callbackURL,
client: &http.Client{Timeout: curConfig.ClientTimeout},
config: &curConfig,

View File

@@ -19,13 +19,13 @@ func init() {
baseapi.Init(sugarLogger)
// 菜市
// api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "")
// api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
// 果园
// api = New("4123", "df2c88338b85f830cebce2a9eab56628", "")
//商超
api = New("5873", "41c479790a76f86326f89e8048964739", "") //token_nH_IlcWQKAkZBqklwItNRw
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_gYtTGPVDP6pTDLECwp1BFA") //token_nH_IlcWQKAkZBqklwItNRw
cookieStr := `
acctId=62884810; token=0_0_vJux6rcmm0XIzoI885_aew-gnfofUw9SR-a-QkLw*; brandId=-1; wmPoiId=-1;
`
@@ -41,7 +41,7 @@ func TestAccessAPI(t *testing.T) {
}
func TestGetOAuthCode(t *testing.T) {
result, err := api.GetOAuthCode("11011885")
result, err := api.GetOAuthCode("10874383")
if err != nil {
t.Fatal(err)
}

View File

@@ -9,7 +9,7 @@ import (
)
func TestOrderViewStatus(t *testing.T) {
result, err := api.OrderViewStatus(33762863658107006)
result, err := api.OrderViewStatus(123)
if err != nil {
t.Fatal(err)
}
@@ -122,7 +122,7 @@ func TestGetOrderActDetaill(t *testing.T) {
}
func TestGetOrderIdByDaySeq(t *testing.T) {
result, err := api.GetOrderIdByDaySeq("7111597", utils.Time2Date(time.Now()), 1, MaxGap4GetOrderIdByDaySeq)
result, err := api.GetOrderIdByDaySeq("10874383", utils.Time2Date(time.Now()), 1, MaxGap4GetOrderIdByDaySeq)
t.Log(utils.Format4Output(result, false))
if err != nil {
t.Fatal(err)