|
|
|
@ -27,9 +27,18 @@ func GetBinanceLatestPrice(symbol string) float64 {
|
|
|
|
|
|
|
|
|
|
|
|
func GetBinanceLatestPrices(symbol string) []BinancePrice {
|
|
|
|
func GetBinanceLatestPrices(symbol string) []BinancePrice {
|
|
|
|
var binancePrices []BinancePrice
|
|
|
|
var binancePrices []BinancePrice
|
|
|
|
global.DB.Where("symbol = ? ", symbol).Order("id desc").Find(&binancePrices)
|
|
|
|
//global.DB.Where("symbol = ? ", symbol).Find(&binancePrices)
|
|
|
|
|
|
|
|
global.DB.Where("symbol = ? ", symbol).Order("id desc").Limit(500).Find(&binancePrices)
|
|
|
|
//global.DB.Where("symbol = ? order by id desc", symbol).Limit(30).Find(&binancePrices)
|
|
|
|
//global.DB.Where("symbol = ? order by id desc", symbol).Limit(30).Find(&binancePrices)
|
|
|
|
return binancePrices
|
|
|
|
reverseSlice := func(in []BinancePrice) []BinancePrice {
|
|
|
|
|
|
|
|
out := make([]BinancePrice, len(in))
|
|
|
|
|
|
|
|
for i := range in {
|
|
|
|
|
|
|
|
out[i] = in[len(in)-1-i]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return out
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return reverseSlice(binancePrices)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func GetSerivers(symbol string) (timeUpdate []string, symbolPrice []float64) {
|
|
|
|
func GetSerivers(symbol string) (timeUpdate []string, symbolPrice []float64) {
|
|
|
|
|