From 5b61ee87000b0196a40a1da6ca5373da30554134 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Wed, 11 Dec 2024 21:17:23 +0800 Subject: [PATCH] update --- ...nergy_community_dividends_with_user_dao.go | 1 + src/dao/user_egg_score_data_dao.go | 8 +++++++ ...community_dividends_with_user_implement.go | 8 +++++++ .../user_egg_score_data_implement.go | 23 ++++++++++++++++++ src/model/user_egg_score_data.go | 24 +++++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 src/dao/user_egg_score_data_dao.go create mode 100644 src/implement/user_egg_score_data_implement.go create mode 100644 src/model/user_egg_score_data.go diff --git a/src/dao/egg_energy_community_dividends_with_user_dao.go b/src/dao/egg_energy_community_dividends_with_user_dao.go index bdfa775..9791562 100644 --- a/src/dao/egg_energy_community_dividends_with_user_dao.go +++ b/src/dao/egg_energy_community_dividends_with_user_dao.go @@ -7,4 +7,5 @@ type EggEnergyCommunityDividendsWithUserDao interface { EggEnergyCommunityDividendsWithUserInsert(EggEnergyCommunityDividendsWithUser *model.EggEnergyCommunityDividendsWithUser) (int, error) EggEnergyCommunityDividendsWithUserFindAndCount(page, limit int, uid int64) ([]*model.EggEnergyCommunityDividendsWithUser, int64, error) EggEnergyCommunityDividendsWithUserExist(uid int64) (bool, error) + EggEnergyCommunityDividendsWithUserDel(id interface{}) (int64, error) } diff --git a/src/dao/user_egg_score_data_dao.go b/src/dao/user_egg_score_data_dao.go new file mode 100644 index 0000000..5e0aca4 --- /dev/null +++ b/src/dao/user_egg_score_data_dao.go @@ -0,0 +1,8 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type UserEggScoreDataDao interface { + //TODO:: You can add specific method definitions here + UserEggScoreDataInsert(data *model.UserEggScoreData) (int64, error) +} diff --git a/src/implement/egg_energy_community_dividends_with_user_implement.go b/src/implement/egg_energy_community_dividends_with_user_implement.go index 4a4510c..a3c1228 100644 --- a/src/implement/egg_energy_community_dividends_with_user_implement.go +++ b/src/implement/egg_energy_community_dividends_with_user_implement.go @@ -44,3 +44,11 @@ func (e EggEnergyCommunityDividendsWithUserDb) EggEnergyCommunityDividendsWithUs } return has, nil } + +func (e EggEnergyCommunityDividendsWithUserDb) EggEnergyCommunityDividendsWithUserDel(id interface{}) (int64, error) { + affected, err := e.Db.Where("id=?", id).Delete(&model.EggEnergyCommunityDividendsWithUser{}) + if err != nil { + return 0, zhios_order_relate_logx.Error(err.Error()) + } + return affected, nil +} diff --git a/src/implement/user_egg_score_data_implement.go b/src/implement/user_egg_score_data_implement.go new file mode 100644 index 0000000..098eb76 --- /dev/null +++ b/src/implement/user_egg_score_data_implement.go @@ -0,0 +1,23 @@ +package implement + +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + "xorm.io/xorm" +) + +func NewUserEggScoreDataDb(engine *xorm.Engine) dao.UserEggScoreDataDao { + return &UserEggScoreDataDb{Db: engine} +} + +type UserEggScoreDataDb struct { + Db *xorm.Engine +} + +func (u UserEggScoreDataDb) UserEggScoreDataInsert(m *model.UserEggScoreData) (int64, error) { + _, err := u.Db.InsertOne(m) + if err != nil { + return 0, err + } + return m.Id, nil +} diff --git a/src/model/user_egg_score_data.go b/src/model/user_egg_score_data.go new file mode 100644 index 0000000..744fce0 --- /dev/null +++ b/src/model/user_egg_score_data.go @@ -0,0 +1,24 @@ +package model + +type UserEggScoreData struct { + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + Uid int64 `json:"uid" xorm:"not null comment('用户ID') BIGINT(20)"` + Ecpm string `json:"ecpm" xorm:"not null default 0.00000000 comment('ecpm') DECIMAL(20,8)"` + InviteUserNums int `json:"invite_user_nums" xorm:"not null default 0 comment('拉新人数') INT(11)"` + TeamActivityNums int `json:"team_activity_nums" xorm:"not null default 0 comment('团队活跃次数') INT(11)"` + SignInNums int `json:"sign_in_nums" xorm:"not null default 0 comment('签到次数') INT(11)"` + ImActivityNums int `json:"im_activity_nums" xorm:"not null default 0 comment('im活跃次数') INT(11)"` + SendRedPackageNums int `json:"send_red_package_nums" xorm:"not null default 0 comment('发红包次数') INT(11)"` + EggEnergyExchangeAccountBalance int `json:"egg_energy_exchange_account_balance" xorm:"not null default 0 comment('蛋蛋能量兑换余额数量') INT(11)"` + AccountBalanceExchangeEggEnergyNums int `json:"account_balance_exchange_egg_energy_nums" xorm:"not null default 0 comment('余额兑换蛋蛋能量数量') INT(11)"` + SendCircleOfFriendNums int `json:"send_circle_of_friend_nums" xorm:"not null default 0 comment('发朋友圈次数') INT(11)"` + ForumCommentsNums int `json:"forum_comments_nums" xorm:"not null default 0 comment('论坛评论次数') INT(11)"` + CollegeLearningNums int `json:"college_learning_nums" xorm:"not null default 0 comment('学院学习次数') INT(11)"` + ViolateNums int `json:"violate_nums" xorm:"not null default 0 comment('违规次数') INT(11)"` + BrowseInterfaceNums int `json:"browse_interface_nums" xorm:"not null default 0 comment('浏览界面次数') INT(11)"` + PersonAddActivityValue int `json:"person_add_activity_value" xorm:"not null default 0 comment('个人活跃积分') INT(11)"` + Score string `json:"score" xorm:"not null comment('分数') DECIMAL(20,8)"` + Date string `json:"date" xorm:"not null default '0000-00' comment('日期(YYYY-WW)') CHAR(50)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` +}