Browse Source

update

master
shenjiachi 6 days ago
parent
commit
408f683bcf
2 changed files with 8 additions and 8 deletions
  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 View File

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


type EggEnergyUserWatchRecordsDao interface { 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) EggEnergyUserWatchRecordsGetOneByParams(params map[string]interface{}) (*model.EggEnergyUserWatchRecords, error)
} }

+ 6
- 6
src/implement/egg_energy_user_watch_records_implement.go View File

@@ -16,23 +16,23 @@ type EggEnergyUserWatchRecordsDb struct {
Db *xorm.Engine 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 { if err != nil {
return 0, err 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 ( var (
affected int64 affected int64
err error err error
) )
if forceColums != nil { 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 { } else {
affected, err = e.Db.Where("id=?", id).Update(OneCirclesUserWatchRecords)
affected, err = e.Db.Where("id=?", id).Update(userWatchRecords)
} }
if err != nil { if err != nil {
return 0, err return 0, err


Loading…
Cancel
Save