DataBase

package
v0.0.0-...-348a65b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountId  uint `gorm:"primarykey;AUTO_INCREMENT"`
	Username   string
	Token      string
	CreateTime int64
}

type Player

type Player struct {
	AccountUid uint32
	PlayerData []byte
}

type Store

type Store struct {
	Db *gorm.DB
	// contains filtered or unexported fields
}
var DBASE *Store

func NewStore

func NewStore(config *config.Config) *Store

NewStore 创建一个新的 store。

func (*Store) AddDatePlayerFieldByFieldName

func (s *Store) AddDatePlayerFieldByFieldName(player *Player) error

添加新账号数据

func (*Store) AddUidPlayer

func (s *Store) AddUidPlayer(uidPlayer *UidPlayer) error

添加新账号

func (*Store) QueryAccountByFieldAccountId

func (s *Store) QueryAccountByFieldAccountId(AccountId uint) *Account

func (*Store) QueryAccountByFieldUsername

func (s *Store) QueryAccountByFieldUsername(Username string) *Account

查询账号

func (*Store) QueryAccountUidByFieldPlayer

func (s *Store) QueryAccountUidByFieldPlayer(AccountId uint32) *Player

使用账号uid拉取数据

func (*Store) QueryUidPlayerUidByFieldPlayer

func (s *Store) QueryUidPlayerUidByFieldPlayer(AccountId uint32) *UidPlayer

使用账号uid拉取数据

func (*Store) UpdateAccountFieldByFieldName

func (s *Store) UpdateAccountFieldByFieldName(account *Account) (uint, error)

添加新账号

func (*Store) UpdatePlayer

func (s *Store) UpdatePlayer(player *Player) error

更新账号

func (*Store) UpdateUidPlayer

func (s *Store) UpdateUidPlayer(accountId uint, uidPlayer *UidPlayer) error

更新账号

type UidPlayer

type UidPlayer struct {
	AccountUid uint `gorm:"primarykey;AUTO_INCREMENT"`
	AccountId  uint
	IsBan      bool
	ComboToken string
}

Jump to

Keyboard shortcuts

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