-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeremy Mill
committed
Dec 3, 2015
1 parent
d6de9da
commit 2e5fc64
Showing
6 changed files
with
223 additions
and
1 deletion.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
TeamDBAwesome/TeamDBAwesome/Controllers/GetCustomPlaylistController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Web.Http; | ||
using TeamDBAwesome.Models; | ||
using TeamDBAwesome.SqlService; | ||
using Newtonsoft.Json; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class GetCustomPlaylistController : ApiController | ||
{ | ||
public HttpResponseMessage Get(int PlaylistID) | ||
{ | ||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
|
||
MySqlService sql = new MySqlService(); | ||
|
||
List<Track> trackList = sql.GetCustomPlayListTracks(PlaylistID); | ||
|
||
string serialzed = JsonConvert.SerializeObject(trackList); | ||
|
||
message.Content = new StringContent(serialzed); | ||
|
||
return message; | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
TeamDBAwesome/TeamDBAwesome/Controllers/GetCustomPlaylistsController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Web.Http; | ||
using TeamDBAwesome.Models; | ||
using TeamDBAwesome.SqlService; | ||
using Newtonsoft.Json; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class GetCustomPlaylistsController : ApiController | ||
{ | ||
public HttpResponseMessage Get(int CustomerID) | ||
{ | ||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
|
||
MySqlService sql = new MySqlService(); | ||
|
||
List<Playlist> playlistList = sql.GetCustomPlaylist(CustomerID); | ||
|
||
string serialzed = JsonConvert.SerializeObject(playlistList); | ||
|
||
message.Content = new StringContent(serialzed); | ||
|
||
return message; | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
TeamDBAwesome/TeamDBAwesome/Controllers/GetPlaylistListController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Web.Http; | ||
using TeamDBAwesome.Models; | ||
using TeamDBAwesome.SqlService; | ||
using Newtonsoft.Json; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class GetPlaylistListController : ApiController | ||
{ | ||
public HttpResponseMessage Get() | ||
{ | ||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
|
||
MySqlService sql = new MySqlService(); | ||
|
||
List<Playlist> playlistList = sql.GetPlaylists(); | ||
|
||
string serialzed = JsonConvert.SerializeObject(playlistList); | ||
|
||
message.Content = new StringContent(serialzed); | ||
|
||
return message; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
|
||
namespace TeamDBAwesome.Models | ||
{ | ||
public class Playlist | ||
{ | ||
public int PlaylistID { get; set; } | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters