wallet

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package wallet 货币系统

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPublicFundsAccountId added in v1.8.5

func GetPublicFundsAccountId() int64

GetPublicFundsId 获取公款账户 ID

一般公款账户 ID 为 0

func GetPublicFundsWallet added in v1.8.5

func GetPublicFundsWallet() int

GetPublicFundsWallet 获取公款账户余额

func GetWalletName

func GetWalletName() string

GetWalletName 获取货币名称

func GetWalletOf

func GetWalletOf(uid int64) (money int)

GetWalletOf 获取钱包数据

func InsertPublicFundsWallet added in v1.8.5

func InsertPublicFundsWallet(money int) error

InsertPublicFundsWallet 更新公款账户余额

与 InsertWalletOf 行为一致,只是将目标锁定为了公款账户。

func InsertWalletOf

func InsertWalletOf(uid int64, money int) error

InsertWalletOf 更新钱包数据

money > 0 增加,money < 0 减少

func IssuancePovertySubsidies

func IssuancePovertySubsidies(uid int64, money int) error

IssuancePovertySubsidies 发放贫困补助

从公款账户扣款向目标发放补贴,补贴记录会被写入数据库。

func SetWalletName

func SetWalletName(name string)

SetWalletName 设置货币名称

Types

type Storage

type Storage struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Storage 货币系统

type SubsidyRecord

type SubsidyRecord struct {
	Time  string
	UID   int64
	Money int
}

SubsidyRecord 补贴记录

func GetFirstSubsidyRecord

func GetFirstSubsidyRecord(uid int64) *SubsidyRecord

GetFirstSubsidyRecord 获取第一个补贴记录

没有记录返回 nil

type Wallet

type Wallet struct {
	UID   int64
	Money int
}

Wallet 钱包

func GetGroupWalletOf

func GetGroupWalletOf(sortable bool, uids ...int64) (wallets []Wallet, err error)

GetGroupWalletOf 获取多人钱包数据

if sort == true,由高到低排序; if sort == false,由低到高排序

Jump to

Keyboard shortcuts

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