FILE / Unmei/Backend
database/games.go
Исходный файл и его история в репозитории.
19 lines
533 B
Go
19 lines
533 B
Go
package database
|
|
|
|
import "time"
|
|
|
|
type Game struct {
|
|
ID int32 `json:"id"`
|
|
OriginalName string `json:"original_name" db:"original_name"`
|
|
LocalizedName string `json:"localized_name" db:"localized_name"`
|
|
Description string `json:"description"`
|
|
Image string `json:"image"`
|
|
ReleaseDate time.Time `json:"release_date" db:"release_date"`
|
|
}
|
|
|
|
func FetchGame(id int32) (Game, error) {
|
|
var game Game
|
|
err := Database.Get(&game, "select * from games where id = $1 limit 1;", id)
|
|
return game, err
|
|
}
|