Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract BelongsToCollection struct #71

Merged
merged 11 commits into from
Dec 10, 2024
23 changes: 13 additions & 10 deletions movies.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import (
jsoniter "github.com/json-iterator/go"
)

// BelongsToCollection type is a struct for a collection the movie is a part of.
type BelongsToCollection struct {
ID int64 `json:"id"`
Name string `json:"name"`
PosterPath string `json:"poster_path"`
BackdropPath string `json:"backdrop_path"`
}

// MovieDetails type is a struct for movie details JSON response.
type MovieDetails struct {
Adult bool `json:"adult"`
BackdropPath string `json:"backdrop_path"`
BelongsToCollection struct {
ID int64 `json:"id"`
Name string `json:"name"`
PosterPath string `json:"poster_path"`
BackdropPath string `json:"backdrop_path"`
} `json:"belongs_to_collection"`
Budget int64 `json:"budget"`
Genres []struct {
Adult bool `json:"adult"`
BackdropPath string `json:"backdrop_path"`
BelongsToCollection BelongsToCollection `json:"belongs_to_collection"`
Budget int64 `json:"budget"`
Genres []struct {
ID int64 `json:"id"`
Name string `json:"name"`
} `json:"genres"`
Expand Down
Loading