Newer
Older
pokemon-go-trade / internal / model / model.go
Simon Lindgren on 22 Feb 2021 692 bytes Added want in db
package model

import "fmt"

type Pokemon struct {
	ID         int       `json:"id"`
	DexNumber  int       `json:"dex_number"`
	Name       string    `json:"name"`
	Shiny      bool      `json:"shiny"`
	Url        string    `json:"url"`
	Variations []Pokemon `json:"variations, omitempty"`
}

func (p *Pokemon) FormatUrl() {
	p.Url = fmt.Sprintf("image/%s", p.Url)
}

type WantGroup struct {
	ID        int       `db:"id" json:"id"`
	GroupName string    `db:"group_name" json:"group_name"`
	Pokemons  []Pokemon `json:"pokemons"`
}

type WantPokemon struct {
	ID          int  `db:"id"`
	PokemonID   int  `db:"pokemon_id"`
	WantGroupID int  `db:"want_group_id"`
	Shiny       bool `db:"shiny"`
}