Documentation ¶
Index ¶
- Variables
- func InitTables(db *egorm.Component) error
- type GORMInteractiveDAO
- func (g *GORMInteractiveDAO) CollectToggle(ctx context.Context, cb UserCollectionBiz) error
- func (g *GORMInteractiveDAO) Get(ctx context.Context, biz string, id int64) (Interactive, error)
- func (g *GORMInteractiveDAO) GetByIds(ctx context.Context, biz string, ids []int64) ([]Interactive, error)
- func (g *GORMInteractiveDAO) GetCollectInfo(ctx context.Context, biz string, id int64, uid int64) (UserCollectionBiz, error)
- func (g *GORMInteractiveDAO) GetLikeInfo(ctx context.Context, biz string, id int64, uid int64) (UserLikeBiz, error)
- func (g *GORMInteractiveDAO) IncrViewCnt(ctx context.Context, biz string, bizId int64) error
- func (g *GORMInteractiveDAO) LikeToggle(ctx context.Context, biz string, id int64, uid int64) error
- type Interactive
- type InteractiveDAO
- type UserCollectionBiz
- type UserLikeBiz
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRecordNotFound = gorm.ErrRecordNotFound
)
Functions ¶
func InitTables ¶
Types ¶
type GORMInteractiveDAO ¶
type GORMInteractiveDAO struct {
// contains filtered or unexported fields
}
func NewInteractiveDAO ¶
func NewInteractiveDAO(db *egorm.Component) *GORMInteractiveDAO
func (*GORMInteractiveDAO) CollectToggle ¶
func (g *GORMInteractiveDAO) CollectToggle(ctx context.Context, cb UserCollectionBiz) error
func (*GORMInteractiveDAO) Get ¶
func (g *GORMInteractiveDAO) Get(ctx context.Context, biz string, id int64) (Interactive, error)
func (*GORMInteractiveDAO) GetByIds ¶
func (g *GORMInteractiveDAO) GetByIds(ctx context.Context, biz string, ids []int64) ([]Interactive, error)
func (*GORMInteractiveDAO) GetCollectInfo ¶
func (g *GORMInteractiveDAO) GetCollectInfo(ctx context.Context, biz string, id int64, uid int64) (UserCollectionBiz, error)
func (*GORMInteractiveDAO) GetLikeInfo ¶
func (g *GORMInteractiveDAO) GetLikeInfo(ctx context.Context, biz string, id int64, uid int64) (UserLikeBiz, error)
func (*GORMInteractiveDAO) IncrViewCnt ¶
func (*GORMInteractiveDAO) LikeToggle ¶
type Interactive ¶
type Interactive struct { Id int64 `gorm:"primaryKey,autoIncrement"` BizId int64 `gorm:"uniqueIndex:biz_type_id"` Biz string `gorm:"type:varchar(128);uniqueIndex:biz_type_id"` ViewCnt int LikeCnt int CollectCnt int Utime int64 Ctime int64 }
汇总表
type InteractiveDAO ¶
type InteractiveDAO interface { IncrViewCnt(ctx context.Context, biz string, bizId int64) error LikeToggle(ctx context.Context, biz string, id int64, uid int64) error CollectToggle(ctx context.Context, cb UserCollectionBiz) error GetLikeInfo(ctx context.Context, biz string, id int64, uid int64) (UserLikeBiz, error) GetCollectInfo(ctx context.Context, biz string, id int64, uid int64) (UserCollectionBiz, error) Get(ctx context.Context, biz string, id int64) (Interactive, error) GetByIds(ctx context.Context, biz string, ids []int64) ([]Interactive, error) }
Click to show internal directories.
Click to hide internal directories.