黄金价格
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
35cb021adf
commit
5ca677c95b
@ -0,0 +1,31 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"WechatGateWay/global"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
/*
|
||||
*
|
||||
@author: sre
|
||||
@date: 2022/9/12 0012
|
||||
@desc: todo
|
||||
*
|
||||
*/
|
||||
type BaiduReportInfo struct {
|
||||
gorm.Model
|
||||
siteId int64
|
||||
Domain string
|
||||
YesterdayPvCount int
|
||||
YesterdayVisitorCount int
|
||||
YesterdayIpCount int
|
||||
TodayPvCount int
|
||||
TodayVisitorCount int
|
||||
TodayIpCount int
|
||||
}
|
||||
|
||||
func GetLatestBaiduReportInfo(domain string) (int, int, int) {
|
||||
var baiduReportInfo BaiduReportInfo
|
||||
global.DB.Where("domain = ?", domain).Last(&baiduReportInfo)
|
||||
return baiduReportInfo.TodayPvCount, baiduReportInfo.TodayVisitorCount, baiduReportInfo.TodayIpCount
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
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
|
||||
}
|
||||
Loading…
Reference in new issue