2021-02-20 17:40:56 +00:00
|
|
|
package pixiv
|
|
|
|
|
2021-02-22 19:19:27 +00:00
|
|
|
import "fmt"
|
|
|
|
|
2021-02-20 17:40:56 +00:00
|
|
|
//Illust .
|
|
|
|
type Illust struct {
|
|
|
|
complited bool
|
|
|
|
ID string `json:"id"`
|
|
|
|
IlustID string `json:"illustId"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
IllustTitle string `json:"illustTitle"`
|
|
|
|
IllustComment string `json:"illustComment"`
|
|
|
|
IllustType int `json:"illustType"`
|
|
|
|
XRestrict int `json:"xRestrict"`
|
|
|
|
Sl int `json:"sl"`
|
|
|
|
URL string `json:"url"`
|
|
|
|
Pages []IllustPage
|
|
|
|
URLs struct {
|
|
|
|
Mini string `json:"mini"`
|
|
|
|
Thumb string `json:"thumb"`
|
|
|
|
Small string `json:"small"`
|
|
|
|
Regular string `json:"regular"`
|
|
|
|
Original string `json:"original"`
|
|
|
|
} `json:"urls"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Tags struct {
|
|
|
|
AuthorID string `json:"authorId"`
|
|
|
|
IsLocked bool `json:"isLocked"`
|
|
|
|
Tags []IllustTag `json:"tags"`
|
|
|
|
Writable bool `json:"writable"`
|
|
|
|
} `json:"tags,omitempty"`
|
2021-02-22 19:19:27 +00:00
|
|
|
stringTags []string
|
2021-02-20 17:40:56 +00:00
|
|
|
UserID string `json:"userId"`
|
|
|
|
UserName string `json:"userName"`
|
|
|
|
UserAccount string `json:"userAccount"`
|
|
|
|
Width int `json:"width"`
|
|
|
|
Height int `json:"height"`
|
|
|
|
PageCount int `json:"pageCount"`
|
|
|
|
IsBookmarkable bool `json:"isBookmarkable"`
|
|
|
|
Alt string `json:"alt"`
|
|
|
|
IsAdContainer bool `json:"isAdContainer"`
|
|
|
|
TitleCaptionTranslation struct {
|
|
|
|
WorkTitle string `json:"workTitle"`
|
|
|
|
WorkCaption string `json:"workCaption"`
|
|
|
|
} `json:"titleCaptionTranslation"`
|
|
|
|
CreateDate string `json:"createDate"`
|
|
|
|
UpdateDate string `json:"updateDate"`
|
|
|
|
IsUnlisted bool `json:"isUnlisted"`
|
|
|
|
ProfileImageURL string `json:"profileImageUrl"`
|
|
|
|
}
|
|
|
|
|
2021-02-22 19:19:27 +00:00
|
|
|
// TagsString returns tags in one string separated by "," character
|
|
|
|
func (i *Illust) TagsString() (r string) {
|
|
|
|
for _, tag := range i.stringTags {
|
|
|
|
r = fmt.Sprintf("%s,%s", r, tag)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-02-20 17:40:56 +00:00
|
|
|
//IllustTag .
|
|
|
|
type IllustTag struct {
|
|
|
|
Tag string `json:"tag"`
|
|
|
|
Locked bool `json:"locked"`
|
|
|
|
Deletable bool `json:"deletable"`
|
|
|
|
UserID string `json:"userId"`
|
|
|
|
UserName string `json:"userName"`
|
|
|
|
Romaji string `json:"romaji"`
|
|
|
|
Translation struct {
|
|
|
|
En string `json:"en"`
|
|
|
|
} `json:"translation"`
|
|
|
|
}
|
|
|
|
|
|
|
|
//IllustPage .
|
|
|
|
type IllustPage struct {
|
|
|
|
URLs struct {
|
|
|
|
Mini string `json:"mini"`
|
|
|
|
Thumb string `json:"thumb"`
|
|
|
|
Small string `json:"small"`
|
|
|
|
Regular string `json:"regular"`
|
|
|
|
Original string `json:"original"`
|
|
|
|
} `json:"urls"`
|
|
|
|
Width int `json:"width"`
|
|
|
|
Height int `json:"height"`
|
|
|
|
}
|
|
|
|
|
|
|
|
//User .
|
|
|
|
type User struct {
|
|
|
|
UserID string `json:"userId"`
|
|
|
|
UserName string `json:"userName"`
|
|
|
|
ProfileImageURL string `json:"profileImageUrl"`
|
|
|
|
Following bool `json:"following"`
|
|
|
|
Followed bool `json:"followed"`
|
|
|
|
illusts []Illust
|
|
|
|
}
|