forked from OmniX-Space/MeowMusicServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstruct.go
More file actions
executable file
·59 lines (52 loc) · 1.74 KB
/
struct.go
File metadata and controls
executable file
·59 lines (52 loc) · 1.74 KB
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
package main
import "time"
// MusicItem represents a music item.
type MusicItem struct {
Title string `json:"title"`
Artist string `json:"artist"`
AudioURL string `json:"audio_url"`
AudioFullURL string `json:"audio_full_url"`
M3U8URL string `json:"m3u8_url"`
LyricURL string `json:"lyric_url"`
CoverURL string `json:"cover_url"`
Duration int `json:"duration"`
FromCache bool `json:"from_cache"`
IP string `json:"ip"`
}
// User represents a user account
type User struct {
ID string `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Password string `json:"-"` // Never expose password in JSON
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// UserPlaylist represents a user's custom playlist
type UserPlaylist struct {
ID string `json:"id"`
UserID string `json:"user_id"`
Name string `json:"name"`
Description string `json:"description"`
CoverURL string `json:"cover_url"`
Songs []MusicItem `json:"songs"`
IsPublic bool `json:"is_public"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// LoginRequest represents login credentials
type LoginRequest struct {
Username string `json:"username"`
Password string `json:"password"`
}
// RegisterRequest represents registration data
type RegisterRequest struct {
Username string `json:"username"`
Email string `json:"email"`
Password string `json:"password"`
}
// AuthResponse represents authentication response
type AuthResponse struct {
Token string `json:"token"`
User User `json:"user"`
}