added extra method documentation to a dummy controller method to test out the dalsoft package.
removed "RouteController" - redundant now with dalsoft nuget package.
This commit is contained in:
parent
904ec01118
commit
eca081f63d
@ -1,15 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.ServiceProcess;
|
using System.ServiceProcess;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
using DalSoft.WebApi.HelpPage;
|
using DalSoft.WebApi.HelpPage;
|
||||||
using Microsoft.Owin.FileSystems;
|
using Microsoft.Owin.FileSystems;
|
||||||
@ -77,12 +71,14 @@ namespace WindowsDataCenter
|
|||||||
public void Configuration(IAppBuilder appBuilder)
|
public void Configuration(IAppBuilder appBuilder)
|
||||||
{
|
{
|
||||||
var config = new HttpConfiguration();
|
var config = new HttpConfiguration();
|
||||||
|
config.MapHttpAttributeRoutes();
|
||||||
config.Routes.MapHttpRoute(
|
config.Routes.MapHttpRoute(
|
||||||
name: "DefaultApi",
|
name: "DefaultApi",
|
||||||
routeTemplate: "api/{controller}/{id}",
|
routeTemplate: "api/{controller}/{id}",
|
||||||
defaults: new { id = RouteParameter.Optional }
|
defaults: new { id = RouteParameter.Optional }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
appBuilder.UseWebApi(config);
|
appBuilder.UseWebApi(config);
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
@ -117,6 +113,32 @@ namespace WindowsDataCenter
|
|||||||
var respMsg = new HttpResponseMessage(HttpStatusCode.OK);
|
var respMsg = new HttpResponseMessage(HttpStatusCode.OK);
|
||||||
return ResponseMessage(respMsg);
|
return ResponseMessage(respMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get unassigned card Ids in the system.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Json object containing list of unassigned card objects</returns>
|
||||||
|
/// <example>
|
||||||
|
/// > Get: http://{baseaddress}:port/api/swipedata/unassigned
|
||||||
|
/// > Returns:
|
||||||
|
/// {
|
||||||
|
/// "data": [
|
||||||
|
/// {
|
||||||
|
/// "id": 0,
|
||||||
|
/// "Id": 0,
|
||||||
|
/// "UserId": -1,
|
||||||
|
/// "IsSelected": false,
|
||||||
|
/// "CardUId": "39c6ec38-3879-4ee6-99ae-0a55777f6b86"
|
||||||
|
/// }
|
||||||
|
/// ]
|
||||||
|
/// }
|
||||||
|
/// </example>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("api/swipedata/unassigned")]
|
||||||
|
public IHttpActionResult GetUnassignedCards()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ValuesController : ApiController
|
public class ValuesController : ApiController
|
||||||
@ -127,28 +149,6 @@ namespace WindowsDataCenter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RouteController : ApiController
|
|
||||||
{
|
|
||||||
public IHttpActionResult Get()
|
|
||||||
{
|
|
||||||
List<RouteObject> routeList = new List<RouteObject>();
|
|
||||||
var routes = GlobalConfiguration.Configuration.Routes;
|
|
||||||
foreach (var route in routes)
|
|
||||||
{
|
|
||||||
var obj = new RouteObject();
|
|
||||||
obj.RouteUrl = route.RouteTemplate;
|
|
||||||
routeList.Add(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Json(routeList);
|
|
||||||
}
|
|
||||||
|
|
||||||
class RouteObject
|
|
||||||
{
|
|
||||||
public string RouteUrl { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class UsersController : ApiController
|
public class UsersController : ApiController
|
||||||
{
|
{
|
||||||
public IHttpActionResult GetUsers()
|
public IHttpActionResult GetUsers()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user