From bd0154310b409a01db82e0d28054fee5d0212169 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Wed, 5 Mar 2025 22:03:38 +0800 Subject: [PATCH] Get chagnes to GetCandles --- rest/rest.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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