-
Notifications
You must be signed in to change notification settings - Fork 0
/
dto.go
110 lines (105 loc) · 3.48 KB
/
dto.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package gobist
type quoteDTO struct {
Chart struct {
Result []struct {
Meta struct {
Currency string `json:"currency"`
Symbol string `json:"symbol"`
ExchangeName string `json:"exchangeName"`
FullExchangeName string `json:"fullExchangeName"`
InstrumentType string `json:"instrumentType"`
FirstTradeDate int `json:"firstTradeDate"`
RegularMarketTime int `json:"regularMarketTime"`
HasPrePostMarketData bool `json:"hasPrePostMarketData"`
Gmtoffset int `json:"gmtoffset"`
Timezone string `json:"timezone"`
ExchangeTimezoneName string `json:"exchangeTimezoneName"`
RegularMarketPrice float64 `json:"regularMarketPrice"`
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
RegularMarketDayHigh float64 `json:"regularMarketDayHigh"`
RegularMarketDayLow float64 `json:"regularMarketDayLow"`
RegularMarketVolume int `json:"regularMarketVolume"`
LongName string `json:"longName"`
ShortName string `json:"shortName"`
ChartPreviousClose float64 `json:"chartPreviousClose"`
PriceHint int `json:"priceHint"`
CurrentTradingPeriod struct {
Pre struct {
Timezone string `json:"timezone"`
Start int `json:"start"`
End int `json:"end"`
Gmtoffset int `json:"gmtoffset"`
} `json:"pre"`
Regular struct {
Timezone string `json:"timezone"`
Start int `json:"start"`
End int `json:"end"`
Gmtoffset int `json:"gmtoffset"`
} `json:"regular"`
Post struct {
Timezone string `json:"timezone"`
Start int `json:"start"`
End int `json:"end"`
Gmtoffset int `json:"gmtoffset"`
} `json:"post"`
} `json:"currentTradingPeriod"`
DataGranularity string `json:"dataGranularity"`
Range string `json:"range"`
ValidRanges []string `json:"validRanges"`
} `json:"meta"`
Timestamp []int `json:"timestamp"`
Indicators struct {
Quote []struct {
Volume []int `json:"volume"`
High []float64 `json:"high"`
Open []float64 `json:"open"`
Low []float64 `json:"low"`
Close []float64 `json:"close"`
} `json:"quoteDTO"`
Adjclose []struct {
Adjclose []float64 `json:"adjclose"`
} `json:"adjclose"`
} `json:"indicators"`
} `json:"result"`
Error interface{} `json:"error"`
} `json:"chart"`
}
func (q quoteDTO) adjCloseCheck() bool {
if len(q.Chart.Result[0].Indicators.Adjclose) == 0 {
return false
}
if len(q.Chart.Result[0].Indicators.Adjclose[0].Adjclose) == 0 {
return false
}
return true
}
type symbolListResponse struct {
TotalCount int `json:"totalCount"`
Data []struct {
S string `json:"s"`
D []string `json:"d"`
} `json:"data"`
Params struct {
Turkey struct {
Symbols struct {
Query struct {
Types []string `json:"types"`
} `json:"query"`
} `json:"symbols"`
Filter []struct {
Left string `json:"left"`
Operation string `json:"operation"`
Right interface{} `json:"right"`
} `json:"filter"`
Sort struct {
SortBy string `json:"sortBy"`
SortOrder string `json:"sortOrder"`
NullsFirst bool `json:"nullsFirst"`
} `json:"sort"`
Options struct {
Lang string `json:"lang"`
} `json:"options"`
} `json:"turkey"`
} `json:"params"`
}