File size: 798 Bytes
542878f
 
 
 
 
 
 
 
 
a8ebadf
 
542878f
 
 
 
 
 
 
 
 
a1eed6b
542878f
 
 
 
a1eed6b
542878f
 
 
 
a1eed6b
542878f
 
 
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
package stock

type ApiResponse struct {
	Message    string      `json:"message"`
	StatusCode int         `json:"status_code"`
	Data       interface{} `json:"data"`
}

type PredictionRequest struct {
	Days     int    `json:"days" validate:"gte=1,lte=31"`
	Currency string `json:"currency" validate:"required,min=4,max=16"`
}

type PredictionResponse struct {
	Message    string `json:"message"`
	StatusCode int    `json:"status_code"`

	Data       struct {
		Currency    string `json:"currency"`
		Predictions struct {
			
			Actuals    []struct {
				Date  string  `json:"date"`
				Price float64 `json:"price"`
			} `json:"actuals"`

			Predictions []struct {
				Date  string  `json:"date"`
				Price float64 `json:"price"`
			} `json:"predictions"`

		} `json:"predictions"`
	} `json:"data"`
}