|
|
@@ -543,6 +543,9 @@ func GetPriceCurve(c *gin.Context) { |
|
|
|
kind := c.DefaultQuery("kind", "1") |
|
|
|
now := time.Now() |
|
|
|
|
|
|
|
var yData []interface{} |
|
|
|
var xData []interface{} |
|
|
|
|
|
|
|
priceDb := implement.NewEggEnergyPriceDb(db.Db) |
|
|
|
m, has, err := priceDb.EggEnergyPriceGetLastOne() |
|
|
|
if err != nil { |
|
|
@@ -550,12 +553,13 @@ func GetPriceCurve(c *gin.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
e.OutErr(c, e.ERR_NO_DATA, "未查询到数据") |
|
|
|
e.OutSuc(c, md.GetPriceCurveResp{ |
|
|
|
YData: yData, |
|
|
|
XData: xData, |
|
|
|
}, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var yData []interface{} |
|
|
|
var xData []interface{} |
|
|
|
switch kind { |
|
|
|
case "1": |
|
|
|
var date = now.AddDate(0, 0, -30).Format("2006-01-02") |
|
|
|