@@ -3,7 +3,7 @@ | |||||
import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | ||||
type EggFriendCircleBasicDao interface { | type EggFriendCircleBasicDao interface { | ||||
//TODO:: You can add specific method definitions here | |||||
EggFriendCircleBasicGet() (*model.EggFriendCircleBasic, error) | |||||
EggFriendCircleBasicGetOne() (*model.EggFriendCircleBasic, error) | EggFriendCircleBasicGetOne() (*model.EggFriendCircleBasic, error) | ||||
EggFriendCircleBasicInsert(m *model.EggFriendCircleBasic) (int, error) | EggFriendCircleBasicInsert(m *model.EggFriendCircleBasic) (int, error) | ||||
UpdateEggFriendCircleBasic(m *model.EggFriendCircleBasic, columns ...string) (int64, error) | UpdateEggFriendCircleBasic(m *model.EggFriendCircleBasic, columns ...string) (int64, error) | ||||
@@ -3,7 +3,7 @@ | |||||
import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" | ||||
type EggFriendCircleUserBlackListDao interface { | type EggFriendCircleUserBlackListDao interface { | ||||
//TODO:: You can add specific method definitions here | |||||
EggFriendCircleUserBlackListGet(uid int64) (*model.EggFriendCircleUserBlackList, error) | |||||
EggFriendCircleUserBlackListInsert(m *model.EggFriendCircleUserBlackList) (int, error) | EggFriendCircleUserBlackListInsert(m *model.EggFriendCircleUserBlackList) (int, error) | ||||
EggFriendCircleUserBlackListDeleteById(id int) (int64, error) | EggFriendCircleUserBlackListDeleteById(id int) (int64, error) | ||||
} | } |
@@ -15,6 +15,14 @@ type EggFriendCircleBasicDb struct { | |||||
Db *xorm.Engine | 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) { | func (e EggFriendCircleBasicDb) EggFriendCircleBasicGetOne() (*model.EggFriendCircleBasic, error) { | ||||
var m model.EggFriendCircleBasic | var m model.EggFriendCircleBasic | ||||
has, err := e.Db.Where("id >= ?", 1).Get(&m) | 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) { | func (e EggFriendCircleBasicDb) EggFriendCircleBasicInsert(m *model.EggFriendCircleBasic) (int, error) { | ||||
_, err := e.Db.InsertOne(m) | _, err := e.Db.InsertOne(m) | ||||
if err != nil { | if err != nil { | ||||
return 0, err | |||||
return 0, zhios_order_relate_logx.Error(err.Error()) | |||||
} | } | ||||
return m.Id, nil | 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) { | func (e EggFriendCircleBasicDb) UpdateEggFriendCircleBasic(m *model.EggFriendCircleBasic, columns ...string) (int64, error) { | ||||
affected, err := e.Db.Where("id =?", m.Id).Cols(columns...).Update(m) | affected, err := e.Db.Where("id =?", m.Id).Cols(columns...).Update(m) | ||||
if err != nil { | if err != nil { | ||||
return 0, err | |||||
return 0, zhios_order_relate_logx.Error(err.Error()) | |||||
} | } | ||||
return affected, nil | return affected, nil | ||||
} | } |
@@ -29,3 +29,15 @@ func (e EggFriendCircleUserBlackListDb) EggFriendCircleUserBlackListDeleteById(i | |||||
} | } | ||||
return affected, nil | 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 | |||||
} |