diff --git a/src/dao/egg_friend_circle_basic_dao.go b/src/dao/egg_friend_circle_basic_dao.go index a2512fd..6262764 100644 --- a/src/dao/egg_friend_circle_basic_dao.go +++ b/src/dao/egg_friend_circle_basic_dao.go @@ -3,7 +3,7 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" type EggFriendCircleBasicDao interface { - //TODO:: You can add specific method definitions here + EggFriendCircleBasicGet() (*model.EggFriendCircleBasic, error) EggFriendCircleBasicGetOne() (*model.EggFriendCircleBasic, error) EggFriendCircleBasicInsert(m *model.EggFriendCircleBasic) (int, error) UpdateEggFriendCircleBasic(m *model.EggFriendCircleBasic, columns ...string) (int64, 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 index 8286f20..46d90cd 100644 --- a/src/dao/egg_friend_circle_user_black_list_dao.go +++ b/src/dao/egg_friend_circle_user_black_list_dao.go @@ -3,7 +3,7 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" type EggFriendCircleUserBlackListDao interface { - //TODO:: You can add specific method definitions here + EggFriendCircleUserBlackListGet(uid int64) (*model.EggFriendCircleUserBlackList, error) EggFriendCircleUserBlackListInsert(m *model.EggFriendCircleUserBlackList) (int, error) EggFriendCircleUserBlackListDeleteById(id int) (int64, error) } diff --git a/src/implement/egg_friend_circle_basic_implement.go b/src/implement/egg_friend_circle_basic_implement.go index b5fd2ad..4239a8e 100644 --- a/src/implement/egg_friend_circle_basic_implement.go +++ b/src/implement/egg_friend_circle_basic_implement.go @@ -15,6 +15,14 @@ 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 +} func (e EggFriendCircleBasicDb) EggFriendCircleBasicGetOne() (*model.EggFriendCircleBasic, error) { var m model.EggFriendCircleBasic has, err := e.Db.Where("id >= ?", 1).Get(&m) @@ -30,7 +38,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 +46,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 } diff --git a/src/implement/egg_friend_circle_user_black_list_implement.go b/src/implement/egg_friend_circle_user_black_list_implement.go index 35b2007..8b8876c 100644 --- a/src/implement/egg_friend_circle_user_black_list_implement.go +++ b/src/implement/egg_friend_circle_user_black_list_implement.go @@ -29,3 +29,15 @@ func (e EggFriendCircleUserBlackListDb) EggFriendCircleUserBlackListDeleteById(i } return affected, nil } + +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 +}