获取饿百门店
This commit is contained in:
@@ -28,6 +28,9 @@ const (
|
||||
CommentContentAll = -1
|
||||
CommentContentHaveContent = 1
|
||||
CommentContentNoContent = 0
|
||||
ShopStatusOnLine = 1 //饿百商家中心商户 上线
|
||||
ShopStatusOffLine = 2 //饿百商家中心商户 未上线
|
||||
ProxyBusinessState = 10 //饿百商家中心商户,除正常营业外的状态
|
||||
)
|
||||
|
||||
type PageShopUserInfo struct {
|
||||
@@ -299,6 +302,25 @@ type PageShopInfo struct {
|
||||
TakeoutPrice float64 `json:"takeout_price"`
|
||||
}
|
||||
|
||||
type ShopList struct {
|
||||
Wid string `json:"wid"`
|
||||
SalesID string `json:"sales_id"`
|
||||
ContractStatus string `json:"contract_status"`
|
||||
AuditStatus string `json:"audit_status"`
|
||||
BaiduBusinessState string `json:"baidu_business_state"`
|
||||
EleBusinessState string `json:"ele_business_state"`
|
||||
EleID string `json:"ele_id"`
|
||||
TakeoutOpenTime string `json:"takeout_open_time"`
|
||||
TakeoutDispatchTime string `json:"takeout_dispatch_time"`
|
||||
Name string `json:"name"`
|
||||
BaiduOnlineStatus string `json:"baidu_online_status"`
|
||||
EleOnlineStatus string `json:"ele_online_status"`
|
||||
BusinessState int `json:"business_state"`
|
||||
BaiduContractStatus int `json:"baidu_contract_status"`
|
||||
EleContractStatus int `json:"ele_contract_status"`
|
||||
ProxyBusinessState int `json:"proxy_business_state"`
|
||||
}
|
||||
|
||||
func (a *API) AccessStorePage2(subURL string, params map[string]interface{}, isPost bool, cookies map[string]string) (retVal map[string]interface{}, err error) {
|
||||
if a.GetCookieCount() == 0 {
|
||||
return nil, fmt.Errorf("需要设置Store Cookie才能使用此方法")
|
||||
@@ -669,3 +691,21 @@ func (a *API) GetShopHealthByDetail(baiduShopID int64) (shopHealthDetail *PageSh
|
||||
}
|
||||
return a.GetShopHealthByDetail2(switchShopCookie)
|
||||
}
|
||||
|
||||
//查询饿百商家中心商户列表
|
||||
// https://be.ele.me/crm/suppliershopstatus?status=1&proxy_business_state=10&pageCount=500&pageNum=1
|
||||
func (a *API) GetShopListByPage(status, proxy_business_state, pageCount, pageNum int) (shopList []*ShopList, totalCount int, err error) {
|
||||
url := "crm/suppliershopstatus"
|
||||
params := map[string]interface{}{
|
||||
"status": status,
|
||||
"proxy_business_state": proxy_business_state,
|
||||
"pageCount": pageCount,
|
||||
"pageNum": pageNum,
|
||||
}
|
||||
retVal, err := a.AccessStorePage(url, params, false)
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(retVal["shop_list"], &shopList, true)
|
||||
totalCount = int(utils.MustInterface2Int64(retVal["total"]))
|
||||
}
|
||||
return shopList, totalCount, err
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ebaiapi
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
@@ -137,3 +138,8 @@ func TestGetStoreInfo2(t *testing.T) {
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestGetShopListIDs(t *testing.T) {
|
||||
result, total, _ := api.GetShopListByPage(1, 10, 500, 1)
|
||||
fmt.Println(result[0].Name, total)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user