models

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

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

Go to latest
Published: Mar 18, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Family

type Family struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Icon string `json:"icon"`
}

type Rarity

type Rarity struct {
	ID         int64  `json:"id"`
	Name       string `json:"name"`
	Icon       string `json:"icon"`
	Frame      string `json:"frame"`
	Background string `json:"background"`
}

type Role

type Role struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Icon string `json:"icon"`
}

type Skill

type Skill struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Icon        string `json:"icon"`
	Description string `json:"description"`
}

type Unit

type Unit struct {
	ID        int64       `json:"id"`
	Name      string      `json:"name"`
	FamilyId  int         `json:"-"`
	Family    Family      `gorm:"ForeignKey:FamilyId" json:"family"`
	RoleId    int         `json:"-"`
	Role      Role        `gorm:"ForeignKey:RoleId" json:"role"`
	RarityId  int64       `json:"-"`
	Rarity    Rarity      `gorm:"ForeignKey:RarityId" json:"rarity"`
	Icon      string      `json:"icon"`
	UnitSkill []UnitSkill `json:"skills"`
}

func (*Unit) FindAllUnit

func (u *Unit) FindAllUnit(db *gorm.DB) (*[]Unit, error)

func (*Unit) FindUnitById

func (u *Unit) FindUnitById(db *gorm.DB, uid uint64) (*Unit, error)

func (*Unit) FindUnitWithFilter

func (u *Unit) FindUnitWithFilter(db *gorm.DB, q map[string][]string) (*[]Unit, error)

type UnitSkill

type UnitSkill struct {
	UnitID  int64 `json:"-"`
	SkillID int64 `json:"-"`
	Skill   Skill `json:"skill"`
	Level   int   `json:"level"`
}

Jump to

Keyboard shortcuts

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