github.com/bububa/oceanengine/marketing-api@v0.0.0-20210315120513-0b953137f7a6/model/agent/child_agent_select.go (about)

     1  package agent
     2  
     3  import (
     4  	"net/url"
     5  	"strconv"
     6  
     7  	"github.com/bububa/oceanengine/marketing-api/model"
     8  )
     9  
    10  type ChildAgentSelectRequest struct {
    11  	AdvertiserID uint64 `json:"advertiser_id,omitempty"` // 代理商ID
    12  	Page         int    `json:"page,omitempty"`          // 页码.默认值: 1
    13  	PageSize     int    `json:"page_size,omitempty"`     // 页面数据量.默认值: 100
    14  }
    15  
    16  func (r ChildAgentSelectRequest) Encode() string {
    17  	values := &url.Values{}
    18  	values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
    19  	if r.Page > 0 {
    20  		values.Set("page", strconv.Itoa(r.Page))
    21  	}
    22  	if r.PageSize > 0 {
    23  		values.Set("page_size", strconv.Itoa(r.PageSize))
    24  	}
    25  	return values.Encode()
    26  }
    27  
    28  type ChildAgentSelectResponse struct {
    29  	model.BaseResponse
    30  	Data *ChildAgentSelectResponseData `json:"data,omitempty"`
    31  }
    32  
    33  type ChildAgentSelectResponseData struct {
    34  	ChildAgentIDs []uint64 `json:"child_agent_ids,omitempty"`
    35  }