biz

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Achievement

type Achievement struct {
	Uuid     string
	Agree    int32
	Collect  int32
	View     int32
	Follow   int32
	Followed int32
	Score    int32
}

type AchievementRepo

type AchievementRepo interface {
	GetAchievementList(ctx context.Context, uuids []string) ([]*Achievement, error)
	GetUserAchievement(ctx context.Context, uuid string) (*Achievement, error)
	GetUserMedal(ctx context.Context, uuid string) (*Medal, error)
	GetUserActive(ctx context.Context, uuid string) (*Active, error)
	SetAchievementAgree(ctx context.Context, uuid string) error
	SetActiveAgree(ctx context.Context, userUuid string) error
	SetAchievementView(ctx context.Context, uuid string) error
	SetAchievementCollect(ctx context.Context, uuid string) error
	SetAchievementFollow(ctx context.Context, uuid string) error
	SetAchievementFollowed(ctx context.Context, uuid string) error
	SetAchievementAgreeToCache(ctx context.Context, uuid string) error
	SetAchievementViewToCache(ctx context.Context, uuid string) error
	SetAchievementCollectToCache(ctx context.Context, uuid string) error
	SetAchievementFollowToCache(ctx context.Context, follow, followed string) error
	SetUserMedalToCache(ctx context.Context, medal, uuid string) error
	SetUserMedal(ctx context.Context, medal, uuid string) error
	CancelAchievementAgree(ctx context.Context, uuid string) error
	CancelActiveAgree(ctx context.Context, userUuid string) error
	CancelAchievementAgreeFromCache(ctx context.Context, uuid string) error
	CancelAchievementCollect(ctx context.Context, uuid string) error
	CancelAchievementCollectFromCache(ctx context.Context, uuid string) error
	CancelAchievementFollow(ctx context.Context, uuid string) error
	CancelAchievementFollowed(ctx context.Context, uuid string) error
	CancelAchievementFollowFromCache(ctx context.Context, follow, followed string) error
	CancelUserMedalFromCache(ctx context.Context, medal, uuid string) error
	CancelUserMedal(ctx context.Context, medal, uuid string) error
	AddAchievementScore(ctx context.Context, uuid string, score int32) error
	AddAchievementScoreToCache(ctx context.Context, uuid string, score int32) error
	SendMedalToMq(ctx context.Context, medal, uuid, mode string) error
}

type AchievementUseCase

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

func NewAchievementUseCase

func NewAchievementUseCase(repo AchievementRepo, re Recovery, tm Transaction, logger log.Logger) *AchievementUseCase

func (*AchievementUseCase) AccessUserMedal

func (r *AchievementUseCase) AccessUserMedal(ctx context.Context, medal, uuid string) error

func (*AchievementUseCase) AccessUserMedalDbAndCache

func (r *AchievementUseCase) AccessUserMedalDbAndCache(ctx context.Context, medal, uuid string) error

func (*AchievementUseCase) AddAchievementScore

func (r *AchievementUseCase) AddAchievementScore(ctx context.Context, uuid string, score int32) error

func (*AchievementUseCase) CancelAchievementAgree

func (r *AchievementUseCase) CancelAchievementAgree(ctx context.Context, uuid, userUuid string) error

func (*AchievementUseCase) CancelAchievementCollect

func (r *AchievementUseCase) CancelAchievementCollect(ctx context.Context, uuid string) error

func (*AchievementUseCase) CancelAchievementFollow

func (r *AchievementUseCase) CancelAchievementFollow(ctx context.Context, follow, followed string) error

func (*AchievementUseCase) CancelUserMedalDbAndCache

func (r *AchievementUseCase) CancelUserMedalDbAndCache(ctx context.Context, medal, uuid string) error

func (*AchievementUseCase) CancelUserMedalSet

func (r *AchievementUseCase) CancelUserMedalSet(ctx context.Context, medal, uuid string) error

func (*AchievementUseCase) GetAchievementList

func (r *AchievementUseCase) GetAchievementList(ctx context.Context, uuids []string) ([]*Achievement, error)

func (*AchievementUseCase) GetUserAchievement

func (r *AchievementUseCase) GetUserAchievement(ctx context.Context, uuid string) (*Achievement, error)

func (*AchievementUseCase) GetUserActive

func (r *AchievementUseCase) GetUserActive(ctx context.Context, uuid string) (*Active, error)

func (*AchievementUseCase) GetUserMedal

func (r *AchievementUseCase) GetUserMedal(ctx context.Context, uuid string) (*Medal, error)

func (*AchievementUseCase) SetAchievementAgree

func (r *AchievementUseCase) SetAchievementAgree(ctx context.Context, uuid, userUuid string) error

func (*AchievementUseCase) SetAchievementCollect

func (r *AchievementUseCase) SetAchievementCollect(ctx context.Context, uuid string) error

func (*AchievementUseCase) SetAchievementFollow

func (r *AchievementUseCase) SetAchievementFollow(ctx context.Context, follow, followed string) error

func (*AchievementUseCase) SetAchievementView

func (r *AchievementUseCase) SetAchievementView(ctx context.Context, uuid string) error

func (*AchievementUseCase) SetUserMedal

func (r *AchievementUseCase) SetUserMedal(ctx context.Context, medal, uuid string) error

func (*AchievementUseCase) SetUserMedalDbAndCache

func (r *AchievementUseCase) SetUserMedalDbAndCache(ctx context.Context, medal, uuid string) error

type Active

type Active struct {
	Agree int32
}

type CommentMap added in v1.2.0

type CommentMap struct {
	Uuid  string
	Medal string
	Mode  string
}

func (CommentMap) MarshalEasyJSON added in v1.2.0

func (v CommentMap) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CommentMap) MarshalJSON added in v1.2.0

func (v CommentMap) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CommentMap) UnmarshalEasyJSON added in v1.2.0

func (v *CommentMap) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CommentMap) UnmarshalJSON added in v1.2.0

func (v *CommentMap) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Medal

type Medal struct {
	Creation1 int32
	Creation2 int32
	Creation3 int32
	Creation4 int32
	Creation5 int32
	Creation6 int32
	Creation7 int32
	Agree1    int32
	Agree2    int32
	Agree3    int32
	Agree4    int32
	Agree5    int32
	Agree6    int32
	View1     int32
	View2     int32
	View3     int32
	Comment1  int32
	Comment2  int32
	Comment3  int32
	Collect1  int32
	Collect2  int32
	Collect3  int32
}

type Recovery

type Recovery interface {
	GroupRecover(context.Context, func(ctx context.Context) error) func() error
}

type Transaction

type Transaction interface {
	ExecTx(context.Context, func(ctx context.Context) error) error
}

Jump to

Keyboard shortcuts

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