|
| 1 | +// Package docs Code generated by swaggo/swag. DO NOT EDIT |
| 2 | +package docs |
| 3 | + |
| 4 | +import "github.com/swaggo/swag" |
| 5 | + |
| 6 | +const docTemplate = `{ |
| 7 | + "schemes": {{ marshal .Schemes }}, |
| 8 | + "swagger": "2.0", |
| 9 | + "info": { |
| 10 | + "description": "{{escape .Description}}", |
| 11 | + "title": "{{.Title}}", |
| 12 | + "contact": {}, |
| 13 | + "version": "{{.Version}}" |
| 14 | + }, |
| 15 | + "host": "{{.Host}}", |
| 16 | + "basePath": "{{.BasePath}}", |
| 17 | + "paths": { |
| 18 | + "/api/v1/download:sourceId": { |
| 19 | + "get": { |
| 20 | + "description": "Enables playback for song/file using http 206 partial content", |
| 21 | + "produces": [ |
| 22 | + "application/json" |
| 23 | + ], |
| 24 | + "parameters": [ |
| 25 | + { |
| 26 | + "description": "message/rfc8259 see models.DownloadRequestModel", |
| 27 | + "name": "download", |
| 28 | + "in": "body", |
| 29 | + "required": true, |
| 30 | + "schema": { |
| 31 | + "type": "string" |
| 32 | + } |
| 33 | + } |
| 34 | + ], |
| 35 | + "responses": { |
| 36 | + "0": { |
| 37 | + "description": "", |
| 38 | + "schema": { |
| 39 | + "$ref": "#/definitions/models.DownloadRequestModel" |
| 40 | + } |
| 41 | + }, |
| 42 | + "200": { |
| 43 | + "description": "serve song/file with range request (http 206)" |
| 44 | + }, |
| 45 | + "500": { |
| 46 | + "description": "Internal Server Error", |
| 47 | + "schema": { |
| 48 | + "$ref": "#/definitions/models.ApiResponseModel" |
| 49 | + } |
| 50 | + } |
| 51 | + } |
| 52 | + } |
| 53 | + }, |
| 54 | + "/api/v1/play/:sourceId": { |
| 55 | + "get": { |
| 56 | + "description": "Enables playback for song/file using http 206 partial content", |
| 57 | + "produces": [ |
| 58 | + "application/json" |
| 59 | + ], |
| 60 | + "parameters": [ |
| 61 | + { |
| 62 | + "type": "string", |
| 63 | + "description": "Id of song/file to serve using http 206 partial content", |
| 64 | + "name": "sourceId", |
| 65 | + "in": "path", |
| 66 | + "required": true |
| 67 | + } |
| 68 | + ], |
| 69 | + "responses": { |
| 70 | + "200": { |
| 71 | + "description": "serve song/file with range request (http 206)" |
| 72 | + }, |
| 73 | + "500": { |
| 74 | + "description": "Internal Server Error", |
| 75 | + "schema": { |
| 76 | + "$ref": "#/definitions/models.ApiResponseModel" |
| 77 | + } |
| 78 | + } |
| 79 | + } |
| 80 | + } |
| 81 | + }, |
| 82 | + "/api/v1/playlist": { |
| 83 | + "get": { |
| 84 | + "description": "Returns data for all playlist, if lastKnowPlaylistId then only the playlist after lastKnowPlaylistId", |
| 85 | + "produces": [ |
| 86 | + "application/json" |
| 87 | + ], |
| 88 | + "parameters": [ |
| 89 | + { |
| 90 | + "type": "integer", |
| 91 | + "description": "Last know playlist id by the client, default is 0", |
| 92 | + "name": "lastKnowPlaylistId", |
| 93 | + "in": "path" |
| 94 | + } |
| 95 | + ], |
| 96 | + "responses": { |
| 97 | + "200": { |
| 98 | + "description": "OK", |
| 99 | + "schema": { |
| 100 | + "$ref": "#/definitions/models.Playlist" |
| 101 | + } |
| 102 | + }, |
| 103 | + "500": { |
| 104 | + "description": "Internal Server Error", |
| 105 | + "schema": { |
| 106 | + "$ref": "#/definitions/models.ApiResponseModel" |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | + } |
| 111 | + }, |
| 112 | + "/api/v1/playlist/:playlistId": { |
| 113 | + "get": { |
| 114 | + "description": "Returns data for a playlist, if lastKnowSongPosition then only songs added after lastKnowSongPosition", |
| 115 | + "produces": [ |
| 116 | + "application/json" |
| 117 | + ], |
| 118 | + "parameters": [ |
| 119 | + { |
| 120 | + "type": "integer", |
| 121 | + "description": "Id of playlist", |
| 122 | + "name": "playlistId", |
| 123 | + "in": "path", |
| 124 | + "required": true |
| 125 | + }, |
| 126 | + { |
| 127 | + "type": "integer", |
| 128 | + "description": "Last song that is know by the client, pass this in to only get the latest songs", |
| 129 | + "name": "lastKnowSongPosition", |
| 130 | + "in": "path" |
| 131 | + } |
| 132 | + ], |
| 133 | + "responses": { |
| 134 | + "200": { |
| 135 | + "description": "OK", |
| 136 | + "schema": { |
| 137 | + "$ref": "#/definitions/models.Song" |
| 138 | + } |
| 139 | + }, |
| 140 | + "500": { |
| 141 | + "description": "Internal Server Error", |
| 142 | + "schema": { |
| 143 | + "$ref": "#/definitions/models.ApiResponseModel" |
| 144 | + } |
| 145 | + } |
| 146 | + } |
| 147 | + } |
| 148 | + }, |
| 149 | + "/api/v1/songs": { |
| 150 | + "get": { |
| 151 | + "description": "Returns data for all songs", |
| 152 | + "produces": [ |
| 153 | + "application/json" |
| 154 | + ], |
| 155 | + "responses": { |
| 156 | + "200": { |
| 157 | + "description": "OK", |
| 158 | + "schema": { |
| 159 | + "$ref": "#/definitions/models.Song" |
| 160 | + } |
| 161 | + }, |
| 162 | + "500": { |
| 163 | + "description": "Internal Server Error", |
| 164 | + "schema": { |
| 165 | + "$ref": "#/definitions/models.ApiResponseModel" |
| 166 | + } |
| 167 | + } |
| 168 | + } |
| 169 | + } |
| 170 | + } |
| 171 | + }, |
| 172 | + "definitions": { |
| 173 | + "models.ApiResponseModel": { |
| 174 | + "type": "object", |
| 175 | + "properties": { |
| 176 | + "data": {}, |
| 177 | + "message": { |
| 178 | + "type": "string" |
| 179 | + } |
| 180 | + } |
| 181 | + }, |
| 182 | + "models.DownloadRequestModel": { |
| 183 | + "type": "object", |
| 184 | + "properties": { |
| 185 | + "url": { |
| 186 | + "type": "string" |
| 187 | + } |
| 188 | + } |
| 189 | + }, |
| 190 | + "models.Playlist": { |
| 191 | + "type": "object", |
| 192 | + "properties": { |
| 193 | + "creationDate": { |
| 194 | + "type": "string" |
| 195 | + }, |
| 196 | + "description": { |
| 197 | + "type": "string" |
| 198 | + }, |
| 199 | + "id": { |
| 200 | + "type": "integer" |
| 201 | + }, |
| 202 | + "isPublic": { |
| 203 | + "type": "boolean" |
| 204 | + }, |
| 205 | + "name": { |
| 206 | + "type": "string" |
| 207 | + }, |
| 208 | + "thumbnailPath": { |
| 209 | + "type": "string" |
| 210 | + }, |
| 211 | + "updatedAt": { |
| 212 | + "type": "string" |
| 213 | + } |
| 214 | + } |
| 215 | + }, |
| 216 | + "models.Song": { |
| 217 | + "type": "object", |
| 218 | + "properties": { |
| 219 | + "created_at": { |
| 220 | + "type": "string" |
| 221 | + }, |
| 222 | + "duration": { |
| 223 | + "type": "integer" |
| 224 | + }, |
| 225 | + "id": { |
| 226 | + "type": "integer" |
| 227 | + }, |
| 228 | + "name": { |
| 229 | + "type": "string" |
| 230 | + }, |
| 231 | + "path": { |
| 232 | + "type": "string" |
| 233 | + }, |
| 234 | + "source_id": { |
| 235 | + "type": "string" |
| 236 | + }, |
| 237 | + "thumbnail_path": { |
| 238 | + "type": "string" |
| 239 | + }, |
| 240 | + "updated_at": { |
| 241 | + "type": "string" |
| 242 | + } |
| 243 | + } |
| 244 | + } |
| 245 | + } |
| 246 | +}` |
| 247 | + |
| 248 | +// SwaggerInfo holds exported Swagger Info so clients can modify it |
| 249 | +var SwaggerInfo = &swag.Spec{ |
| 250 | + Version: "1.0", |
| 251 | + Host: "", |
| 252 | + BasePath: "/api/v1", |
| 253 | + Schemes: []string{}, |
| 254 | + Title: "MusicBoxApi API", |
| 255 | + Description: "", |
| 256 | + InfoInstanceName: "swagger", |
| 257 | + SwaggerTemplate: docTemplate, |
| 258 | + LeftDelim: "{{", |
| 259 | + RightDelim: "}}", |
| 260 | +} |
| 261 | + |
| 262 | +func init() { |
| 263 | + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) |
| 264 | +} |
0 commit comments