models

package
v0.0.0-...-0b8d19b Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Floor = &FloorModel{}
View Source
var Inventory = &InventoryModel{}
View Source
var User = &UserModel{}

Functions

This section is empty.

Types

type FloorModel

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

func NewFloorModel

func NewFloorModel(db *gorm.DB) *FloorModel

func (*FloorModel) CreateFloor

func (m *FloorModel) CreateFloor(floor *TFloor) (result *TFloor, err error)

func (*FloorModel) FindActiveFloor

func (m *FloorModel) FindActiveFloor(discordId string) (result *TFloor, err error)

func (*FloorModel) FindAllFloors

func (m *FloorModel) FindAllFloors() (result *TFloors, err error)

func (*FloorModel) FindFloor

func (m *FloorModel) FindFloor(discordId string, floorNumber int) (result *TFloor, err error)

func (*FloorModel) SaveFloor

func (m *FloorModel) SaveFloor(floor *TFloor) (result *TFloor, err error)

type InventoryModel

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

func NewInventoryModel

func NewInventoryModel(db *gorm.DB) *InventoryModel

func (*InventoryModel) CreateInventory

func (m *InventoryModel) CreateInventory(inv *TInventory) (result *TInventory, err error)

func (*InventoryModel) FindAllInventories

func (m *InventoryModel) FindAllInventories() (result *TInventories, err error)

func (*InventoryModel) FindInventory

func (m *InventoryModel) FindInventory(discordId string) (result *TInventory, err error)

func (*InventoryModel) SaveInventory

func (m *InventoryModel) SaveInventory(inv *TInventory) (result *TInventory, err error)

type TFloor

type TFloor struct {
	ID          uint    `gorm:"type:bigserial;primaryKey"`
	DiscordId   string  `gorm:"type:varchar;not null;uniqueIndex:idx_floors_number"`
	Floor       int     `gorm:"type:integer;default:1;not null;uniqueIndex:idx_floors_number"`
	Exploration float32 `gorm:"type:real;default:0;not null"`
	Active      bool    `gorm:"type:boolean;default:false;not null"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type TFloors

type TFloors []TFloor

type TInventories

type TInventories []TInventory

type TInventory

type TInventory struct {
	ID         uint   `gorm:"type:bigserial;primaryKey"`
	DiscordId  string `gorm:"type:varchar;not null"`
	ItemName   string `gorm:"type:varchar;not null"`
	ItemType   string `gorm:"type:varchar;not null"`
	Durability int    `gorm:"type:integer;not null"`
	Active     bool   `gorm:"type:boolean;default:false;not null"`
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type TUser

type TUser struct {
	ID             uint   `gorm:"type:bigserial;primaryKey"`
	DiscordId      string `gorm:"type:varchar;not null;unique;uniqueIndex"`
	Coins          int    `gorm:"type:integer;default:0;not null"`
	Level          int    `gorm:"type:integer;default:1;not null"`
	Xp             int    `gorm:"type:integer;default:0;not null"`
	Kills          int    `gorm:"type:integer;default:0;not null"`
	Class          string `gorm:"type:varchar;not null"`
	Subclass       string `gorm:"type:varchar;not null"`
	ClassAscension string `gorm:"type:varchar;default:'1';not null"`
	Strength       int    `gorm:"type:integer;default:1;not null"`
	Agility        int    `gorm:"type:integer;default:1;not null"`
	Mana           int    `gorm:"type:integer;default:1;not null"`
	Health         int    `gorm:"type:integer;default:1;not null"`
	Defence        int    `gorm:"type:integer;default:1;not null"`
	Luck           int    `gorm:"type:integer;default:1;not null"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type TUsers

type TUsers []TUser

type UserModel

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

func NewUserModel

func NewUserModel(db *gorm.DB) *UserModel

func (*UserModel) CreateUser

func (m *UserModel) CreateUser(user *TUser) (result *TUser, err error)

func (*UserModel) FindAllUsers

func (m *UserModel) FindAllUsers() (result *TUsers, err error)

func (*UserModel) FindUser

func (m *UserModel) FindUser(discordId string) (result *TUser, err error)

func (*UserModel) SaveUser

func (m *UserModel) SaveUser(user *TUser) (result *TUser, err error)

Jump to

Keyboard shortcuts

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