db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArenaUserTable

func ArenaUserTable(x int64) func(tx *gorm.DB) *gorm.DB

func NewDBService

func NewDBService(cfg *config.DB)

func NewMysql

func NewMysql(dsn string) *gorm.DB

func NewSqlite

func NewSqlite(dsn string) *gorm.DB

func NewYostarRank

func NewYostarRank(cfg *config.DB) *gorm.DB

func RaidEliminateUserTable

func RaidEliminateUserTable(x int64) func(tx *gorm.DB) *gorm.DB

func RaidUserTable

func RaidUserTable(x int64) func(tx *gorm.DB) *gorm.DB

func UpAllYostarRank

func UpAllYostarRank(yostarRankSql *gorm.DB, x []*YostarRank, table func(tx *gorm.DB) *gorm.DB) error

UpAllYostarRank 批量覆盖保存排名数据

Types

type DBGame

type DBGame interface {
	// BlackDevice
	GetBlackDeviceByYostarUid(deviceId string) *dbstruct.BlackDevice // 使用DeviceId拉取数据
	// YostarAccount
	GetYostarAccountByYostarAccount(yostarAccount string) *dbstruct.YostarAccount          // 使用YostarAccount拉取数据
	GetYostarAccountByYostarUid(yostarUid int64) *dbstruct.YostarAccount                   // 使用YostarUid拉取数据
	AddYostarAccountByYostarAccount(yostarAccount string) (*dbstruct.YostarAccount, error) // 指定YostarAccount创建数据
	UpdateYostarAccount(data *dbstruct.YostarAccount) error                                // 更新账号数据
	// YostarClan
	GetYostarClanByServerId(serverId int64) *dbstruct.YostarClan           // 使用ServerId拉取数据
	GetYostarClanByClanName(clanName string) *dbstruct.YostarClan          // 使用ClanName拉取数据
	AddYostarClanByClanName(clanName string) (*dbstruct.YostarClan, error) // 指定ClanName创建数据
	UpdateYostarClan(data *dbstruct.YostarClan) error                      // 更新社团数据
	UpAllYostarClan(list []*dbstruct.YostarClan) error                     // 批量覆盖保存社团数据
	// YostarFriend
	GetYostarFriendByAccountServerId(accountServerId int64) *dbstruct.YostarFriend    // 使用AccountServerId拉取数据
	AddYostarFriendByYostarUid(accountServerId int64) (*dbstruct.YostarFriend, error) // 指定YostarUid创建数据
	UpdateYostarFriend(data *dbstruct.YostarFriend) error                             // 更新好友数据
	UpAllYostarFriend(list []*dbstruct.YostarFriend) error                            // 批量覆盖保存好友数据
	// YostarGame
	GetYostarGameByAccountServerId(accountServerId int64) *dbstruct.YostarGame    // 使用AccountServerId拉取数据
	AddYostarGameByYostarUid(accountServerId int64) (*dbstruct.YostarGame, error) // 指定YostarUid创建数据
	UpdateYostarGame(data *dbstruct.YostarGame) error                             // 更新账号数据
	UpAllYostarGame(list []*dbstruct.YostarGame) error                            // 批量覆盖保存账号数据
	// YostarMail
	GetAllYostarMail() []*dbstruct.YostarMail                          //拉取全部邮件
	AddYostarMailBySender(sender string) (*dbstruct.YostarMail, error) // 指定Sender创建数据
	UpdateYostarMail(data *dbstruct.YostarMail) error                  // 更新邮件数据
	DeleteYostarMailById(id int64) error                               // 删除指定全局邮件
	DeleteAllYostarMail() error                                        // 删除全部全局邮件
	// YostarUser
	GetYostarUserByUid(uid int64) *dbstruct.YostarUser                      // 使用Uid拉取数据
	GetYostarUserByYostarUid(yostarUid int64) *dbstruct.YostarUser          // 使用YostarUid拉取数据
	AddYostarUserByYostarUid(yostarUid int64) (*dbstruct.YostarUser, error) // 指定YostarAccount创建数据
	UpdateYostarUser(data *dbstruct.YostarUser) error                       // 更新账号数据
	// YostarUserLogin
	GetYoStarUserLoginByYostarUid(yostarUid int64) *dbstruct.YostarUserLogin          // 使用YostarUid拉取数据
	AddYoStarUserLoginByYostarUid(yostarUid int64) (*dbstruct.YostarUserLogin, error) // 指定YostarUid创建数据
	UpdateYoStarUserLogin(data *dbstruct.YostarUserLogin) error                       // 更新账号数据
}

DBGame 接口

func GetDBGame

func GetDBGame() DBGame

type DBGameService

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

type YostarRank

type YostarRank struct {
	SeasonId int64
	Uid      int64   `gorm:"unique"`
	Score    float64 // 分数
	Rank     int64
}

func GetAllYostarRank

func GetAllYostarRank(yostarRankSql *gorm.DB, table func(tx *gorm.DB) *gorm.DB) []*YostarRank

GetAllYostarRank 拉取全部排名数据

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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