Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
more API's
- Loading branch information
Jeremy Mill
committed
Dec 6, 2015
1 parent
739e072
commit 94b4892
Showing
8 changed files
with
135 additions
and
4 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
TeamDBAwesome/TeamDBAwesome/Controllers/AddCustomPlaylistController.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,26 @@ | ||
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; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class AddCustomPlaylistController : ApiController | ||
{ | ||
public HttpResponseMessage Post([FromBody] CustomPlaylistId custom) | ||
{ | ||
MySqlService dbService = new MySqlService(); | ||
|
||
int newID = dbService.NewCustomPlaylist(custom); | ||
|
||
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); | ||
response.Content = new StringContent(newID.ToString()); | ||
return response; | ||
|
||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
TeamDBAwesome/TeamDBAwesome/Controllers/DropCustomPlaylistController.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,28 @@ | ||
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; | ||
|
||
namespace TeamDBAwesome.Controllers | ||
{ | ||
public class DropCustomPlaylistController : ApiController | ||
{ | ||
// GET: api/GetCustomer | ||
public HttpResponseMessage Get(int PlaylistID) | ||
{ | ||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | ||
|
||
MySqlService sql = new MySqlService(); | ||
|
||
int succ = sql.DropCustomPlaylist(PlaylistID); | ||
|
||
message.Content = new StringContent(succ.ToString()); | ||
|
||
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
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 CustomPlaylistId | ||
{ | ||
public int CustomerId { 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
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