Documentation
¶
Index ¶
- Variables
- func InitTables(db *gorm.DB) error
- func NewDB(c *conf.Data) (*gorm.DB, error)
- func NewInteractiveData(db *gorm.DB, l *zap.Logger) biz.InteractiveRepo
- func NewLogger() *zap.Logger
- func NewRedis(c *conf.Data) redis.Cmdable
- func NewSaramaClient(c *conf.Service) (sarama.Client, error)
- func NewSyncProducer(client sarama.Client) (sarama.SyncProducer, error)
- type Data
- type Interactive
- type InteractiveData
- func (i *InteractiveData) AddCollectCount(ctx context.Context, postId int64, biz string) error
- func (i *InteractiveData) AddLikeCount(ctx context.Context, postId int64, biz string) error
- func (i *InteractiveData) AddReadCount(ctx context.Context, postId int64, biz string) error
- func (i *InteractiveData) GetInteractive(ctx context.Context, postId int64) (domain.Interactive, error)
- func (i *InteractiveData) ListInteractive(ctx context.Context, pagination domain.Pagination) ([]domain.Interactive, error)
- type UserCollection
- type UserLike
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewData, NewDB, NewLogger, NewRedis, NewInteractiveData)
ProviderSet is data providers.
Functions ¶
func InitTables ¶
func NewInteractiveData ¶
func NewSaramaClient ¶
NewSaramaClient 初始化一个新的 Sarama 客户端
func NewSyncProducer ¶
func NewSyncProducer(client sarama.Client) (sarama.SyncProducer, error)
NewSyncProducer 初始化一个新的 Sarama 同步生产者
Types ¶
type Interactive ¶
type Interactive struct {
Id int64 `gorm:"column:id;primaryKey;autoIncrement"`
BizId int64 `gorm:"column:biz_id"`
BizName string `gorm:"column:biz_name;type:varchar(255)"`
ReadCount int64 `gorm:"column:read_count"`
LikeCount int64 `gorm:"column:like_count"`
CollectCount int64 `gorm:"column:collect_count"`
UpdateTime int64 `gorm:"column:update_time"`
CreateTime int64 `gorm:"column:create_time"`
PostId int64 `gorm:"column:post_id"`
DeletedAt int64 `gorm:"index"`
}
type InteractiveData ¶
type InteractiveData struct {
// contains filtered or unexported fields
}
func (*InteractiveData) AddCollectCount ¶
AddCollectCount implements biz.InteractiveRepo.
func (*InteractiveData) AddLikeCount ¶
AddLikeCount implements biz.InteractiveRepo.
func (*InteractiveData) AddReadCount ¶
AddReadCount implements biz.InteractiveRepo.
func (*InteractiveData) GetInteractive ¶
func (i *InteractiveData) GetInteractive(ctx context.Context, postId int64) (domain.Interactive, error)
GetInteractive implements biz.InteractiveRepo.
func (*InteractiveData) ListInteractive ¶
func (i *InteractiveData) ListInteractive(ctx context.Context, pagination domain.Pagination) ([]domain.Interactive, error)
ListInteractive implements biz.InteractiveRepo.
type UserCollection ¶
type UserCollection struct {
ID int64 `gorm:"primaryKey;autoIncrement"` // 收藏记录ID,主键,自增
Uid int64 `gorm:"index"` // 用户ID,用于标识哪个用户收藏
BizID int64 `gorm:"index"` // 业务ID,用于标识收藏的业务对象
BizName string `gorm:"type:varchar(255)"` // 业务名称
Status int `gorm:"column:status"` // 状态,用于表示收藏的状态(如有效、无效等)
CollectionId int64 `gorm:"index"` // 收藏ID,用于标识具体的收藏对象
UpdateTime int64 `gorm:"column:updated_at;type:bigint;not null;index"` // 更新时间,Unix时间戳
CreateTime int64 `gorm:"column:created_at;type:bigint"` // 创建时间,Unix时间戳
Deleted bool `gorm:"column:deleted;default:false"` // 删除标志,表示该记录是否被删除
}
UserCollection 用户收藏
type UserLike ¶
type UserLike struct {
ID int64 `gorm:"primaryKey;autoIncrement"` // 点赞记录ID,主键,自增
Uid int64 `gorm:"index"` // 用户ID,用于标识哪个用户点赞
BizID int64 `gorm:"index"` // 业务ID,用于标识点赞的业务对象
BizName string `gorm:"type:varchar(255)"` // 业务名称
Status int `gorm:"type:int"` // 状态,用于表示点赞的状态(如有效、无效等)
UpdateTime int64 `gorm:"column:updated_at;type:bigint;not null;index"` // 更新时间,Unix时间戳
CreateTime int64 `gorm:"column:created_at;type:bigint"` // 创建时间,Unix时间戳
Deleted bool `gorm:"column:deleted;default:false"` // 删除标志,表示该记录是否被删除
}
UserLike 用户点赞
Click to show internal directories.
Click to hide internal directories.