Browse Source

add method to add fundData

tags/v0.0.2
shenjiachi 1 month ago
parent
commit
b8d43f081d
4 changed files with 13 additions and 4 deletions
  1. +1
    -1
      src/dao/egg_energy_community_dividends_dao.go
  2. +1
    -0
      src/dao/egg_energy_fund_data_dao.go
  3. +3
    -3
      src/implement/egg_energy_community_dividends_implement.go
  4. +8
    -0
      src/implement/egg_energy_fund_data_implement.go

+ 1
- 1
src/dao/egg_energy_community_dividends_dao.go View File

@@ -7,6 +7,6 @@ import (


type EggEnergyCommunityDividendsDao interface { type EggEnergyCommunityDividendsDao interface {
EggEnergyCommunityDividendsFindAndCount(page, limit int, startAt, endAt string, startNums, endNums int64) ([]*model.EggEnergyCommunityDividends, int64, error) EggEnergyCommunityDividendsFindAndCount(page, limit int, startAt, endAt string, startNums, endNums int64) ([]*model.EggEnergyCommunityDividends, int64, error)
EggEnergyCommunityDividendsInsert(EggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error)
EggEnergyCommunityDividendsInsert(eggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error)
EggEnergyCommunityDividendsInsertBySession(session *xorm.Session, eggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error) EggEnergyCommunityDividendsInsertBySession(session *xorm.Session, eggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error)
} }

+ 1
- 0
src/dao/egg_energy_fund_data_dao.go View File

@@ -5,4 +5,5 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
type EggEnergyFundDataDao interface { type EggEnergyFundDataDao interface {
//TODO:: You can add specific method definitions here //TODO:: You can add specific method definitions here
EggEnergyFundDataFindAndCount(page, limit, kind int, startAt, endAt string) ([]model.EggEnergyFundData, int64, error) EggEnergyFundDataFindAndCount(page, limit, kind int, startAt, endAt string) ([]model.EggEnergyFundData, int64, error)
EggEnergyFundDataInsert(eggEnergyFundData *model.EggEnergyFundData) (int, error)
} }

+ 3
- 3
src/implement/egg_energy_community_dividends_implement.go View File

@@ -45,10 +45,10 @@ func (e EggEnergyCommunityDividendsDb) EggEnergyCommunityDividendsFindAndCount(p
return m, total, nil return m, total, nil
} }


func (e EggEnergyCommunityDividendsDb) EggEnergyCommunityDividendsInsert(EggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error) {
_, err := e.Db.InsertOne(EggEnergyCommunityDividends)
func (e EggEnergyCommunityDividendsDb) EggEnergyCommunityDividendsInsert(eggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error) {
_, err := e.Db.InsertOne(eggEnergyCommunityDividends)
if err != nil { if err != nil {
return 0, err return 0, err
} }
return EggEnergyCommunityDividends.Id, nil
return eggEnergyCommunityDividends.Id, nil
} }

+ 8
- 0
src/implement/egg_energy_fund_data_implement.go View File

@@ -33,3 +33,11 @@ func (e EggEnergyFundDataDb) EggEnergyFundDataFindAndCount(page, limit, kind int
} }
return m, total, nil return m, total, nil
} }

func (e EggEnergyFundDataDb) EggEnergyFundDataInsert(eggEnergyFundData *model.EggEnergyFundData) (int, error) {
_, err := e.Db.InsertOne(eggEnergyFundData)
if err != nil {
return 0, err
}
return eggEnergyFundData.Id, nil
}

Loading…
Cancel
Save