From 13401873f1f7d8bb39b88afdecee76bc626b04e5 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 21 May 2024 10:39:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 8 ++- .../happy_happy_orchard_basic_setting_dao.go | 9 +++ src/dao/happy_happy_orchard_reward_dao.go | 2 + src/dao/happy_happy_orchard_sign_day_dao.go | 10 ++++ ...ppy_orchard_reward_exchange_records_dao.go | 3 + src/dao/happy_orchard_reward_with_seed_dao.go | 8 +++ src/dao/happy_orchard_seed_dao.go | 1 + src/dao/happy_orchard_seed_record_dao.go | 12 ++++ src/dao/happy_orchard_user_waters_dao.go | 1 + .../happy_orchard_basic_setting_db.go | 28 +++++++++ src/implement/happy_orchard_reward_db.go | 14 +++++ ...appy_orchard_reward_exchange_records_db.go | 33 ++++++++++ .../happy_orchard_reward_with_seed_db.go | 35 +++++++++++ src/implement/happy_orchard_seed_db.go | 7 +++ src/implement/happy_orchard_sign_day_db.go | 43 +++++++++++++ .../happy_orchard_user_seed_record_db.go | 60 +++++++++++++++++++ src/implement/happy_orchard_user_waters_db.go | 18 +++++- src/models/happy_orchard_basic_setting.go | 1 + .../happy_orchard_reward_exchange_records.go | 1 + src/models/happy_orchard_sign_day.go | 10 ++++ src/models/happy_orchard_user_seed_record.go | 16 +++++ 21 files changed, 317 insertions(+), 3 deletions(-) create mode 100644 src/dao/happy_happy_orchard_basic_setting_dao.go create mode 100644 src/dao/happy_happy_orchard_sign_day_dao.go create mode 100644 src/dao/happy_orchard_reward_with_seed_dao.go create mode 100644 src/dao/happy_orchard_seed_record_dao.go create mode 100644 src/implement/happy_orchard_basic_setting_db.go create mode 100644 src/implement/happy_orchard_reward_with_seed_db.go create mode 100644 src/implement/happy_orchard_sign_day_db.go create mode 100644 src/implement/happy_orchard_user_seed_record_db.go create mode 100644 src/models/happy_orchard_sign_day.go create mode 100644 src/models/happy_orchard_user_seed_record.go diff --git a/go.mod b/go.mod index 97faa94..8467dc6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,8 @@ module code.fnuoos.com/go_rely_warehouse/zyos_model.git go 1.19 require ( - github.com/gin-gonic/gin v1.9.1 + github.com/go-sql-driver/mysql v1.8.1 + github.com/syyongx/php2go v0.9.8 go.uber.org/zap v1.13.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v3 v3.0.1 @@ -12,16 +13,19 @@ require ( require ( filippo.io/edwards25519 v1.1.0 // indirect - github.com/go-sql-driver/mysql v1.8.1 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/stretchr/testify v1.8.3 // indirect github.com/syndtr/goleveldb v1.0.0 // indirect go.uber.org/atomic v1.6.0 // indirect go.uber.org/multierr v1.5.0 // indirect golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78 // indirect xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978 // indirect ) diff --git a/src/dao/happy_happy_orchard_basic_setting_dao.go b/src/dao/happy_happy_orchard_basic_setting_dao.go new file mode 100644 index 0000000..93cd934 --- /dev/null +++ b/src/dao/happy_happy_orchard_basic_setting_dao.go @@ -0,0 +1,9 @@ +package dao + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" +) + +type HappyOrchardBasicSettingDao interface { + GetHappyOrchardBasicSetting() (m *models.HappyOrchardBasicSetting, err error) +} diff --git a/src/dao/happy_happy_orchard_reward_dao.go b/src/dao/happy_happy_orchard_reward_dao.go index dc1feef..32c620f 100644 --- a/src/dao/happy_happy_orchard_reward_dao.go +++ b/src/dao/happy_happy_orchard_reward_dao.go @@ -6,4 +6,6 @@ import ( type HappyOrchardRewardDao interface { GetHappyOrchardReward(id int) (m *models.HappyOrchardReward, err error) + FindHappyOrchardRewardById(seedId []int) (m *[]models.HappyOrchardReward, err error) + FindHappyOrchardRewardAll(rewardIds []int, start, limit int) (mm *[]models.HappyOrchardReward, err error) } diff --git a/src/dao/happy_happy_orchard_sign_day_dao.go b/src/dao/happy_happy_orchard_sign_day_dao.go new file mode 100644 index 0000000..4864bbe --- /dev/null +++ b/src/dao/happy_happy_orchard_sign_day_dao.go @@ -0,0 +1,10 @@ +package dao + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" +) + +type HappyOrchardSignDayDao interface { + GetHappyOrchardSignDay(uid int) (m *models.HappyOrchardSignDay, err error) + GetHappyOrchardSignDaySess(uid int) (m *models.HappyOrchardSignDay, err error) +} diff --git a/src/dao/happy_orchard_reward_exchange_records_dao.go b/src/dao/happy_orchard_reward_exchange_records_dao.go index d2046fd..110d2d0 100644 --- a/src/dao/happy_orchard_reward_exchange_records_dao.go +++ b/src/dao/happy_orchard_reward_exchange_records_dao.go @@ -7,4 +7,7 @@ import ( type HappyOrchardRewardExchangeRecordsDao interface { GetHappyOrchardRewardExchangeRecords(id int) (m *models.HappyOrchardRewardExchangeRecords, err error) FindHappyOrchardRewardExchangeRecordsByUid(uid int) (mm *[]models.HappyOrchardRewardExchangeRecords, err error) + GetHappyOrchardRewardExchangeRecordsByRecordId(id int) (m *models.HappyOrchardRewardExchangeRecords, err error) + GetHappyOrchardRewardExchangeRecordsByUidWithState(uid, state int) (m *models.HappyOrchardRewardExchangeRecords, err error) + GetHappyOrchardRewardExchangeRecordsByUidWithStateAndId(uid, id, state int) (m *models.HappyOrchardRewardExchangeRecords, err error) } diff --git a/src/dao/happy_orchard_reward_with_seed_dao.go b/src/dao/happy_orchard_reward_with_seed_dao.go new file mode 100644 index 0000000..2dd90bc --- /dev/null +++ b/src/dao/happy_orchard_reward_with_seed_dao.go @@ -0,0 +1,8 @@ +package dao + +import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" + +type HappyOrchardRewardWithSeedDao interface { + FindHappyOrchardRewardWithSeedBySeedId(seedId []int) (m *[]models.HappyOrchardRewardWithSeed, err error) + FindHappyOrchardRewardWithSeedBySeedIdAndId(rewardId, seedId int) (m *models.HappyOrchardRewardWithSeed, err error) +} diff --git a/src/dao/happy_orchard_seed_dao.go b/src/dao/happy_orchard_seed_dao.go index f020766..024ed61 100644 --- a/src/dao/happy_orchard_seed_dao.go +++ b/src/dao/happy_orchard_seed_dao.go @@ -4,4 +4,5 @@ import "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" type HappyOrchardSeedDao interface { GetHappyOrchardSeed(id int) (m *models.HappyOrchardSeed, err error) + FindHappyOrchardSeedAll(start, limit int) (mm *[]models.HappyOrchardSeed, err error) } diff --git a/src/dao/happy_orchard_seed_record_dao.go b/src/dao/happy_orchard_seed_record_dao.go new file mode 100644 index 0000000..8e7a7cb --- /dev/null +++ b/src/dao/happy_orchard_seed_record_dao.go @@ -0,0 +1,12 @@ +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) + 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) +} diff --git a/src/dao/happy_orchard_user_waters_dao.go b/src/dao/happy_orchard_user_waters_dao.go index ba543da..a502310 100644 --- a/src/dao/happy_orchard_user_waters_dao.go +++ b/src/dao/happy_orchard_user_waters_dao.go @@ -6,4 +6,5 @@ import ( type HappyOrchardUserWatersDao interface { GetHappyOrchardUserWaters(uid int) (m *models.HappyOrchardUserWaters, err error) + GetHappyOrchardUserWatersSess(uid int) (m *models.HappyOrchardUserWaters, err error) } diff --git a/src/implement/happy_orchard_basic_setting_db.go b/src/implement/happy_orchard_basic_setting_db.go new file mode 100644 index 0000000..d88c29d --- /dev/null +++ b/src/implement/happy_orchard_basic_setting_db.go @@ -0,0 +1,28 @@ +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 happyOrchardBasicSettingDb struct { + Db *xorm.Engine +} + +func NewHappyOrchardBasicSettingDb(engine *xorm.Engine) dao.HappyOrchardBasicSettingDao { + return &happyOrchardBasicSettingDb{Db: engine} +} + +func (h happyOrchardBasicSettingDb) GetHappyOrchardBasicSetting() (m *models.HappyOrchardBasicSetting, err error) { + m = new(models.HappyOrchardBasicSetting) + has, err := h.Db.Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} diff --git a/src/implement/happy_orchard_reward_db.go b/src/implement/happy_orchard_reward_db.go index 9aac577..064b37e 100644 --- a/src/implement/happy_orchard_reward_db.go +++ b/src/implement/happy_orchard_reward_db.go @@ -26,3 +26,17 @@ func (h HappyOrchardRewardDb) GetHappyOrchardReward(id int) (m *models.HappyOrch } return m, nil } +func (h HappyOrchardRewardDb) FindHappyOrchardRewardById(id []int) (mm *[]models.HappyOrchardReward, err error) { + var m []models.HappyOrchardReward + if err := h.Db.In("id", id).Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} +func (h HappyOrchardRewardDb) FindHappyOrchardRewardAll(rewardIds []int, start, limit int) (mm *[]models.HappyOrchardReward, err error) { + var m []models.HappyOrchardReward + if err := h.Db.Where("nums>0").In("id", rewardIds).OrderBy("sort desc,id desc").Limit(limit, start).Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} diff --git a/src/implement/happy_orchard_reward_exchange_records_db.go b/src/implement/happy_orchard_reward_exchange_records_db.go index 25ab622..9e13720 100644 --- a/src/implement/happy_orchard_reward_exchange_records_db.go +++ b/src/implement/happy_orchard_reward_exchange_records_db.go @@ -36,3 +36,36 @@ func (h HappyOrchardRewardExchangeRecordsDb) FindHappyOrchardRewardExchangeRecor } return &m, nil } +func (h HappyOrchardRewardExchangeRecordsDb) GetHappyOrchardRewardExchangeRecordsByUidWithState(uid, state int) (m *models.HappyOrchardRewardExchangeRecords, err error) { + m = new(models.HappyOrchardRewardExchangeRecords) + has, err := h.Db.Where("uid =? and state=?", uid, state).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} +func (h HappyOrchardRewardExchangeRecordsDb) GetHappyOrchardRewardExchangeRecordsByUidWithStateAndId(uid, id, state int) (m *models.HappyOrchardRewardExchangeRecords, err error) { + m = new(models.HappyOrchardRewardExchangeRecords) + has, err := h.Db.Where("uid =? and state=? and id=?", uid, state, 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 HappyOrchardRewardExchangeRecordsDb) GetHappyOrchardRewardExchangeRecordsByRecordId(id int) (m *models.HappyOrchardRewardExchangeRecords, err error) { + m = new(models.HappyOrchardRewardExchangeRecords) + has, err := h.Db.Where("record_id=?", id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} diff --git a/src/implement/happy_orchard_reward_with_seed_db.go b/src/implement/happy_orchard_reward_with_seed_db.go new file mode 100644 index 0000000..f6170ed --- /dev/null +++ b/src/implement/happy_orchard_reward_with_seed_db.go @@ -0,0 +1,35 @@ +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 happyOrchardRewardWithSeedDb struct { + Db *xorm.Engine +} + +func NewHappyOrchardRewardWithSeedDb(engine *xorm.Engine) dao.HappyOrchardRewardWithSeedDao { + return &happyOrchardRewardWithSeedDb{Db: engine} +} + +func (h happyOrchardRewardWithSeedDb) FindHappyOrchardRewardWithSeedBySeedId(seedId []int) (mm *[]models.HappyOrchardRewardWithSeed, err error) { + var m []models.HappyOrchardRewardWithSeed + if err := h.Db.In("seed_id", seedId).Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} +func (h happyOrchardRewardWithSeedDb) FindHappyOrchardRewardWithSeedBySeedIdAndId(rewardId, seedId int) (m *models.HappyOrchardRewardWithSeed, err error) { + m = new(models.HappyOrchardRewardWithSeed) + has, err := h.Db.Where("reward_id=? and seed_id=?", rewardId, seedId).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} diff --git a/src/implement/happy_orchard_seed_db.go b/src/implement/happy_orchard_seed_db.go index dfd208d..2a9870f 100644 --- a/src/implement/happy_orchard_seed_db.go +++ b/src/implement/happy_orchard_seed_db.go @@ -26,3 +26,10 @@ func (h HappyOrchardSeedDb) GetHappyOrchardSeed(id int) (m *models.HappyOrchardS } return m, nil } +func (h HappyOrchardSeedDb) FindHappyOrchardSeedAll(start, limit int) (mm *[]models.HappyOrchardSeed, err error) { + var m []models.HappyOrchardSeed + if err := h.Db.OrderBy("sort desc,id desc").Limit(limit, start).Find(&m); err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + return &m, nil +} diff --git a/src/implement/happy_orchard_sign_day_db.go b/src/implement/happy_orchard_sign_day_db.go new file mode 100644 index 0000000..ac70f3a --- /dev/null +++ b/src/implement/happy_orchard_sign_day_db.go @@ -0,0 +1,43 @@ +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 happyOrchardSignDayDb struct { + Db *xorm.Engine + Sess *xorm.Session +} + +func NewHappyOrchardSignDayDb(engine *xorm.Engine) dao.HappyOrchardSignDayDao { + return &happyOrchardSignDayDb{Db: engine} +} +func NewHappyOrchardSignDaySess(sess *xorm.Session) dao.HappyOrchardSignDayDao { + return &happyOrchardSignDayDb{Sess: sess} +} +func (h happyOrchardSignDayDb) GetHappyOrchardSignDaySess(uid int) (m *models.HappyOrchardSignDay, err error) { + m = new(models.HappyOrchardSignDay) + has, err := h.Sess.Where("uid =?", uid).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} + +func (h happyOrchardSignDayDb) GetHappyOrchardSignDay(uid int) (m *models.HappyOrchardSignDay, err error) { + m = new(models.HappyOrchardSignDay) + has, err := h.Db.Where("uid =?", uid).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} diff --git a/src/implement/happy_orchard_user_seed_record_db.go b/src/implement/happy_orchard_user_seed_record_db.go new file mode 100644 index 0000000..dbbd540 --- /dev/null +++ b/src/implement/happy_orchard_user_seed_record_db.go @@ -0,0 +1,60 @@ +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" + "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" + "xorm.io/xorm" +) + +type happyOrchardUserSeedRecordDb struct { + Db *xorm.Engine +} + +func NewHappyOrchardUserSeedRecordDb(engine *xorm.Engine) dao.HappyOrchardUserSeedRecordDao { + return &happyOrchardUserSeedRecordDb{Db: engine} +} + +func (h happyOrchardUserSeedRecordDb) GetHappyOrchardUserSeedRecord(id int) (m *models.HappyOrchardUserSeedRecord, err error) { + //TODO implement me + 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) FindHappyOrchardUserSeedRecordByUid(uid int) (mm *[]models.HappyOrchardUserSeedRecord, err error) { + //TODO implement me + 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 (h happyOrchardUserSeedRecordDb) GetHappyOrchardUserSeedRecordByUidWithState(uid, state int) (m *models.HappyOrchardUserSeedRecord, err error) { + m = new(models.HappyOrchardUserSeedRecord) + has, err := h.Db.Where("uid =? and state=?", uid, state).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) GetHappyOrchardUserSeedRecordByUidWithStateAndId(uid, id, state int) (m *models.HappyOrchardUserSeedRecord, err error) { + m = new(models.HappyOrchardUserSeedRecord) + has, err := h.Db.Where("uid =? and state=? and id=?", uid, state, id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} diff --git a/src/implement/happy_orchard_user_waters_db.go b/src/implement/happy_orchard_user_waters_db.go index 1df0b5c..53a472f 100644 --- a/src/implement/happy_orchard_user_waters_db.go +++ b/src/implement/happy_orchard_user_waters_db.go @@ -8,13 +8,18 @@ import ( ) type happyOrchardUserWatersDb struct { - Db *xorm.Engine + Db *xorm.Engine + Sess *xorm.Session } func NewHappyOrchardUserWatersDb(engine *xorm.Engine) dao.HappyOrchardUserWatersDao { return &happyOrchardUserWatersDb{Db: engine} } +func NewHappyOrchardUserWatersSess(sess *xorm.Session) dao.HappyOrchardUserWatersDao { + return &happyOrchardUserWatersDb{Sess: sess} +} + func (h happyOrchardUserWatersDb) GetHappyOrchardUserWaters(uid int) (m *models.HappyOrchardUserWaters, err error) { m = new(models.HappyOrchardUserWaters) has, err := h.Db.Where("uid =?", uid).Get(m) @@ -26,3 +31,14 @@ func (h happyOrchardUserWatersDb) GetHappyOrchardUserWaters(uid int) (m *models. } return m, nil } +func (h happyOrchardUserWatersDb) GetHappyOrchardUserWatersSess(uid int) (m *models.HappyOrchardUserWaters, err error) { + m = new(models.HappyOrchardUserWaters) + has, err := h.Sess.Where("uid =?", uid).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +} diff --git a/src/models/happy_orchard_basic_setting.go b/src/models/happy_orchard_basic_setting.go index 730dc10..b24db8e 100644 --- a/src/models/happy_orchard_basic_setting.go +++ b/src/models/happy_orchard_basic_setting.go @@ -10,6 +10,7 @@ type HappyOrchardBasicSetting struct { AdRotationData int `json:"ad_rotation_data" xorm:"not null default 1 comment('广告轮播数据(1:仅读取真实数据 2:仅读取虚拟数据 3:两者都读取)') TINYINT(1)"` IsOpenSevenDaysSign int `json:"is_open_seven_days_sign" xorm:"not null default 1 comment('是否开启7日签到(1:开启 0:关闭)') TINYINT(1)"` SevenDaysSignRewardData string `json:"seven_days_sign_reward_data" xorm:"not null comment('7日签到奖励数据') TEXT"` + VideoSevenDaysSignRewardData string `json:"video_seven_days_sign_reward_data" xorm:"not null comment('观看视频后的7日签到奖励数据') TEXT"` IsOpenTimerSign int `json:"is_open_timer_sign" xorm:"not null default 1 comment('是否开启定时签到(1:开启 0:关闭)') TINYINT(1)"` TimerSignRewardData string `json:"timer_sign_reward_data" xorm:"not null comment('定时签到奖励数据') TEXT"` IsOpenPlaceOrderReward int `json:"is_open_place_order_reward" xorm:"not null default 1 comment('是否下单获得奖励(1:开启 0:关闭)') TINYINT(1)"` diff --git a/src/models/happy_orchard_reward_exchange_records.go b/src/models/happy_orchard_reward_exchange_records.go index a20481d..b87ed22 100644 --- a/src/models/happy_orchard_reward_exchange_records.go +++ b/src/models/happy_orchard_reward_exchange_records.go @@ -10,6 +10,7 @@ type HappyOrchardRewardExchangeRecords struct { SeedName string `json:"seed_name" xorm:"not null default '' comment('种子名称') VARCHAR(255)"` WaterNums int `json:"water_nums" xorm:"not null default 0 comment('所需水滴数') INT(11)"` State int `json:"state" xorm:"not null default 0 comment('兑换状态(1:未发放 2:已发放)') TINYINT(1)"` + RecordId int `json:"record_id" xorm:"default 0 INT(11)"` LogisticCompany string `json:"logistic_company" xorm:"not null default '' comment('物流公司') VARCHAR(255)"` LogisticCompanyCode string `json:"logistic_company_code" xorm:"not null default '' comment('物流公司代号') CHAR(50)"` LogisticNum string `json:"logistic_num" xorm:"default '' comment('物流单号') VARCHAR(255)"` diff --git a/src/models/happy_orchard_sign_day.go b/src/models/happy_orchard_sign_day.go new file mode 100644 index 0000000..aec487b --- /dev/null +++ b/src/models/happy_orchard_sign_day.go @@ -0,0 +1,10 @@ +package models + +type HappyOrchardSignDay struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Uid int `json:"uid" xorm:"default 0 INT(11)"` + ContinuityDay int `json:"continuity_day" xorm:"default 0 comment('连续签到天数') INT(11)"` + LastContinuityDay int `json:"last_continuity_day" xorm:"comment('上一次连续签到天数') INT(11)"` + SignTime int `json:"sign_time" xorm:"default 0 comment('20240409') INT(11)"` + LastSignTime int `json:"last_sign_time" xorm:"default 0 comment('20240409') INT(11)"` +} diff --git a/src/models/happy_orchard_user_seed_record.go b/src/models/happy_orchard_user_seed_record.go new file mode 100644 index 0000000..a46e82a --- /dev/null +++ b/src/models/happy_orchard_user_seed_record.go @@ -0,0 +1,16 @@ +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:"default 0 INT(11)"` + SeedName string `json:"seed_name" xorm:"default '' VARCHAR(255)"` + WaterNums int `json:"water_nums" xorm:"default 0 INT(11)"` + State int `json:"state" xorm:"default 0 INT(11)"` + Time time.Time `json:"time" xorm:"DATETIME"` + ChangeNum int `json:"change_num" xorm:"not null default 0 comment('更换种子的次数') INT(11)"` +} From f2a8ff9c85ab744b6d70d0d47df094f2a870d34a Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 21 May 2024 10:43:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/happy_orchard_user_seed_record.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/models/happy_orchard_user_seed_record.go b/src/models/happy_orchard_user_seed_record.go index a46e82a..b9916ac 100644 --- a/src/models/happy_orchard_user_seed_record.go +++ b/src/models/happy_orchard_user_seed_record.go @@ -7,10 +7,9 @@ import ( 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:"default 0 INT(11)"` - SeedName string `json:"seed_name" xorm:"default '' VARCHAR(255)"` - WaterNums int `json:"water_nums" xorm:"default 0 INT(11)"` - State int `json:"state" xorm:"default 0 INT(11)"` - Time time.Time `json:"time" xorm:"DATETIME"` - ChangeNum int `json:"change_num" xorm:"not null default 0 comment('更换种子的次数') 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"` }