model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Company

type Company struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

Company represents company response

type CreateGameRequest

type CreateGameRequest struct {
	Name         string   `json:"name"`
	Developer    string   `json:"developer"`
	ReleaseDate  string   `json:"releaseDate"`
	GenresIDs    []int32  `json:"genresIds"`
	LogoURL      string   `json:"logoUrl"`
	Summary      string   `json:"summary"`
	PlatformsIDs []int32  `json:"platformsIds"`
	Screenshots  []string `json:"screenshots"`
	Websites     []string `json:"websites"`
}

CreateGameRequest - create game request

func (*CreateGameRequest) Sanitize

func (r *CreateGameRequest) Sanitize()

Sanitize cleans up user input for CreateGameRequest

func (*CreateGameRequest) ValidateWith

func (r *CreateGameRequest) ValidateWith(v *validation.Validator) (bool, []web.FieldError)

ValidateWith validates CreateGameRequest

type CreateRatingRequest

type CreateRatingRequest struct {
	Rating uint8 `json:"rating" validate:"gte=0,lte=5"` // 0 - remove rating
}

CreateRatingRequest - create rating request

func (*CreateRatingRequest) ValidateWith

func (r *CreateRatingRequest) ValidateWith(v *validation.Validator) (bool, []web.FieldError)

ValidateWith validates CreateRatingRequest

type GameResponse

type GameResponse struct {
	ID          int32      `json:"id"`
	Name        string     `json:"name"`
	Developers  []Company  `json:"developers"`
	Publishers  []Company  `json:"publishers"`
	ReleaseDate string     `json:"releaseDate"`
	Genres      []Genre    `json:"genres"`
	LogoURL     string     `json:"logoUrl,omitempty"`
	Rating      float64    `json:"rating"`
	Summary     string     `json:"summary,omitempty"`
	Slug        string     `json:"slug,omitempty"`
	Platforms   []Platform `json:"platforms"`
	Screenshots []string   `json:"screenshots"`
	Websites    []string   `json:"websites"`
}

GameResponse - game response

type GamesResponse

type GamesResponse struct {
	Games []GameResponse `json:"games"`
	Count uint64         `json:"count"`
}

GamesResponse - games response

type Genre

type Genre struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

Genre represents genre response

type GetGamesQueryParams

type GetGamesQueryParams struct {
	PageSize    uint32 `form:"pageSize"`
	Page        uint32 `form:"page"`
	OrderBy     string `form:"orderBy"`
	Name        string `form:"name"`
	GenreID     int32  `form:"genre"`
	DeveloperID int32  `form:"developer"`
	PublisherID int32  `form:"publisher"`
}

GetGamesQueryParams - get games query params

type GetUserRatingsRequest

type GetUserRatingsRequest struct {
	GameIDs []int32 `json:"gameIds"`
}

GetUserRatingsRequest - get user ratings request

func (*GetUserRatingsRequest) ValidateWith

func (r *GetUserRatingsRequest) ValidateWith(v *validation.Validator) (bool, []web.FieldError)

ValidateWith validates GetUserRatingsRequest

type IDResponse

type IDResponse struct {
	ID int32 `json:"id"`
}

IDResponse represents response with id

type ModerationItem

type ModerationItem struct {
	ID        int32  `json:"id"`
	Status    string `json:"resultStatus"`
	Details   string `json:"details"`
	CreatedAt string `json:"createdAt,omitempty"`
	UpdatedAt string `json:"updatedAt,omitempty"`
}

ModerationItem represents a moderation entity for API response

type Platform

type Platform struct {
	ID           int32  `json:"id"`
	Name         string `json:"name"`
	Abbreviation string `json:"abbreviation"`
}

Platform represents platform response

type RatingResponse

type RatingResponse struct {
	GameID int32 `json:"gameId"`
	Rating uint8 `json:"rating"`
}

RatingResponse - rating response

type UpdateGameRequest

type UpdateGameRequest struct {
	Name         *string   `json:"name"`
	Developer    *string   `json:"developer"`
	ReleaseDate  *string   `json:"releaseDate"`
	GenresIDs    *[]int32  `json:"genresIds"`
	LogoURL      *string   `json:"logoUrl"`
	Summary      *string   `json:"summary"`
	PlatformsIDs *[]int32  `json:"platformsIds"`
	Screenshots  *[]string `json:"screenshots"`
	Websites     *[]string `json:"websites"`
}

UpdateGameRequest - update game request. All fields are optional

func (*UpdateGameRequest) Sanitize

func (r *UpdateGameRequest) Sanitize()

Sanitize cleans up user input for CreateGameRequest

func (*UpdateGameRequest) ValidateWith

func (r *UpdateGameRequest) ValidateWith(v *validation.Validator) (bool, []web.FieldError)

ValidateWith validates UpdateGameRequest

type UploadImagesResponse

type UploadImagesResponse struct {
	Files []UploadedFileInfo `json:"files"`
}

UploadImagesResponse represents the response for image upload

type UploadedFileInfo

type UploadedFileInfo struct {
	FileName string `json:"fileName"`
	FileID   string `json:"fileId"`
	FileURL  string `json:"fileUrl"`
	Type     string `json:"type"` // "cover" / "screenshot"
}

UploadedFileInfo represents information about an uploaded file

Jump to

Keyboard shortcuts

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