This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsonstruct.go
156 lines (130 loc) · 3.05 KB
/
jsonstruct.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
package main
type LoginStatusResp struct {
Code int `json:"code"`
}
type LoginResp struct {
Code int `json:"code"`
*Acc `json:"account,omitempty"`
}
type Acc struct {
ID int `json:"id"`
UserName string `json:"userName"`
}
type LoggedinStatusResp struct {
Code int `json:"code"`
*Profile `json:"profile,omitempty"`
}
type UserDetailResp struct {
Code int `json:"code"`
Level int `json:"level,omitempty"`
Profile `json:"profile,omitempty"`
}
type Profile struct {
UserID int `json:"userId"`
Nickname string `json:"nickname"`
}
type StatusCode struct {
Code int `json:"code"`
}
type TopPlaylistsResp struct {
Playlists []*Playlist `json:"playlists"`
Code int `json:"code"`
Total int `json:"total"`
Category string `json:"cat"`
}
type SearchResp struct {
Code int `json:"code"`
SearchResult `json:"result"`
}
type SongURLResp struct {
Code int `json:"code"`
Data []*SongURL `json:"data"`
}
type PlaylistDetailResp struct {
Code int `json:"code"`
*Playlist `json:"playlist"`
}
type FMResp struct {
Code int `json:"code"`
Data []*Track2 `json:"data"`
}
type CloudResp struct {
Code int `json:"code"`
Data []*CloudTrack `json:"data"`
}
type DJResp struct {
Code int `json:"code"`
DJRadios []*DJ `json:"djRadios"`
}
type CloudTrack struct {
SimpleSong Track `json:"simpleSong"`
SongID int `json:"songId"`
}
type RecommendSongsResp struct {
Code int `json:"code"`
Data struct {
DailySongs []*Track `json:"dailySongs"`
} `json:"data"`
}
type MyPlaylistResp struct {
Code int `json:"code"`
Playlists []*Playlist `json:"playlist"`
}
// recommend sonds | fm | search --> results
// recommend sonds | fm | search
type Track2 struct {
ID int `json:"id"`
Name string `json:"name"`
Artists []Artist `json:"artists"`
Pop float64 `json:"popularity,omitempty"`
Album `json:"album"`
Duration int `json:"duration"`
}
type Playlist struct {
Name string `json:"name"`
ID int `json:"id"`
TrackCount int `json:"trackCount"`
Description string `json:"description"`
Tracks []*Track `json:"tracks"`
}
func (p *Playlist) String() string {
return p.Name
}
type Track struct {
ID int `json:"id"`
Name string `json:"name"`
Artists []Artist `json:"ar,omitempty"`
Pop float64 `json:"pop,omitempty"`
Album `json:"al,omitempty"`
Duration int `json:"dt"`
}
type Artist struct {
ID int `json:"id"`
Name string `json:"name"`
}
type Album struct {
ID int `json:"id"`
Name string `json:"name"`
}
type SearchResult struct {
Songs []*Track2
}
// crumb to be improved
type SongURL struct {
ID int `json:"id"`
URL string `json:"url"`
Expire int `json:"expi"`
}
type DJ struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"desc"`
}
type SidebarContents struct {
FM *Playlist
Recommend *Playlist
MyPlaylist []*Playlist
Cloud *Playlist
Top []*Playlist
// DJs []*DJ
}