Browse Source

git fix

master
dengbiao 7 months ago
parent
commit
017dfe3e0d
4 changed files with 7 additions and 68 deletions
  1. +0
    -10
      src/dao/happy_orchard_seed_record_dao.go
  2. +0
    -36
      src/implement/happy_orchard_seed_record_db.go
  3. +0
    -11
      src/models/happy_orchard_seed_record.go
  4. +7
    -11
      src/models/happy_orchard_user_seed_record.go

+ 0
- 10
src/dao/happy_orchard_seed_record_dao.go View File

@@ -1,12 +1,3 @@
<<<<<<< HEAD
package dao

import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"

type HappyOrchardUserSeedRecordDao interface {
GetHappyOrchardUserSeedRecord(id int) (m *models.HappyOrchardUserSeedRecord, err error)
FindHappyOrchardUserSeedRecordsByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error)
=======
package dao

import (
@@ -18,5 +9,4 @@ type HappyOrchardUserSeedRecordDao interface {
FindHappyOrchardUserSeedRecordByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error)
GetHappyOrchardUserSeedRecordByUidWithState(uid, state int) (m *models.HappyOrchardUserSeedRecord, err error)
GetHappyOrchardUserSeedRecordByUidWithStateAndId(uid, id, state int) (m *models.HappyOrchardUserSeedRecord, err error)
>>>>>>> f2a8ff9c85ab744b6d70d0d47df094f2a870d34a
}

+ 0
- 36
src/implement/happy_orchard_seed_record_db.go View File

@@ -1,36 +0,0 @@
package implement

import (
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao"
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models"
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx"
"xorm.io/xorm"
)

type HappyOrchardUserSeedRecordDb struct {
Db *xorm.Engine
}

func (h HappyOrchardUserSeedRecordDb) GetHappyOrchardUserSeedRecord(id int) (m *models.HappyOrchardUserSeedRecord, err error) {
m = new(models.HappyOrchardUserSeedRecord)
has, err := h.Db.Where("id =?", id).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (h HappyOrchardUserSeedRecordDb) FindHappyOrchardUserSeedRecordsByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error) {
var m []models.HappyOrchardUserSeedRecord
if err := h.Db.Where("uid =?", uid).Desc("id").Find(&m); err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
return &m, nil
}

func NewHappyOrchardUserSeedRecordDb(engine *xorm.Engine) dao.HappyOrchardUserSeedRecordDao {
return &HappyOrchardUserSeedRecordDb{Db: engine}
}

+ 0
- 11
src/models/happy_orchard_seed_record.go View File

@@ -1,11 +0,0 @@
package models

type HappyOrchardUserSeedRecord struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uid int `json:"uid" xorm:"INT(11)"`
SeedId int `json:"seed_id" xorm:"not null default 0 INT(11)"`
WaterNums int `json:"water_nums" xorm:"not null default 0 comment('当前获得水滴数') INT(11)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:种植中 2:待领取 3:已领取)') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('创建时间') DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') DATETIME"`
}

+ 7
- 11
src/models/happy_orchard_user_seed_record.go View File

@@ -1,15 +1,11 @@
package models

import (
"time"
)

type HappyOrchardUserSeedRecord struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uid int `json:"uid" xorm:"INT(11)"`
SeedId int `json:"seed_id" xorm:"not null default 0 INT(11)"`
WaterNums int `json:"water_nums" xorm:"not null default 0 comment('当前获得水滴数') INT(11)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:种植中 2:待领取 3:已领取)') INT(11)"`
CreateAt time.Time `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uid int `json:"uid" xorm:"INT(11)"`
SeedId int `json:"seed_id" xorm:"not null default 0 INT(11)"`
WaterNums int `json:"water_nums" xorm:"not null default 0 comment('当前获得水滴数') INT(11)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:种植中 2:待领取 3:已领取)') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP comment('创建时间') DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP comment('更新时间') DATETIME"`
}

Loading…
Cancel
Save