entity

package
v0.0.0-...-e246b8e Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameBatchRequest

type GameBatchRequest struct {
	Last      uint64 `json:"last"`
	BatchSize int    `json:"batch_size"`
}

type GameDetailsRequest

type GameDetailsRequest struct {
	Id uint64 `json:"id"`
}

type GameDetailsResponse

type GameDetailsResponse struct {
	Game      TypedGameListProperties `json:"game"`
	Platforms []Platform              `json:"platforms"`
	Genres    []Genre                 `json:"genres"`
}

type GameListRequest

type GameListRequest struct {
	GameId   uint64 `json:"game_id" binding:"required"`
	ListType uint64 `json:"list_type"`
}

type GameProperties

type GameProperties struct {
	Model
	Name         string     `gorm:"unique;uniqueIndex:,class:FULLTEXT" json:"name" binding:"required"`
	Platforms    []Platform `gorm:"many2many:game_platforms" json:"-"`
	ImageURL     string     `json:"image_url" binding:"required,url"`
	YearReleased uint16     `json:"year_released" binding:"required,gte=1000"`
	Genres       []Genre    `gorm:"many2many:game_genres" json:"-"`
}

func (*GameProperties) TableName

func (*GameProperties) TableName() string

type GameSearchResult

type GameSearchResult struct {
	Id   uint64 `json:"id"`
	Name string `json:"name"`
}

type Genre

type Genre struct {
	ID        uint64         `gorm:"primaryKey;autoIncrement" json:"-"`
	CreatedAt time.Time      `json:"-"`
	UpdatedAt time.Time      `json:"-"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
	Name      string         `gorm:"varchar(50);unique;" json:"name"`
}

func (*Genre) TableName

func (*Genre) TableName() string

type ListType

type ListType struct {
	Model
	Name string `gorm:"varchar(20);unique" json:"name"`
}

func (*ListType) TableName

func (*ListType) TableName() string

type LoginProfile

type LoginProfile struct {
	Nickname string `json:"nickname"`
	Email    string `json:"email"`
	Password string `gorm:"varchar(70);not null" json:"password" binding:"gte=6,lte=70"`
}

type Model

type Model struct {
	ID        uint64         `gorm:"primaryKey;autoIncrement" json:"id"`
	CreatedAt time.Time      `json:"-"`
	UpdatedAt time.Time      `json:"-"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}

type Platform

type Platform struct {
	ID        uint64         `gorm:"primaryKey;autoIncrement" json:"-"`
	CreatedAt time.Time      `json:"-"`
	UpdatedAt time.Time      `json:"-"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
	Name      string         `gorm:"varchar(20);unique;" json:"name"`
}

func (*Platform) TableName

func (*Platform) TableName() string

type Profile

type Profile struct {
	ProfileInfo
	Email         string         `gorm:"unique;not null" json:"email" binding:"required"`
	Password      string         `json:"password" binding:"gte=6,lte=70"`
	RefreshTokens []RefreshToken `gorm:"foreignKey:ProfileID" json:"-"`
}

func (*Profile) TableName

func (*Profile) TableName() string

type ProfileCreds

type ProfileCreds struct {
	Nickname string `json:"nickname"`
	Email    string `json:"email"`
}

type ProfileGame

type ProfileGame struct {
	Profile    Profile        `gorm:"foreignKey:ProfileID" json:"-"`
	ProfileID  uint64         `gorm:"primaryKey" json:"-"`
	Game       GameProperties `gorm:"foreignKey:GameID" json:"game"`
	GameID     uint64         `gorm:"primaryKey" json:"-"`
	ListType   ListType       `gorm:"foreignKey:ListTypeID" json:"-"`
	ListTypeID uint64         `json:"list_type"`
}

func (*ProfileGame) TableName

func (*ProfileGame) TableName() string

type ProfileInfo

type ProfileInfo struct {
	Model
	Nickname    string   `gorm:"varchar(20);unique;uniqueIndex:,class:FULLTEXT" json:"nickname" binding:"gte=2,lte=20"`
	Description string   `gorm:"varchar(120)" json:"description" binding:"lte=120"`
	GamesListed uint     `json:"games_listed"`
	Socials     []Social `gorm:"foreignKey:ProfileID"`
}

type RefreshRequest

type RefreshRequest struct {
	RefreshToken string `json:"refresh_token" binding:"required"`
}

type RefreshToken

type RefreshToken struct {
	ID        uint64         `gorm:"primaryKey;autoIncrement" json:"id"`
	CreatedAt time.Time      `json:"-"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
	ProfileID uint64         `json:"-"`
	Token     string         `json:"-"`
}

func (*RefreshToken) TableName

func (*RefreshToken) TableName() string

type SearchRequest

type SearchRequest struct {
	Name string `json:"name"`
}

type Social

type Social struct {
	ProfileID uint64     `gorm:"primaryKey" json:"-"`
	Type      SocialType `gorm:"foreignKey:TypeID" json:"-"`
	TypeID    uint64     `gorm:"primaryKey" json:"type" binding:"required"`
	Data      string     `gorm:"varchar(70)" json:"data" binding:"gte=2,lte=70"`
}

func (*Social) TableName

func (*Social) TableName() string

type SocialType

type SocialType struct {
	Model
	Name string `gorm:"varchar(20);unique" json:"name"`
}

func (*SocialType) TableName

func (*SocialType) TableName() string

type TokenPair

type TokenPair struct {
	Token        string `json:"token"`
	RefreshToken string `json:"refresh_token"`
}

type TypedGameListProperties

type TypedGameListProperties struct {
	GameProperties
	ListTypeID uint64 `json:"user_list"`
}

Jump to

Keyboard shortcuts

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