This repository has been archived by the owner on Sep 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_character.go
66 lines (57 loc) · 2.09 KB
/
api_character.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package malscraper
import (
"github.com/rl404/go-malscraper/model"
)
// GetCharacter to get character detail information.
//
// Example: https://myanimelist.net/character/1/Spike_Spiegel.
func (m *Malscraper) GetCharacter(id int) (*model.Character, int, error) {
return m.api.GetCharacter(id)
}
// GetCharacterArticle to get character featured article list.
//
// Example: https://myanimelist.net/character/1/Spike_Spiegel/featured.
func (m *Malscraper) GetCharacterArticle(id int) ([]model.ArticleItem, int, error) {
return m.api.GetCharacterArticle(id)
}
// GetCharacterOgraphy to get character animeography/mangaography list.
//
// Param `_type` should be one of these constants.
//
// AnimeType
// MangaType
//
// Or just use method `GetCharacterAnime()` or `GetCharacterManga()`.
func (m *Malscraper) GetCharacterOgraphy(_type int, id int) ([]model.Role, int, error) {
return m.api.GetCharacterOgraphy(mainTypes[_type], id)
}
// GetCharacterAnime to get character animeography list.
//
// Example: https://myanimelist.net/character/1/Spike_Spiegel.
func (m *Malscraper) GetCharacterAnime(id int) ([]model.Role, int, error) {
return m.GetCharacterOgraphy(AnimeType, id)
}
// GetCharacterManga to get character mangaography list.
//
// Example: https://myanimelist.net/character/1/Spike_Spiegel.
func (m *Malscraper) GetCharacterManga(id int) ([]model.Role, int, error) {
return m.GetCharacterOgraphy(MangaType, id)
}
// GetCharacterPicture to get character picture list.
//
// Example: https://myanimelist.net/character/1/Spike_Spiegel/pictures.
func (m *Malscraper) GetCharacterPicture(id int) ([]string, int, error) {
return m.api.GetCharacterPicture(id)
}
// GetCharacterClub to get character club list.
//
// Example: https://myanimelist.net/character/1/Spike_Spiegel/clubs.
func (m *Malscraper) GetCharacterClub(id int) ([]model.ClubItem, int, error) {
return m.api.GetCharacterClub(id)
}
// GetCharacterVA to get character voice actor list.
//
// Example: https://myanimelist.net/character/1/Spike_Spiegel.
func (m *Malscraper) GetCharacterVA(id int) ([]model.Role, int, error) {
return m.api.GetCharacterVA(id)
}