diff options
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers')
| -rw-r--r-- | Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs index 52036e46b..e3391cd5d 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs @@ -4,15 +4,37 @@ using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; +using Tango.MachineService.Gateway.DB; +using Tango.MachineService.Gateway.DTO; +using Tango.MachineService.Gateway.Messages; +using Tango.Web.Controllers; namespace Tango.MachineService.Gateway.Controllers { - public class GatewayController : ApiController + public class GatewayController : TangoController { [HttpPost] - public String GetUrl() + public EnvironmentsResponse GetEnvironments(EnvironmentsRequest request) { - return "URL"; + EnvironmentsResponse response = new EnvironmentsResponse(); + + using (GatewayDbContext db = GatewayDbContext.CreateDefault()) + { + var envs = db.Environments.ToList(); + + foreach (var env in envs) + { + response.Environments.Add(new EnvironmentConfiguration() + { + ID = env.ID.ToString(), + Name = env.Name, + Description = env.Description, + MachineServiceAddress = env.MachineServiceAddress + }); + } + } + + return response; } } } |
