pagecount删了
This commit is contained in:
@@ -18,7 +18,6 @@ const (
|
|||||||
|
|
||||||
func (a *API) AccessStorePage(action string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) {
|
func (a *API) AccessStorePage(action string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) {
|
||||||
fullURL := utils.GenerateGetURL(pageUrl, action, nil)
|
fullURL := utils.GenerateGetURL(pageUrl, action, nil)
|
||||||
a.addPageCount()
|
|
||||||
// result, _ := json.MarshalIndent(bizParams, "", " ")
|
// result, _ := json.MarshalIndent(bizParams, "", " ")
|
||||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||||
func() *http.Request {
|
func() *http.Request {
|
||||||
|
|||||||
@@ -36,23 +36,10 @@ type API struct {
|
|||||||
|
|
||||||
appKey string
|
appKey string
|
||||||
appID string
|
appID string
|
||||||
pageCount int
|
|
||||||
client *http.Client
|
client *http.Client
|
||||||
config *platformapi.APIConfig
|
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(appKey, appID string, config ...*platformapi.APIConfig) *API {
|
func New(appKey, appID string, config ...*platformapi.APIConfig) *API {
|
||||||
curConfig := platformapi.DefAPIConfig
|
curConfig := platformapi.DefAPIConfig
|
||||||
if len(config) > 0 {
|
if len(config) > 0 {
|
||||||
@@ -61,7 +48,6 @@ func New(appKey, appID string, config ...*platformapi.APIConfig) *API {
|
|||||||
return &API{
|
return &API{
|
||||||
appKey: appKey,
|
appKey: appKey,
|
||||||
appID: appID,
|
appID: appID,
|
||||||
pageCount: 100,
|
|
||||||
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
||||||
config: &curConfig,
|
config: &curConfig,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user