models

package
v0.0.0-...-683f586 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGlobalConfig

func GetGlobalConfig(name string) string

获取全局设置

func SetGlobalConfig

func SetGlobalConfig(name string, value string) error

设置全局设置

Types

type BaseModel

type BaseModel struct {
	ID        uint       `json:"id" gorm:"primary_key"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt time.Time  `json:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt" sql:"index"`
}

type GlobalConfig

type GlobalConfig struct {
	Name      string `gorm:"primary_key"`
	Value     string
	UpdatedAt time.Time `json:"updatedAt"`
}

type LifeTimeStats

type LifeTimeStats struct {
	ID              uint `json:"id" gorm:"primary_key"`
	UpdatedAt       time.Time
	AccountId       string
	GameModeStats   string `gorm:"type:blob"`
	MatchesSolo     string `gorm:"type:blob"`
	MatchesSoloFPP  string `gorm:"type:blob"`
	MatchesDuo      string `gorm:"type:blob"`
	MatchesDuoFPP   string `gorm:"type:blob"`
	MatchesSquad    string `gorm:"type:blob"`
	MatchesSquadFPP string `gorm:"type:blob"`
}

func (*LifeTimeStats) GetInfoByAccountId

func (m *LifeTimeStats) GetInfoByAccountId(shard api.ShardType, accountId string, renew bool) error

func (*LifeTimeStats) GetInfoByUserName

func (m *LifeTimeStats) GetInfoByUserName(shard api.ShardType, username string, renew bool) error

func (*LifeTimeStats) ParseFromPUBG

func (m *LifeTimeStats) ParseFromPUBG(data schema.LifeTimeStats)

type Match

type Match struct {
	BaseModel
	MatchId        string `gorm:"not null;unique_index"`
	Duration       int
	MatchType      string // arcade, custom, event, official, training
	MapName        string // Baltic_Main, Desert_Main, DihorOtok_Main, Erangel_Main, Range_Main, Savage_Main, Summerland_Main
	IsCustomMatch  bool
	SeasonState    string // closed, prepare, progress
	MatchCreatedAt time.Time
	Roster         string `gorm:"type:blob"`
	Assets         string `gorm:"type:blob"`
}

func (*Match) GetMatchInfo

func (m *Match) GetMatchInfo(shard api.ShardType, matchId string) error

获取比赛详情 并进行数据库缓存

func (*Match) ParseFromPUBG

func (m *Match) ParseFromPUBG(data schema.Match)

type Player

type Player struct {
	BaseModel
	AccountId        string `gorm:"not null;unique_index:index_account"`
	Name             string `gorm:"not null;unique_index:index_account"`
	ShardId          string
	AccountCreatedAt time.Time
	AccountUpdatedAt time.Time
}

func (*Player) GetInfoByUserName

func (m *Player) GetInfoByUserName(shard api.ShardType, username string) error

根据用户名获取用户信息 优先从数据库中获取

func (*Player) ParseFromPUBG

func (m *Player) ParseFromPUBG(data schema.Player)

type PubgRequestLog

type PubgRequestLog struct {
	ID        uint `json:"id" gorm:"primary_key"`
	Url       string
	Body      string
	Resp      string `gorm:"type:blob"`
	CreatedAt time.Time
}

Jump to

Keyboard shortcuts

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