models

package
v0.0.0-...-e3537d7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscordToken

type DiscordToken struct {
	AccessToken string
}

DiscordToken just stores the AccessToken.

type DiscordUser

type DiscordUser struct {
	ID            string `json:"id"`
	Username      string `json:"username"`
	Discriminator string `json:"discriminator"`
	Avatar        string `json:"avatar"`
}

DiscordUser stores all information from a successful request to discord's API.

type EndpointRequest

type EndpointRequest struct {
	ClientIP      string
	Endpoint      string
	RequestedTime time.Time
}

type History

type History struct {
	Added        int  `json:"Added" bson:"Added"` // XIVAPI added time
	IsHQ         bool `json:"IsHQ" bson:"IsHQ"`
	PricePerUnit int  `json:"PricePerUnit" bson:"PricePerUnit"`
	PriceTotal   int  `json:"PriceTotal" bson:"PriceTotal"`
	PurchaseDate int  `json:"PurchaseDate" bson:"PurchaseDate"`
	Quantity     int  `json:"Quantity" bson:"Quantity"`
}

History is an object that holds the previous price history.

type MarketPrices

type MarketPrices struct {
	Added        int  `json:"Added" bson:"Added"`
	IsHQ         bool `json:"IsHQ" bson:"IsHQ"`
	PricePerUnit int  `json:"PricePerUnit" bson:"PricePerUnit"`
	PriceTotal   int  `json:"PriceTotal" bson:"PriceTotal"`
	Quantity     int  `json:"Quantity" bson:"Quantity"`
}

MarketPrices is an object that holds current price market.

type Prices

type Prices struct {
	ItemID        int `bson:"ItemID"`
	Sargatanas    `json:"Sargatanas" bson:"Sargatanas"`
	OnMarketboard bool  `bson:"OnMarketboard"`
	Added         int64 `bson:"Added"` // Database added time.
}

Prices is the object that holds Price information for a specific item.

type Profits

type Profits struct {
	RecipeID         int     `bson:"RecipeID"`
	ItemID           int     `bson:"ItemID"`
	MaterialCosts    int     `bson:"MaterialCosts"`
	Profits          int     `bson:"Profits"`
	ProfitPercentage float32 `bson:"ProfitPercentage"`
	Added            int64   `bson:"Added"`
	// These are for the profits page.
	// No need to recall Recipes for this.
	Name              string `bson:"Name"`
	IconID            int    `bson:"IconID"`
	CraftTypeTargetID int    `bson:"CraftTypeTargetID"`
	RecipeLevelTable  struct {
		ClassJobLevel int `bson:"ClassJobLevel"`
		Stars         int `bson:"Stars"`
	} `bson:"RecipeLevelTable"`
}

Profits is the object that holds Profit information for a specific recipe.

type Recipes

type Recipes struct {
	Name               string `bson:"Name" json:"Name"`
	IconID             int    `bson:"IconID" json:"IconID"`
	ItemResultTargetID int    `bson:"ItemID" json:"ItemResultTargetID"`
	ID                 int    `bson:"RecipeID" json:"ID"`
	CraftTypeTargetID  int    `bson:"CraftTypeTargetID" json:"CraftTypeTargetID"`
	RecipeLevelTable   struct {
		ClassJobLevel int `bson:"ClassJobLevel" json:"ClassJobLevel"`
		Stars         int `bson:"Stars" json:"Stars"`
	} `bson:"RecipeLevelTable" json:"RecipeLevelTable"`
	AmountResult      int        `bson:"AmountResult" json:"AmountResult"`
	IngredientID      [10]int    `bson:"IngredientID"`
	IngredientIconID  [10]int    `bson:"IngredientIconID"`
	IngredientNames   [10]string `bson:"IngredientNames"`
	IngredientAmounts [10]int    `bson:"IngredientAmount"`
	IngredientRecipes [][]int    `bson:"IngredientRecipes"`
	Added             int64      `bson:"Added"`
}

Recipes is the object that holds all Recipe Information.

type Sargatanas

type Sargatanas struct {
	History      []History      `json:"History" bson:"History"`
	MarketPrices []MarketPrices `json:"Prices" bson:"Prices"`
}

Sargatanas is an object that holds History and Current Market Prices for Sargatanas.

type SimplePrices

type SimplePrices struct {
	ItemID            int
	HistoryPrice      int
	LowestMarketPrice int
	OnMarketboard     bool
	Added             int64
}

SimplePrices is a simplified version of the MarketPrices, so that the payloads are simple for now.

type UserPrices

type UserPrices struct {
	ItemID          int
	UsedFor         map[string]bool
	MarketItemPrice int
	MarketAmount    int
}

UserPrices are the POSTed user prices for a specific item

type UserProfits

type UserProfits struct {
	Added            int64
	RecipeID         int
	ItemID           int
	ItemName         string
	IconID           int
	IngredientItemID []int
	MaterialCosts    int
	Profits          int
	ProfitPercentage int
}

UserProfits is the calculated profit for a specific recipe.

type UserSubmission

type UserSubmission struct {
	// Profit Information
	UserID           string
	RecipeID         int
	ItemID           int
	ItemName         string
	IconID           int
	MaterialCosts    int
	Profits          int
	ProfitPercentage int
	MarketItemPrice  int
	MarketAmount     int

	// Price Information
	IngredientItemID       []int
	MarketIngredientPrice  []int
	MarketIngredientAmount []int
}

UserSubmission is an object that holds the payload that is necessary to store in the database.

Jump to

Keyboard shortcuts

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