balance

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "balance"

Variables

View Source
var PrefixBalanceCacheKey = "cache:balance:"

Functions

This section is empty.

Types

type Balance

type Balance struct {
	ID     primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` // 用户ID
	Flow   *int64             `bson:"flow,omitempty" json:"flow,omitempty"`
	Memory *int64             `bson:"memory,omitempty" json:"memory,omitempty"`
	Point  *int64             `bson:"point,omitempty" json:"point,omitempty"`
}

type IBalanceMongoMapper

type IBalanceMongoMapper interface {
	Insert(ctx context.Context, data *Balance) (string, error)              // 插入
	FindOne(ctx context.Context, id string) (*Balance, error)               // 查找
	Update(ctx context.Context, data *Balance) (*mongo.UpdateResult, error) // 修改
	Delete(ctx context.Context, id string) (int64, error)                   // 删除
}

func NewMongoMapper

func NewMongoMapper(config *config.Config) IBalanceMongoMapper

type MongoMapper

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

func (*MongoMapper) Delete

func (m *MongoMapper) Delete(ctx context.Context, id string) (int64, error)

func (*MongoMapper) FindOne

func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Balance, error)

func (*MongoMapper) Insert

func (m *MongoMapper) Insert(ctx context.Context, data *Balance) (string, error)

func (*MongoMapper) Update

func (m *MongoMapper) Update(ctx context.Context, data *Balance) (*mongo.UpdateResult, error)

Jump to

Keyboard shortcuts

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