Merge pull request #1508 from c9s/edwin/okx/fix-query-open-order-param

FIX: [okx] fix query open order time param
This commit is contained in:
bailantaotao 2024-01-23 19:57:15 +08:00 committed by GitHub
commit 41529264b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 14 deletions

View File

@ -28,10 +28,10 @@ type GetOpenOrdersRequest struct {
// Pagination of data to return records newer than the requested ordId
before *string `param:"before,query"`
// Filter with a begin timestamp. Unix timestamp format in milliseconds, e.g. 1597026383085
begin *time.Time `param:"begin,query"`
begin *time.Time `param:"begin,query,timestamp"`
// Filter with an end timestamp. Unix timestamp format in milliseconds, e.g. 1597026383085
end *time.Time `param:"end,query"`
end *time.Time `param:"end,query,timestamp"`
limit *string `param:"limit,query"`
}

View File

@ -12,13 +12,13 @@ import (
"time"
)
func (g *GetOpenOrdersRequest) InstrumentID(instrumentID string) *GetOpenOrdersRequest {
g.instrumentID = &instrumentID
func (g *GetOpenOrdersRequest) InstrumentType(instrumentType InstrumentType) *GetOpenOrdersRequest {
g.instrumentType = instrumentType
return g
}
func (g *GetOpenOrdersRequest) InstrumentType(instrumentType InstrumentType) *GetOpenOrdersRequest {
g.instrumentType = instrumentType
func (g *GetOpenOrdersRequest) InstrumentID(instrumentID string) *GetOpenOrdersRequest {
g.instrumentID = &instrumentID
return g
}
@ -65,14 +65,6 @@ func (g *GetOpenOrdersRequest) Limit(limit string) *GetOpenOrdersRequest {
// GetQueryParameters builds and checks the query parameters and returns url.Values
func (g *GetOpenOrdersRequest) GetQueryParameters() (url.Values, error) {
var params = map[string]interface{}{}
// check instrumentID field -> json key instId
if g.instrumentID != nil {
instrumentID := *g.instrumentID
// assign parameter of instrumentID
params["instId"] = instrumentID
} else {
}
// check instrumentType field -> json key instType
instrumentType := g.instrumentType
@ -89,6 +81,14 @@ func (g *GetOpenOrdersRequest) GetQueryParameters() (url.Values, error) {
// assign parameter of instrumentType
params["instType"] = instrumentType
// check instrumentID field -> json key instId
if g.instrumentID != nil {
instrumentID := *g.instrumentID
// assign parameter of instrumentID
params["instId"] = instrumentID
} else {
}
// check orderType field -> json key ordType
if g.orderType != nil {
orderType := *g.orderType