-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmusics.apib
166 lines (135 loc) · 4.28 KB
/
musics.apib
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
157
158
159
160
161
162
163
164
165
166
## Music List [/api/music/]
A list of musics
### Create Music [POST]
create music
+ Request with body (application/json)
+ Body
{
"song": "test_song" ,
"singer": "test_singer"
}
+ Response 201 (application/json)
+ Body
{
"id": 100057,
"song": "test_song",
"singer": "test_singer",
"last_modify_date": "06/07/2017 02:45",
"created": "06/07/2017"
}
## Get Musics Use Server-Side [/api/music/{?draw,length,start}]
get musics use server-side
+ Parameters
+ draw: `1` (string, required) - draw
+ length: `10` (string, required) - length
+ start: `0` (string, required) - start
### Get Musics Use Server-Side [GET]
get musics use server-side
::: note
## Note
datatables server-side parameters reference
[https://datatables.net/manual/server-side](https://datatables.net/manual/server-side)
:::
+ Response 200
+ Body
{
"draw": 1,
"recordsFiltered": 100049,
"data": [{
"id": 7,
"song": "1s",
"singer": "11",
"last_modify_date": "06/07/2017 08:02",
"created": "05/09/2017"
}, {
"id": 9,
"song": "s",
"singer": "1s",
"last_modify_date": "06/07/2017 07:57",
"created": "05/09/2017"
}, {
"id": 10,
"song": "s",
"singer": "1",
"last_modify_date": "05/09/2017 01:58",
"created": "05/09/2017"
}, {
"id": 11,
"song": "s",
"singer": "11",
"last_modify_date": "05/12/2017 04:07",
"created": "05/09/2017"
}, {
"id": 12,
"song": "s",
"singer": "1",
"last_modify_date": "05/09/2017 02:00",
"created": "05/09/2017"
}, {
"id": 13,
"song": "s",
"singer": "1",
"last_modify_date": "05/09/2017 02:00",
"created": "05/09/2017"
}, {
"id": 14,
"song": "s",
"singer": "1",
"last_modify_date": "05/09/2017 02:00",
"created": "05/09/2017"
}, {
"id": 15,
"song": "s",
"singer": "1",
"last_modify_date": "05/09/2017 02:00",
"created": "05/09/2017"
}, {
"id": 16,
"song": "s",
"singer": "1",
"last_modify_date": "05/09/2017 02:00",
"created": "05/09/2017"
}, {
"id": 17,
"song": "s",
"singer": "1",
"last_modify_date": "05/09/2017 02:00",
"created": "05/09/2017"
}],
"recordsTotal": 100049
}
## Music [/api/music/{id}/]
get music
+ Parameters
+ id : `50` (integer, required) - music id
### Get Music [GET]
get music
+ Response 200 (application/json)
+ Body
{
"id": 50,
"song": "test_song",
"singer": "test_singer",
"last_modify_date": "06/08/2017 02:25",
"created": "06/08/2017"
}
### Update Music [PUT]
update music
+ Request (application/json)
+ Body
{
"song": "test_song_update",
"singer": "test_singer_update"
}
+ Response 200 (application/json)
+ Body
{
"id": 50,
"song": "test_song_update",
"singer": "test_singer_update",
"last_modify_date": "06/07/2017 02:46",
"created": "06/07/2017"
}
### Delete Music [DELETE]
delete music
+ Response 204