Use typed IDs instead of plain strings

This commit is contained in:
2019-11-18 14:01:13 +09:00
parent e7c7e84334
commit a50a119e08
26 changed files with 75 additions and 44 deletions

View File

@ -71,7 +71,7 @@ func init() {
}
// AnimeID represents an anime ID.
type AnimeID = string
type AnimeID = ID
// Anime represents an anime.
type Anime struct {
@ -102,15 +102,12 @@ type Anime struct {
hasDraft
// Company IDs
StudioIDs []string `json:"studios" editable:"true"`
ProducerIDs []string `json:"producers" editable:"true"`
LicensorIDs []string `json:"licensors" editable:"true"`
StudioIDs []CompanyID `json:"studios" editable:"true"`
ProducerIDs []CompanyID `json:"producers" editable:"true"`
LicensorIDs []CompanyID `json:"licensors" editable:"true"`
// Links to external websites
Links []*Link `json:"links" editable:"true"`
// SynopsisSource string `json:"synopsisSource" editable:"true"`
// Hashtag string `json:"hashtag"`
}
// NewAnime creates a new anime.