pagecount删了

This commit is contained in:
苏尹岚
2020-03-26 16:53:42 +08:00
parent 619eac5e8c
commit 4d20dd7377
2 changed files with 8 additions and 23 deletions

View File

@@ -18,7 +18,6 @@ const (
func (a *API) AccessStorePage(action string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) {
fullURL := utils.GenerateGetURL(pageUrl, action, nil)
a.addPageCount()
// result, _ := json.MarshalIndent(bizParams, "", " ")
err = platformapi.AccessPlatformAPIWithRetry(a.client,
func() *http.Request {

View File

@@ -34,23 +34,10 @@ const (
type API struct {
platformapi.APICookie
appKey string
appID string
pageCount int
client *http.Client
config *platformapi.APIConfig
}
func (a *API) setPageCount(pc int) {
a.pageCount = pc
}
func (a *API) GetPageCount() int {
return a.pageCount
}
func (a *API) addPageCount() {
a.setPageCount(a.GetPageCount() + 1)
appKey string
appID string
client *http.Client
config *platformapi.APIConfig
}
func New(appKey, appID string, config ...*platformapi.APIConfig) *API {
@@ -59,11 +46,10 @@ func New(appKey, appID string, config ...*platformapi.APIConfig) *API {
curConfig = *config[0]
}
return &API{
appKey: appKey,
appID: appID,
pageCount: 100,
client: &http.Client{Timeout: curConfig.ClientTimeout},
config: &curConfig,
appKey: appKey,
appID: appID,
client: &http.Client{Timeout: curConfig.ClientTimeout},
config: &curConfig,
}
}