Bladeren bron

update

master
shenjiachi 6 dagen geleden
bovenliggende
commit
408f683bcf
2 gewijzigde bestanden met toevoegingen van 8 en 8 verwijderingen
  1. +2
    -2
      src/dao/egg_energy_user_watch_records_dao.go
  2. +6
    -6
      src/implement/egg_energy_user_watch_records_implement.go

+ 2
- 2
src/dao/egg_energy_user_watch_records_dao.go Bestand weergeven

@@ -3,7 +3,7 @@
import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type EggEnergyUserWatchRecordsDao interface {
EggEnergyUserWatchRecordsInsert(OneCirclesUserWatchRecords *model.EggEnergyUserWatchRecords) (int64, error)
EggEnergyUserWatchRecordsUpdate(id interface{}, OneCirclesUserWatchRecords *model.EggEnergyUserWatchRecords, forceColums ...string) (int64, error)
EggEnergyUserWatchRecordsInsert(userWatchRecords *model.EggEnergyUserWatchRecords) (int64, error)
EggEnergyUserWatchRecordsUpdate(id interface{}, userWatchRecords *model.EggEnergyUserWatchRecords, forceColums ...string) (int64, error)
EggEnergyUserWatchRecordsGetOneByParams(params map[string]interface{}) (*model.EggEnergyUserWatchRecords, error)
}

+ 6
- 6
src/implement/egg_energy_user_watch_records_implement.go Bestand weergeven

@@ -16,23 +16,23 @@ type EggEnergyUserWatchRecordsDb struct {
Db *xorm.Engine
}

func (e EggEnergyUserWatchRecordsDb) EggEnergyUserWatchRecordsInsert(OneCirclesUserWatchRecords *model.EggEnergyUserWatchRecords) (int64, error) {
_, err := e.Db.InsertOne(OneCirclesUserWatchRecords)
func (e EggEnergyUserWatchRecordsDb) EggEnergyUserWatchRecordsInsert(userWatchRecords *model.EggEnergyUserWatchRecords) (int64, error) {
_, err := e.Db.InsertOne(userWatchRecords)
if err != nil {
return 0, err
}
return OneCirclesUserWatchRecords.Id, nil
return userWatchRecords.Id, nil
}

func (e EggEnergyUserWatchRecordsDb) EggEnergyUserWatchRecordsUpdate(id interface{}, OneCirclesUserWatchRecords *model.EggEnergyUserWatchRecords, forceColums ...string) (int64, error) {
func (e EggEnergyUserWatchRecordsDb) EggEnergyUserWatchRecordsUpdate(id interface{}, userWatchRecords *model.EggEnergyUserWatchRecords, forceColums ...string) (int64, error) {
var (
affected int64
err error
)
if forceColums != nil {
affected, err = e.Db.Where("id=?", id).Cols(forceColums...).Update(OneCirclesUserWatchRecords)
affected, err = e.Db.Where("id=?", id).Cols(forceColums...).Update(userWatchRecords)
} else {
affected, err = e.Db.Where("id=?", id).Update(OneCirclesUserWatchRecords)
affected, err = e.Db.Where("id=?", id).Update(userWatchRecords)
}
if err != nil {
return 0, err


Laden…
Annuleren
Opslaan