model

package
v0.0.0-...-495cb34 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 3 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         bson.ObjectID `bson:"_id,omitempty"`
	UserID     bson.ObjectID `bson:"userId"`
	Method     string        `bson:"method"`
	TotalPoint int           `bson:"totalPoint"`
	Rank       int           `bson:"rank"`
	CreatedAt  bson.DateTime `bson:"createdAt"`
	UpdatedAt  bson.DateTime `bson:"updatedAt"`
}

Leaderboard ユーザーとスコアの集計結果を格納する

type Point

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

Point ユーザーのポイントを格納する

func GeneratePoints

func GeneratePoints(userIDs []bson.ObjectID, numberOfPoints int) []Point

type User

type User struct {
	ID   bson.ObjectID `bson:"_id"`
	Name string        `bson:"name"`
}

User ユーザーデータを表す構造体

func GenerateUsers

func GenerateUsers(numberOfUsers int) []User

Jump to

Keyboard shortcuts

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