biz

package
v0.0.0-...-f12ea2b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2023 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Rating

type Rating struct {
	RecordID   uint64 `json:"recordId"`
	RecordType uint64 `json:"recordType"`
	UserID     uint64 `json:"userId"`
	Value      uint32 `json:"value"`
}

type RatingRepo

type RatingRepo interface {
	ListRatings(ctx context.Context, recordType, recordID uint64) (ratings []uint32, err error)
	CreateRating(ctx context.Context, uid uint64, rating *Rating) (err error)
}

type RatingUsecase

type RatingUsecase struct {
	// contains filtered or unexported fields
}

func NewRatingUsecase

func NewRatingUsecase(repo RatingRepo, logger log.Logger) *RatingUsecase

func (*RatingUsecase) CreateRating

func (c *RatingUsecase) CreateRating(ctx context.Context, uid uint64, rating *Rating) error

CreateRating 添加一个评分

func (*RatingUsecase) GetAggregatedRating

func (c *RatingUsecase) GetAggregatedRating(ctx context.Context, recordType, recordID uint64) (ar float64, err error)

GetAggregatedRating 获取平局的评分

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL