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 8, 2015
1 parent
85976a1
commit 032f9ac
Showing
6 changed files
with
201 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
TeamDBAwesome/TeamDBAwesome/Controllers/AddAlbumController.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
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 AddAlbumController : ApiController | |||
{ | |||
public HttpResponseMessage Post([FromBody] Album album) | |||
{ | |||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | |||
MySqlService sql = new MySqlService(); | |||
int newAlbum = sql.addAlbum(album); | |||
message.Content = new StringContent(newAlbum.ToString()); | |||
return message; | |||
} | |||
} | |||
} |
23 changes: 23 additions & 0 deletions
23
TeamDBAwesome/TeamDBAwesome/Controllers/AddArtistController.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
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 AddArtistController : ApiController | |||
{ | |||
public HttpResponseMessage Post([FromBody] Artist artist) | |||
{ | |||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | |||
MySqlService sql = new MySqlService(); | |||
int newArtist = sql.AddArtist(artist); | |||
message.Content = new StringContent(newArtist.ToString()); | |||
return message; | |||
} | |||
} | |||
} |
27 changes: 27 additions & 0 deletions
27
TeamDBAwesome/TeamDBAwesome/Controllers/AddTrackController.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
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 AddTrackController : ApiController | |||
{ | |||
public HttpResponseMessage Post([FromBody]Track track) | |||
{ | |||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | |||
|
|||
MySqlService sql = new MySqlService(); | |||
int response = sql.AddTrack(track); | |||
|
|||
message.Content = new StringContent(response.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
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