You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
638 B

package api
import (
"WechatGateWay/global"
"github.com/jinzhu/gorm"
)
/**
@author: sre
@date: 2022/9/12 0012
@desc: todo
**/
type BinancePrice struct {
gorm.Model
Symbol string
Price float64
}
func GetBinanceLatestPrice(symbol string) float64 {
var binancePrice BinancePrice
global.DB.Where("symbol = ?", symbol).Last(&binancePrice)
return binancePrice.Price
}
type CMBGold struct {
gorm.Model
Variety string
CurPrice float64
UpDown float64
GoldNo string
}
func GetCMBGoldLatestPrice(goldNo string) float64 {
var cmbGold CMBGold
global.DB.Where("gold_no = ?", goldNo).Last(&cmbGold)
return cmbGold.CurPrice
}