Abbozzato controller x DbMaint in MON
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace MP_IO.Controllers.WebAPI
|
||||
{
|
||||
public class DbMaintController : ApiController
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
// DELETE api/<controller>/5
|
||||
public void Delete(int id)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GET api/DbMaint
|
||||
/// Esegue tutte le manutenzioni configurate x il DB
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[CacheFilter(TimeDuration = 5)]
|
||||
[HttpGet]
|
||||
public string Get()
|
||||
{
|
||||
return $"DbMaint executed - {DateTime.Now}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GET api/DbMaint/parameter
|
||||
/// Esegue una singola manutenzione configurata x il DB
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[CacheFilter(TimeDuration = 5)]
|
||||
[HttpGet]
|
||||
public string Get(string id)
|
||||
{
|
||||
return $"DbMaint requested: {id} - {DateTime.Now}";
|
||||
}
|
||||
|
||||
// POST api/<controller>
|
||||
public void Post([FromBody] string value)
|
||||
{
|
||||
}
|
||||
|
||||
// PUT api/<controller>/5
|
||||
public void Put(int id, [FromBody] string value)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -304,7 +304,6 @@
|
||||
<Compile Include="Controllers\BENCH.cs" />
|
||||
<Compile Include="Controllers\IOBController.cs" />
|
||||
<Compile Include="Controllers\WebAPI\CacheFilter.cs" />
|
||||
<Compile Include="Controllers\WebAPI\DbMaintController.cs" />
|
||||
<Compile Include="Controllers\WebAPI\IOBController.cs" />
|
||||
<Compile Include="default.aspx.cs">
|
||||
<DependentUpon>default.aspx</DependentUpon>
|
||||
|
||||
@@ -9,6 +9,13 @@ namespace MP_MON.Controllers
|
||||
{
|
||||
public class DbTaskController : ApiController
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
// DELETE: api/DbTask/5
|
||||
public void Delete(int id)
|
||||
{
|
||||
}
|
||||
|
||||
// GET: api/DbTask
|
||||
public IEnumerable<string> Get()
|
||||
{
|
||||
@@ -18,22 +25,19 @@ namespace MP_MON.Controllers
|
||||
// GET: api/DbTask/5
|
||||
public string Get(int id)
|
||||
{
|
||||
return "value";
|
||||
return $"DbMaint requested: {id} - {DateTime.Now}";
|
||||
}
|
||||
|
||||
// POST: api/DbTask
|
||||
public void Post([FromBody]string value)
|
||||
public void Post([FromBody] string value)
|
||||
{
|
||||
}
|
||||
|
||||
// PUT: api/DbTask/5
|
||||
public void Put(int id, [FromBody]string value)
|
||||
public void Put(int id, [FromBody] string value)
|
||||
{
|
||||
}
|
||||
|
||||
// DELETE: api/DbTask/5
|
||||
public void Delete(int id)
|
||||
{
|
||||
}
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
-13
@@ -1,21 +1,27 @@
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Optimization;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace MP_MON
|
||||
{
|
||||
public class MvcApplication : System.Web.HttpApplication
|
||||
{
|
||||
protected void Application_Start()
|
||||
public class MvcApplication : System.Web.HttpApplication
|
||||
{
|
||||
// Codice eseguito all'avvio dell'applicazione
|
||||
AreaRegistration.RegisterAllAreas();
|
||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
||||
#region Protected Methods
|
||||
|
||||
// avvio il metodo init x applicazione...
|
||||
MP_Startup.Init();
|
||||
protected void Application_Start()
|
||||
{
|
||||
// Codice eseguito all'avvio dell'applicazione
|
||||
AreaRegistration.RegisterAllAreas();
|
||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
||||
|
||||
// avvio il metodo init x applicazione...
|
||||
MP_Startup.Init();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user