aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-02-17 17:00:29 +0200
committerAvi Levkovich <avi@twine-s.com>2020-02-17 17:00:29 +0200
commitcbc80e71fac7d2896ac496b0fbf22051c0cdcff7 (patch)
tree9f898e565748f5581e900491ca36ce21c6462846 /Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs
parentef657b4a3ae76e99ab077d6b4fc19691c2a0da4a (diff)
downloadTango-cbc80e71fac7d2896ac496b0fbf22051c0cdcff7.tar.gz
Tango-cbc80e71fac7d2896ac496b0fbf22051c0cdcff7.zip
merge
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs')
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService.Gateway/Controllers/GatewayController.cs28
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;
}
}
}