1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package mtwmapi
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -145,3 +146,14 @@ func (a *API) FoodSkuSellStatus(poiCode string, foodData []map[string]interface{
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
// GetSkuPurchasePrice 获取商品进货价
|
||||
func (a *API) GetSkuPurchasePrice(poiCode, skuId string) {
|
||||
data, err := a.AccessAPI("retail/purchase/price/list", true, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"sku_id": skuId,
|
||||
"page_size": 20,
|
||||
})
|
||||
globals.SugarLogger.Debugf("data :== %s", utils.Format4Output(data, false))
|
||||
globals.SugarLogger.Debugf("err :== %s", utils.Format4Output(err, false))
|
||||
}
|
||||
|
||||
@@ -14,3 +14,7 @@ func TestFoodList(t *testing.T) {
|
||||
}
|
||||
// t.Log(result)
|
||||
}
|
||||
|
||||
func TestGetSkuPurchasePrice(t *testing.T) {
|
||||
api.GetSkuPurchasePrice("18048546", "16295939515")
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@ func init() {
|
||||
baseapi.Init(sugarLogger)
|
||||
|
||||
// 菜市
|
||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
|
||||
// 果园
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_r-gsHtjKjgxMhYcxeWpPKg") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_uV2meUDlxZ1pYj9Uiu9OTw") //token_n4TwqCntWWuvQwAawzxC0w
|
||||
cookieStr := `
|
||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
`
|
||||
@@ -64,7 +64,7 @@ func TestGetAccessToken(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetAccessToken2(t *testing.T) {
|
||||
result, err := api.GetAccessToken2("18830143") //refresh_token_pLG7Jw7g9mu7oOzNSuJIUg
|
||||
result, err := api.GetAccessToken2("18048546") //refresh_token_pLG7Jw7g9mu7oOzNSuJIUg
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user