diff --git a/rest/rest.go b/rest/rest.go index 0f600de..71d8ceb 100644 --- a/rest/rest.go +++ b/rest/rest.go @@ -50,6 +50,12 @@ type Okexv5APIResponse struct { Data interface{} `json:"data"` } +type CandleData struct { + Code string `json:"code"` + Msg string `json:"msg"` + Data [][]interface{} `json:"data"` // 用二维数组来接收 candles 数据 +} + /* endPoint:请求地址 apiKey @@ -118,8 +124,8 @@ func (this *RESTAPI) SetTimeOut(timeout time.Duration) *RESTAPI { return this } -// GET请求 -func (this *RESTAPI) Get(ctx context.Context, uri string, param *map[string]interface{}) (res *RESTAPIResult, err error) { +// GetCandles 获取蜡烛图数据 +func (this *RESTAPI) GetCandles(ctx context.Context, uri string, param *map[string]interface{}) (res *RESTAPIResult, err error) { this.Method = GET this.Uri = uri