1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- package request
- import (
- "bytes"
- "fmt"
- "net/url"
- )
- type SearchInstrumentRequest struct {
- QueryString string
- OffsetInstrumentId int64
- }
- func NewSearchInstrumentRequest(q string, insId int64) *SearchInstrumentRequest {
- return &SearchInstrumentRequest{q, insId}
- }
- func (this *SearchInstrumentRequest) Url() string {
- return "/secure/instrument/searchCurrentInstruments?q=" + url.QueryEscape(this.QueryString) +
- "&offset=" + fmt.Sprintf("%d", this.OffsetInstrumentId)
- }
- func (this *SearchInstrumentRequest) GetRequestData() *bytes.Buffer {
- return nil
- }
- type CompletedOrderRequest struct {
- Offset string
- Pagesize int32
- }
- func NewCompletedOrderRequest(pageSize int32, offset string) *CompletedOrderRequest {
- if offset == "" {
- offset = "-"
- }
- return &CompletedOrderRequest{offset, pageSize}
- }
- func (this *CompletedOrderRequest) Url() string {
- return "/secure/read/account/getCompletedOrders?offset="+url.QueryEscape(this.Offset)+"&pageSize=" + fmt.Sprint(this.Pagesize)
- }
- func (this *CompletedOrderRequest) GetRequestData() *bytes.Buffer {
- return nil
- }
- type Activity struct {
- Offset int32
- Pagesize int32
- }
- func NewActivityRequest(pageSize int32, offset int32) *Activity {
- if pageSize == 0 {
- pageSize = 20
- }
- return &Activity{offset, pageSize}
- }
- func (this *Activity) Url() string {
- return "/secure/read/account/getActivity/auditTrail/"+fmt.Sprint(this.Offset)+"/" + fmt.Sprint(this.Pagesize)
- }
- func (this *Activity) GetRequestData() *bytes.Buffer {
- return nil
- }
- type AccountStatement struct {
- Offset int32
- Pagesize int32
- }
- func NewAccountStatementRequest(pageSize int32, offset int32) *AccountStatement {
- if pageSize == 0 {
- pageSize = 20
- }
- return &AccountStatement{offset, pageSize}
- }
- func (this *AccountStatement) Url() string {
- return "/secure/read/account/getAccountStatement/"+fmt.Sprint(this.Offset)+"/" + fmt.Sprint(this.Pagesize)
- }
- func (this *AccountStatement) GetRequestData() *bytes.Buffer {
- return nil
- }
|