models

package
v0.0.0-...-e8d3914 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARALLEL = 2
	UA       = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
)

Variables

View Source
var DB *gorm.DB

Functions

func BindDevelopers

func BindDevelopers(gid int32, items []string)

func BindGenres

func BindGenres(gid int32, items []string)

func BindPublishers

func BindPublishers(gid int32, items []string)

func Initialize

func Initialize() *gorm.DB

Types

type BaseGameModel

type BaseGameModel struct {
	gorm.Model
	GameID   int32 `gorm:"uniqueIndex`
	TargetID int32
}

type BaseModel

type BaseModel struct {
	gorm.Model
	CnName string `gorm:"type:varchar(200);default:"`
	EnName string `gorm:"type:varchar(200);uniqueIndex`
}

type Developer

type Developer struct {
	BaseModel
}

func GetDevelopers

func GetDevelopers(id int32) (items []Developer)

type Game

type Game struct {
	ID              int32   `gorm:"primaryKey;autoIncrement"`
	CnTitle         string  `gorm:"default:"`
	EnTitle         string  `gorm:"type:varchar(200);index:,default:"`
	Score           float32 `gorm:"default:0.0"`
	MetacriticScore uint8   `gorm:"default:0"`
	ThumbImg        string  `gorm:"type:varchar(100);default:"`
	Slug            string  `gorm:"type:varchar(200);uniqueIndex"`
	Kind            uint8   `gorm:"default:0"`
	Desc            string
	Aliases         string
	HasChinese      bool
	ReleaseTime     datatypes.Date
}

func GetAllGames

func GetAllGames() []Game

func (*Game) Developers

func (g *Game) Developers() []Developer

func (*Game) Genres

func (g *Game) Genres() []Genre

func (*Game) Publishers

func (g *Game) Publishers() []Publisher

type GameDeveloper

type GameDeveloper struct {
	BaseGameModel
}

type GameGenre

type GameGenre struct {
	BaseGameModel
}

type GamePublisher

type GamePublisher struct {
	BaseGameModel
}

type Genre

type Genre struct {
	BaseModel
}

func GetGenres

func GetGenres(id int32) (items []Genre)

type Price

type Price struct {
	ID       int32 `gorm:"primaryKey;autoIncrement"`
	GID      int32 `gorm:"index:"`
	Discount float32
	Origin   float32
	Country  int32
	SaleEnds datatypes.Date `gorm:"default:"`
}

type Publisher

type Publisher struct {
	BaseModel
}

func GetPublishers

func GetPublishers(id int32) (items []Publisher)

Jump to

Keyboard shortcuts

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