infrastructure

package
v0.0.0-...-c9962c6 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Leaderboard

type Leaderboard struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"`
	UserID     primitive.ObjectID `bson:"userId"`
	Method     string             `bson:"method"`
	TotalPoint int                `bson:"totalPoint"`
	Rank       int                `bson:"rank"`
	CreatedAt  primitive.DateTime `bson:"createdAt"`
	UpdatedAt  primitive.DateTime `bson:"updatedAt"`
}

func UpsertLeaderboard

func UpsertLeaderboard(ctx context.Context, client *mongo.Client, Leaderboard *Leaderboard) (*Leaderboard, error)

type Point

type Point struct {
	ID     primitive.ObjectID `bson:"_id"`
	UserID primitive.ObjectID `bson:"userId"`
	Point  int                `bson:"point"`
}

func Find

func Find(ctx context.Context, client *mongo.Client) []Point

type UserPoints

type UserPoints struct {
	UserID     primitive.ObjectID `bson:"_id"`
	TotalPoint int                `bson:"totalPoint"`
}

func AggregateUserPoints

func AggregateUserPoints(client *mongo.Client, ctx context.Context) ([]UserPoints, error)

Jump to

Keyboard shortcuts

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