mt price
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package mtwmapi
|
package mtwmapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi"
|
"git.rosy.net.cn/baseapi"
|
||||||
@@ -19,13 +20,13 @@ func init() {
|
|||||||
baseapi.Init(sugarLogger)
|
baseapi.Init(sugarLogger)
|
||||||
|
|
||||||
// 菜市
|
// 菜市
|
||||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||||
|
|
||||||
// 果园
|
// 果园
|
||||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||||
|
|
||||||
//商超
|
//商超
|
||||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nH_IlcWQKAkZBqklwItNRw") //token_nH_IlcWQKAkZBqklwItNRw
|
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nH_IlcWQKAkZBqklwItNRw") //token_nH_IlcWQKAkZBqklwItNRw
|
||||||
cookieStr := `
|
cookieStr := `
|
||||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||||
`
|
`
|
||||||
@@ -41,10 +42,11 @@ func TestAccessAPI(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetOAuthCode(t *testing.T) {
|
func TestGetOAuthCode(t *testing.T) {
|
||||||
result, err := api.GetOAuthCode("8967897")
|
result, err := api.GetOAuthCode("12422751")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
fmt.Println(utils.Format4Output(result, false))
|
||||||
t.Log(utils.Format4Output(result, false))
|
t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,14 +55,16 @@ func TestGetAccessToken(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
fmt.Println(utils.Format4Output(result, false))
|
||||||
t.Log(utils.Format4Output(result, false))
|
t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetAccessToken2(t *testing.T) {
|
func TestGetAccessToken2(t *testing.T) {
|
||||||
result, err := api.GetAccessToken2("11011885") //refresh_token_pLG7Jw7g9mu7oOzNSuJIUg
|
result, err := api.GetAccessToken2("12422751") //refresh_token_pLG7Jw7g9mu7oOzNSuJIUg
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
fmt.Println(utils.Format4Output(result.AccessToken, false))
|
||||||
t.Log(utils.Format4Output(result, false))
|
t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,5 +73,6 @@ func TestRefreshAccessToken(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
fmt.Println(utils.Format4Output(result, false))
|
||||||
t.Log(utils.Format4Output(result, false))
|
t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -496,6 +496,7 @@ func (a *API) BatchSetRestockingPrice(trackInfo, appPoiCode string, spuData []*S
|
|||||||
"spu_data": spuData,
|
"spu_data": spuData,
|
||||||
}, resultKeyMsg, trackInfo)
|
}, resultKeyMsg, trackInfo)
|
||||||
globals.SugarLogger.Debugf("BatchSetRestockingPrice retVal=============%v", retVal)
|
globals.SugarLogger.Debugf("BatchSetRestockingPrice retVal=============%v", retVal)
|
||||||
|
globals.SugarLogger.Debugf("BatchSetRestockingPrice err===========%v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package mtwmapi
|
package mtwmapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
@@ -95,6 +96,18 @@ func TestRetailCatSkuBatchDelete(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//批量更新商品进货价
|
||||||
|
func TestBatchSetPrice(t *testing.T) {
|
||||||
|
param := []*SpuData{
|
||||||
|
{
|
||||||
|
AppSpuCode: "25420",
|
||||||
|
SkuID: "11395394828",
|
||||||
|
PurchasePrice: "50",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
err := api.BatchSetRestockingPrice(utils.GetUUID(), "12422751", param)
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
func TestRetailDelete(t *testing.T) {
|
func TestRetailDelete(t *testing.T) {
|
||||||
err := api.RetailDelete(utils.GetUUID(), testPoiCode, "32427")
|
err := api.RetailDelete(utils.GetUUID(), testPoiCode, "32427")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user