ソースを参照

git fix

tags/v0.0.2
dengbiao 1週間前
コミット
1f081efccc
10個のファイルの変更74行の追加17行の削除
  1. +4
    -1
      src/dao/egg_energy_fund_data_dao.go
  2. +4
    -1
      src/dao/egg_energy_fund_data_records_dao.go
  3. +4
    -1
      src/dao/egg_energy_price_dao.go
  4. +3
    -3
      src/implement/egg_energy_available_energy_flow_implement.go
  5. +2
    -2
      src/implement/egg_energy_basic_setting_implement.go
  6. +4
    -4
      src/implement/egg_energy_community_dividends_implement.go
  7. +22
    -1
      src/implement/egg_energy_fund_data_implement.go
  8. +12
    -1
      src/implement/egg_energy_fund_data_records_implement.go
  9. +17
    -1
      src/implement/egg_energy_price_implement.go
  10. +2
    -2
      src/implement/user_virtual_coin_flow_implement.go

+ 4
- 1
src/dao/egg_energy_fund_data_dao.go ファイルの表示

@@ -1,5 +1,8 @@
package dao
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type EggEnergyFundDataDao interface {
//TODO:: You can add specific method definitions here
EggEnergyFundDataFindAndCount(page, limit, kind int, startAt, endAt string) ([]model.EggEnergyFundData, int64, error)
}

+ 4
- 1
src/dao/egg_energy_fund_data_records_dao.go ファイルの表示

@@ -1,5 +1,8 @@
package dao
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type EggEnergyFundDataRecordsDao interface {
//TODO:: You can add specific method definitions here
EggEnergyFundDataRecordsFindAndCount(page, limit int, recordsID int) ([]model.EggEnergyFundDataRecords, int64, error)
}

+ 4
- 1
src/dao/egg_energy_price_dao.go ファイルの表示

@@ -1,5 +1,8 @@
package dao
package dao

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

+ 3
- 3
src/implement/egg_energy_available_energy_flow_implement.go ファイルの表示

@@ -1,4 +1,4 @@
package implement
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
@@ -30,10 +30,10 @@ func (e EggEnergyAvailableEnergyFlowDb) EggEnergyAvailableEnergyFlowFindAndCount
session = session.And("kind = ?", kind)
}
if startAt != "" {
session = session.Where("create_time > ?", startAt)
session = session.Where("create_time >= ?", startAt)
}
if endAt != "" {
session = session.Where("create_time < ?", endAt)
session = session.Where("create_time <= ?", endAt)
}
total, err := session.Limit(pageSize, (page-1)*pageSize).Desc("create_time").FindAndCount(&m)
if err != nil {


+ 2
- 2
src/implement/egg_energy_basic_setting_implement.go ファイルの表示

@@ -1,4 +1,4 @@
package implement
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
@@ -43,7 +43,7 @@ func (e EggEnergyBasicSettingDb) EggEnergyBasicSettingGetOneByParams(params map[

func (e EggEnergyBasicSettingDb) EggEnergyBasicSettingGetOne() (*model.EggEnergyBasicSetting, error) {
var m *model.EggEnergyBasicSetting
_, err := e.Db.Where("id > ?", 1).Get(&m)
_, err := e.Db.Where("id >= ?", 1).Get(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err.Error())
}


+ 4
- 4
src/implement/egg_energy_community_dividends_implement.go ファイルの表示

@@ -27,16 +27,16 @@ func (e EggEnergyCommunityDividendsDb) EggEnergyCommunityDividendsFindAndCount(p
var m []*model.EggEnergyCommunityDividends
session := e.Db.Where("")
if startAt != "" {
session = session.And("create_at > ?", startAt)
session = session.And("create_at >= ?", startAt)
}
if endAt != "" {
session = session.And("create_at < ?", endAt)
session = session.And("create_at <= ?", endAt)
}
if startNums != 0 {
session = session.And("nums > ?", startNums)
session = session.And("nums >= ?", startNums)
}
if endNums != 0 {
session = session.And("nums < ?", endNums)
session = session.And("nums <= ?", endNums)
}
total, err := session.Limit(limit, (page-1)*limit).FindAndCount(&m)
if err != nil {


+ 22
- 1
src/implement/egg_energy_fund_data_implement.go ファイルの表示

@@ -1,7 +1,9 @@
package implement
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"xorm.io/xorm"
)

@@ -12,3 +14,22 @@ func NewEggEnergyFundDataDb(engine *xorm.Engine) dao.EggEnergyFundDataDao {
type EggEnergyFundDataDb struct {
Db *xorm.Engine
}

func (e EggEnergyFundDataDb) EggEnergyFundDataFindAndCount(page, limit, kind int, startAt, endAt string) ([]model.EggEnergyFundData, int64, error) {
var m []model.EggEnergyFundData
session := e.Db.Where("")
if kind > 0 {
session = session.Where("kind = ?", kind)
}
if startAt != "" {
session = session.Where("start_at >= ?", startAt)
}
if endAt != "" {
session = session.Where("end_at <= ?", endAt)
}
total, err := session.Limit(limit, (page-1)*limit).FindAndCount(&m)
if err != nil {
return nil, 0, zhios_order_relate_logx.Error(err.Error())
}
return m, total, nil
}

+ 12
- 1
src/implement/egg_energy_fund_data_records_implement.go ファイルの表示

@@ -1,7 +1,9 @@
package implement
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"xorm.io/xorm"
)

@@ -12,3 +14,12 @@ func NewEggEnergyFundDataRecordsDb(engine *xorm.Engine) dao.EggEnergyFundDataRec
type EggEnergyFundDataRecordsDb struct {
Db *xorm.Engine
}

func (e EggEnergyFundDataRecordsDb) EggEnergyFundDataRecordsFindAndCount(page, limit int, recordsID int) ([]model.EggEnergyFundDataRecords, int64, error) {
var m []model.EggEnergyFundDataRecords
total, err := e.Db.Where("records_id = ?", recordsID).Limit(limit, (page-1)*limit).FindAndCount(&m)
if err != nil {
return nil, 0, zhios_order_relate_logx.Error(err.Error())
}
return m, total, nil
}

+ 17
- 1
src/implement/egg_energy_price_implement.go ファイルの表示

@@ -1,7 +1,10 @@
package implement
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"errors"
"xorm.io/xorm"
)

@@ -12,3 +15,16 @@ func NewEggEnergyPriceDb(engine *xorm.Engine) dao.EggEnergyPriceDao {
type EggEnergyPriceDb struct {
Db *xorm.Engine
}

func (e EggEnergyPriceDb) EggEnergyPriceList(startAt string, endAt string, hour string) ([]model.EggEnergyPrice, error) {
if startAt == "" || endAt == "" {
return nil, zhios_order_relate_logx.Error(errors.New("startAt or endAt can not be empty").Error())
}

var m []model.EggEnergyPrice
err := e.Db.Where("date >= ?", startAt).And("date <= ?", endAt).And("hour = ?", hour).Find(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err.Error())
}
return m, nil
}

+ 2
- 2
src/implement/user_virtual_coin_flow_implement.go ファイルの表示

@@ -1,4 +1,4 @@
package implement
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
@@ -24,7 +24,7 @@ func (u UserVirtualCoinFlowDb) UserVirtualCoinFlowInsertBySession(session *xorm.

func (u UserVirtualCoinFlowDb) UserVirtualCoinFlowFindByCoinAndUser(page, pageSize int, coinID int, uid int64, startAt string, endAt string, direction int) ([]model.UserVirtualCoinFlow, int64, error) {
var m []model.UserVirtualCoinFlow
session := u.Db.Where("uid = ?", uid).And("coin_id = ?", coinID).And("create_at > ?", startAt).And("create_at < ?", endAt)
session := u.Db.Where("uid = ?", uid).And("coin_id = ?", coinID).And("create_at >= ?", startAt).And("create_at <= ?", endAt)
if direction != 0 {
session = session.And("direction = ?", direction)
}


読み込み中…
キャンセル
保存