瀏覽代碼

update

tags/v0.0.2
shenjiachi 1 周之前
父節點
當前提交
a5360fd97c
共有 2 個文件被更改,包括 10 次插入0 次删除
  1. +1
    -0
      src/dao/egg_energy_price_dao.go
  2. +9
    -0
      src/implement/egg_energy_price_implement.go

+ 1
- 0
src/dao/egg_energy_price_dao.go 查看文件

@@ -5,4 +5,5 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
type EggEnergyPriceDao interface {
//TODO:: You can add specific method definitions here
EggEnergyPriceList(startAt string, endAt string, hour string) ([]model.EggEnergyPrice, error)
EggEnergyPriceGetLastOne() (*model.EggEnergyPrice, bool, error)
}

+ 9
- 0
src/implement/egg_energy_price_implement.go 查看文件

@@ -28,3 +28,12 @@ func (e EggEnergyPriceDb) EggEnergyPriceList(startAt string, endAt string, hour
}
return m, nil
}

func (e EggEnergyPriceDb) EggEnergyPriceGetLastOne() (*model.EggEnergyPrice, bool, error) {
var m model.EggEnergyPrice
exist, err := e.Db.Desc("id").Get(&m)
if err != nil {
return nil, false, zhios_order_relate_logx.Error(err.Error())
}
return &m, exist, nil
}

Loading…
取消
儲存