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 }