升级工程:webapi统一继承ControllerBase,增加ApiController标签

This commit is contained in:
Argo-Surface 2018-11-24 15:12:44 +08:00
parent 7591381711
commit b326d0e83e
16 changed files with 39 additions and 23 deletions

View File

@ -9,7 +9,8 @@ namespace Bootstrap.Admin.Controllers.Api
/// 数据字典分类
/// </summary>
[Route("api/[controller]")]
public class CategoryController : Controller
[ApiController]
public class CategoryController : ControllerBase
{
/// <summary>
/// 获取字典表中所有Category数据

View File

@ -12,7 +12,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class DictsController : Controller
[ApiController]
public class DictsController : ControllerBase
{
/// <summary>
///
@ -20,7 +21,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<BootstrapDict> Get(QueryDictOption value)
public QueryData<BootstrapDict> Get([FromQuery]QueryDictOption value)
{
return value.RetrieveData();
}

View File

@ -13,7 +13,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class ExceptionsController : Controller
[ApiController]
public class ExceptionsController : ControllerBase
{
/// <summary>
/// 显示所有异常
@ -21,7 +22,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<Object> Get(QueryExceptionOption value)
public QueryData<object> Get([FromQuery]QueryExceptionOption value)
{
return value.RetrieveData();
}

View File

@ -11,7 +11,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class GroupsController : Controller
[ApiController]
public class GroupsController : ControllerBase
{
/// <summary>
///
@ -19,7 +20,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<object> Get(QueryGroupOption value)
public QueryData<object> Get([FromQuery]QueryGroupOption value)
{
return value.RetrieveData();
}

View File

@ -11,7 +11,8 @@ namespace Bootstrap.Admin.Controllers
/// </summary>
[Route("api/[controller]/[action]")]
[AllowAnonymous]
public class InterfaceController : Controller
[ApiController]
public class InterfaceController : ControllerBase
{
/// <summary>
///

View File

@ -13,7 +13,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class LoginController : Controller
[ApiController]
public class LoginController : ControllerBase
{
/// <summary>
///

View File

@ -10,7 +10,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class LogsController : Controller
[ApiController]
public class LogsController : ControllerBase
{
/// <summary>
///
@ -18,7 +19,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<Log> Get(QueryLogOption value)
public QueryData<Log> Get([FromQuery]QueryLogOption value)
{
return value.RetrieveData();
}

View File

@ -11,7 +11,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class MenusController : Controller
[ApiController]
public class MenusController : ControllerBase
{
/// <summary>
/// 获得所有菜单列表调用
@ -19,7 +20,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<object> Get(QueryMenuOption value)
public QueryData<object> Get([FromQuery]QueryMenuOption value)
{
return value.RetrieveData(User.Identity.Name);
}

View File

@ -11,7 +11,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class MessagesController : Controller
[ApiController]
public class MessagesController : ControllerBase
{
/// <summary>
/// 根据Id返回不同的消息列表

View File

@ -9,7 +9,8 @@ namespace Bootstrap.Admin.Controllers
///
/// </summary>
[Route("api/[controller]")]
public class NewController : Controller
[ApiController]
public class NewController : ControllerBase
{
/// <summary>
/// 通知管理页面获得所有新用户方法调用

View File

@ -9,7 +9,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class NotificationsController : Controller
[ApiController]
public class NotificationsController : ControllerBase
{
/// <summary>
///

View File

@ -12,7 +12,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class ProfilesController : Controller
[ApiController]
public class ProfilesController : ControllerBase
{
/// <summary>
///

View File

@ -12,7 +12,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class RolesController : Controller
[ApiController]
public class RolesController : ControllerBase
{
/// <summary>
///
@ -20,7 +21,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<object> Get(QueryRoleOption value)
public QueryData<object> Get([FromQuery]QueryRoleOption value)
{
return value.RetrieveData();
}

View File

@ -10,7 +10,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class SettingsController : Controller
[ApiController]
public class SettingsController : ControllerBase
{
/// <summary>
///

View File

@ -8,7 +8,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class TasksController : Controller
[ApiController]
public class TasksController : ControllerBase
{
/// <summary>
///

View File

@ -13,7 +13,8 @@ namespace Bootstrap.Admin.Controllers.Api
///
/// </summary>
[Route("api/[controller]")]
public class UsersController : Controller
[ApiController]
public class UsersController : ControllerBase
{
/// <summary>
///
@ -21,7 +22,7 @@ namespace Bootstrap.Admin.Controllers.Api
/// <param name="value"></param>
/// <returns></returns>
[HttpGet]
public QueryData<object> Get(QueryUserOption value)
public QueryData<object> Get([FromQuery]QueryUserOption value)
{
return value.RetrieveData();
}