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
get demo and a few others
- Loading branch information
Jeremy Mill
committed
Dec 10, 2015
1 parent
1d5d09b
commit 52ca1eb
Showing
5 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
TeamDBAwesome/TeamDBAwesome/Controllers/GetAllTracksController.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,33 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Net; | |||
using System.Net.Http; | |||
using System.Web.Http; | |||
using TeamDBAwesome.SqlService; | |||
using TeamDBAwesome.Models; | |||
using Newtonsoft.Json; | |||
|
|||
namespace TeamDBAwesome.Controllers | |||
{ | |||
public class GetAllTracksController : ApiController | |||
{ | |||
public HttpResponseMessage Get() | |||
{ | |||
MySqlService dbService = new MySqlService(); | |||
|
|||
List<Track> trackList = dbService.getAllTracks(); | |||
foreach (Track track in trackList) | |||
{ | |||
track.url = "http://a1310.phobos.apple.com/us/r1000/167/Music3/v4/00/23/38/0023383d-1616-fbe2-b3a3-7f2de268911b/mzaf_7209253486009554987.plus.aac.p.m4a"; | |||
} | |||
string serialzed = JsonConvert.SerializeObject(trackList); | |||
|
|||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | |||
message.Content = new StringContent(serialzed); | |||
|
|||
return message; | |||
|
|||
} | |||
} | |||
} |
29 changes: 29 additions & 0 deletions
29
TeamDBAwesome/TeamDBAwesome/Controllers/GetDemographicController.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,29 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Net; | |||
using System.Net.Http; | |||
using System.Web.Http; | |||
using TeamDBAwesome.SqlService; | |||
using TeamDBAwesome.Models; | |||
using Newtonsoft.Json; | |||
|
|||
namespace TeamDBAwesome.Controllers | |||
{ | |||
public class GetDemographicController : ApiController | |||
{ | |||
public HttpResponseMessage Get() | |||
{ | |||
MySqlService dbService = new MySqlService(); | |||
|
|||
List<DemoGraph> demoList = dbService.getDemos(); | |||
string serialzed = JsonConvert.SerializeObject(demoList); | |||
|
|||
HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.OK); | |||
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 | Original file line | 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 DemoGraph | |||
{ | |||
public string country { get; set; } | |||
public int count { 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