1
This commit is contained in:
@@ -244,6 +244,7 @@ func (a *API) ShopCategoryCreate(shopID string, parentID int64, name string, ran
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *API) ShopCategoryGet(shopID string) (cats []*CategoryInfo, err error) {
|
func (a *API) ShopCategoryGet(shopID string) (cats []*CategoryInfo, err error) {
|
||||||
|
globals.SugarLogger.Debugf("ShopCategoryGet shopID====%s", shopID)
|
||||||
result, err := a.AccessAPI("sku.shop.category.get", utils.Params2Map(KeyShopID, shopID))
|
result, err := a.AccessAPI("sku.shop.category.get", utils.Params2Map(KeyShopID, shopID))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if inMap, ok := result.Data.(map[string]interface{}); ok {
|
if inMap, ok := result.Data.(map[string]interface{}); ok {
|
||||||
|
|||||||
@@ -53,7 +53,11 @@ func TestShopCreate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestShopGet(t *testing.T) {
|
func TestShopGet(t *testing.T) {
|
||||||
|
<<<<<<< HEAD
|
||||||
result, err := api.ShopGet2("", 1101809925) //2233065879 ,22267134648
|
result, err := api.ShopGet2("", 1101809925) //2233065879 ,22267134648
|
||||||
|
=======
|
||||||
|
result, err := api.ShopGet2("", 2235877567) //2233065879 ,22267134648
|
||||||
|
>>>>>>> c32151cdb461bbd605e7336062d7f9d3d22ef127
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
} else {
|
} else {
|
||||||
@@ -89,9 +93,9 @@ func TestShopUpdate(t *testing.T) {
|
|||||||
//"city": "131",
|
//"city": "131",
|
||||||
//"county": "1960",
|
//"county": "1960",
|
||||||
//"address": "北京市海淀区上地信息路甲9号",
|
//"address": "北京市海淀区上地信息路甲9号",
|
||||||
"takeout_shop_logo": "https://image-star.elemecdn.com/pb/b79d499b9b0be5deb3ee3ce71bf29ad0a8",
|
//"takeout_shop_logo": "https://image-star.elemecdn.com/pb/b79d499b9b0be5deb3ee3ce71bf29ad0a8",
|
||||||
"baidu_takeout_logo": "https://image-star.elemecdn.com/pb/b79d499b9b0be5deb3ee3ce71bf29ad0a8",
|
//"baidu_takeout_logo": "https://image-star.elemecdn.com/pb/b79d499b9b0be5deb3ee3ce71bf29ad0a8",
|
||||||
"ele_takeout_logo": "https://image-star.elemecdn.com/pb/b79d499b9b0be5deb3ee3ce71bf29ad0a8",
|
//"ele_takeout_logo": "https://image-star.elemecdn.com/pb/b79d499b9b0be5deb3ee3ce71bf29ad0a8",
|
||||||
//"baidu_takeout_logo" //takeoutShopLogo//baiduTakeoutLogo
|
//"baidu_takeout_logo" //takeoutShopLogo//baiduTakeoutLogo
|
||||||
}
|
}
|
||||||
err := api.ShopUpdate(params)
|
err := api.ShopUpdate(params)
|
||||||
@@ -120,8 +124,9 @@ func TestShopStatusGet(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo 修改ebai平台与本地映射
|
||||||
func TestShopIDBatchUpdate(t *testing.T) {
|
func TestShopIDBatchUpdate(t *testing.T) {
|
||||||
err := api.ShopIDBatchUpdate([]string{utils.Int2Str(testShopBaiduID)}, []string{"100077"})
|
err := api.ShopIDBatchUpdate([]string{utils.Int2Str(2235877567)}, []string{"100920"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ func New(appID, appKey, openID string, config ...*platformapi.APIConfig) *API {
|
|||||||
if appID == "" {
|
if appID == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("appID====%s,appKey====%s,openID====%s", appID, appKey, openID)
|
|
||||||
return &API{
|
return &API{
|
||||||
appid: appID,
|
appid: appID,
|
||||||
appKey: appKey,
|
appKey: appKey,
|
||||||
@@ -79,7 +78,6 @@ func (a *API) AccessAPI(baseUrl, actionApi, method string, bizParams map[string]
|
|||||||
//完整请求url
|
//完整请求url
|
||||||
fullPath := utils.GenerateGetURL(baseUrl, actionApi, nil)
|
fullPath := utils.GenerateGetURL(baseUrl, actionApi, nil)
|
||||||
globals.SugarLogger.Debugf("uupt fullPath======%s", fullPath)
|
globals.SugarLogger.Debugf("uupt fullPath======%s", fullPath)
|
||||||
globals.SugarLogger.Debugf("uupt a.appid=====%s", a.appid)
|
|
||||||
//发送请求
|
//发送请求
|
||||||
sendUrl := func() *http.Request {
|
sendUrl := func() *http.Request {
|
||||||
var request *http.Request
|
var request *http.Request
|
||||||
|
|||||||
Reference in New Issue
Block a user