Explorar el Código

update

tags/v0.0.2
shenjiachi hace 1 semana
padre
commit
a5360fd97c
Se han modificado 2 ficheros con 10 adiciones y 0 borrados
  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 Ver fichero

@@ -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 Ver fichero

@@ -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
}

Cargando…
Cancelar
Guardar