Browse Source

update

tags/v0.0.2
shenjiachi 1 week ago
parent
commit
a5360fd97c
2 changed files with 10 additions and 0 deletions
  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 View File

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

+ 9
- 0
src/implement/egg_energy_price_implement.go View File

@@ -28,3 +28,12 @@ func (e EggEnergyPriceDb) EggEnergyPriceList(startAt string, endAt string, hour
} }
return m, nil 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…
Cancel
Save