From 2e593fa11d5d2b4289a7422563a9c410a9a9c59e Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 3 Dec 2024 18:43:48 +0800 Subject: [PATCH 1/2] update --- src/implement/egg_friend_circle_basic_implement.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/implement/egg_friend_circle_basic_implement.go b/src/implement/egg_friend_circle_basic_implement.go index b5fd2ad..8720ae6 100644 --- a/src/implement/egg_friend_circle_basic_implement.go +++ b/src/implement/egg_friend_circle_basic_implement.go @@ -30,7 +30,7 @@ func (e EggFriendCircleBasicDb) EggFriendCircleBasicGetOne() (*model.EggFriendCi func (e EggFriendCircleBasicDb) EggFriendCircleBasicInsert(m *model.EggFriendCircleBasic) (int, error) { _, err := e.Db.InsertOne(m) if err != nil { - return 0, err + return 0, zhios_order_relate_logx.Error(err.Error()) } return m.Id, nil } @@ -38,7 +38,7 @@ func (e EggFriendCircleBasicDb) EggFriendCircleBasicInsert(m *model.EggFriendCir func (e EggFriendCircleBasicDb) UpdateEggFriendCircleBasic(m *model.EggFriendCircleBasic, columns ...string) (int64, error) { affected, err := e.Db.Where("id =?", m.Id).Cols(columns...).Update(m) if err != nil { - return 0, err + return 0, zhios_order_relate_logx.Error(err.Error()) } return affected, nil } From 0caa07ac137cd7a9b552b400bc3880502cf83293 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 3 Dec 2024 23:20:52 +0800 Subject: [PATCH 2/2] update --- src/dao/egg_friend_circle_basic_dao.go | 7 +++++ .../egg_friend_circle_user_black_list_dao.go | 7 +++++ .../egg_friend_circle_basic_implement.go | 25 +++++++++++++++++ ...friend_circle_user_black_list_implement.go | 28 +++++++++++++++++++ src/model/egg_friend_circle_basic.go | 11 ++++++++ .../egg_friend_circle_user_black_list.go | 9 ++++++ 6 files changed, 87 insertions(+) create mode 100644 src/dao/egg_friend_circle_basic_dao.go create mode 100644 src/dao/egg_friend_circle_user_black_list_dao.go create mode 100644 src/implement/egg_friend_circle_basic_implement.go create mode 100644 src/implement/egg_friend_circle_user_black_list_implement.go create mode 100644 src/model/egg_friend_circle_basic.go create mode 100644 src/model/egg_friend_circle_user_black_list.go diff --git a/src/dao/egg_friend_circle_basic_dao.go b/src/dao/egg_friend_circle_basic_dao.go new file mode 100644 index 0000000..94c7448 --- /dev/null +++ b/src/dao/egg_friend_circle_basic_dao.go @@ -0,0 +1,7 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type EggFriendCircleBasicDao interface { + EggFriendCircleBasicGet() (*model.EggFriendCircleBasic, error) +} diff --git a/src/dao/egg_friend_circle_user_black_list_dao.go b/src/dao/egg_friend_circle_user_black_list_dao.go new file mode 100644 index 0000000..b4f44bd --- /dev/null +++ b/src/dao/egg_friend_circle_user_black_list_dao.go @@ -0,0 +1,7 @@ +package dao + +import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + +type EggFriendCircleUserBlackListDao interface { + EggFriendCircleUserBlackListGet(uid int64) (*model.EggFriendCircleUserBlackList, error) +} diff --git a/src/implement/egg_friend_circle_basic_implement.go b/src/implement/egg_friend_circle_basic_implement.go new file mode 100644 index 0000000..7a59e36 --- /dev/null +++ b/src/implement/egg_friend_circle_basic_implement.go @@ -0,0 +1,25 @@ +package implement + +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" + "xorm.io/xorm" +) + +func NewEggFriendCircleBasicDb(engine *xorm.Engine) dao.EggFriendCircleBasicDao { + return &EggFriendCircleBasicDb{Db: engine} +} + +type EggFriendCircleBasicDb struct { + Db *xorm.Engine +} + +func (e EggFriendCircleBasicDb) EggFriendCircleBasicGet() (*model.EggFriendCircleBasic, error) { + var m model.EggFriendCircleBasic + _, err := e.Db.Where("id >= ?", 1).Get(&m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err.Error()) + } + return &m, nil +} diff --git a/src/implement/egg_friend_circle_user_black_list_implement.go b/src/implement/egg_friend_circle_user_black_list_implement.go new file mode 100644 index 0000000..0c79141 --- /dev/null +++ b/src/implement/egg_friend_circle_user_black_list_implement.go @@ -0,0 +1,28 @@ +package implement + +import ( + "code.fnuoos.com/EggPlanet/egg_models.git/src/dao" + "code.fnuoos.com/EggPlanet/egg_models.git/src/model" + zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" + "xorm.io/xorm" +) + +func NewEggFriendCircleUserBlackListDb(engine *xorm.Engine) dao.EggFriendCircleUserBlackListDao { + return &EggFriendCircleUserBlackListDb{Db: engine} +} + +type EggFriendCircleUserBlackListDb struct { + Db *xorm.Engine +} + +func (e EggFriendCircleUserBlackListDb) EggFriendCircleUserBlackListGet(uid int64) (*model.EggFriendCircleUserBlackList, error) { + var m model.EggFriendCircleUserBlackList + has, err := e.Db.Where("uid >= ?", uid).Get(&m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err.Error()) + } + if !has { + return nil, nil + } + return &m, nil +} diff --git a/src/model/egg_friend_circle_basic.go b/src/model/egg_friend_circle_basic.go new file mode 100644 index 0000000..bfd6a47 --- /dev/null +++ b/src/model/egg_friend_circle_basic.go @@ -0,0 +1,11 @@ +package model + +type EggFriendCircleBasic struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + CommentIsRealName int `json:"comment_is_real_name" xorm:"not null default 1 comment('评论是否需要实名认证(1:是 2:否)') TINYINT(1)"` + PublishIsRealName int `json:"publish_is_real_name" xorm:"not null default 1 comment('发布是否需要实名认证(1:是 2:否)') TINYINT(1)"` + CommentNumsEveryDay int `json:"comment_nums_every_day" xorm:"not null default 0 comment('评论每天次数') INT(11)"` + PublishNumsEveryDay int `json:"publish_nums_every_day" xorm:"not null default 0 comment('发布每天次数') INT(11)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` +} diff --git a/src/model/egg_friend_circle_user_black_list.go b/src/model/egg_friend_circle_user_black_list.go new file mode 100644 index 0000000..2d50660 --- /dev/null +++ b/src/model/egg_friend_circle_user_black_list.go @@ -0,0 +1,9 @@ +package model + +type EggFriendCircleUserBlackList struct { + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Uid int64 `json:"uid" xorm:"not null default 1 BIGINT(20)"` + AdmId int `json:"adm_id" xorm:"not null default 1 INT(11)"` + CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` + UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` +}