소스 검색

update

master
shenjiachi 6 일 전
부모
커밋
408f683bcf
2개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

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


불러오는 중...
취소
저장