|
|
|
@ -12,8 +12,8 @@ using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace SwaggerStudy.Controllers
|
|
|
|
|
{
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
public class StudentController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
private readonly ILogger<StudentController> _logger;
|
|
|
|
@ -40,6 +40,7 @@ namespace SwaggerStudy.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[ActionName("GetAllAsync")]
|
|
|
|
|
public async Task<IActionResult> GetAllAsync()
|
|
|
|
|
{
|
|
|
|
|
var apiResult = new ResultBase()
|
|
|
|
@ -53,7 +54,7 @@ namespace SwaggerStudy.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public IActionResult Get(int studentId)
|
|
|
|
|
public IActionResult Get(int studentId)
|
|
|
|
|
{
|
|
|
|
|
var apiResult = new ResultBase()
|
|
|
|
|
{
|
|
|
|
@ -66,6 +67,7 @@ namespace SwaggerStudy.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[ActionName("GetAsync")]
|
|
|
|
|
public async Task<IActionResult> GetAsync(int studentId)
|
|
|
|
|
{
|
|
|
|
|
var apiResult = new ResultBase()
|
|
|
|
@ -92,6 +94,7 @@ namespace SwaggerStudy.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[ActionName("GetByNameAsync")]
|
|
|
|
|
public async Task<IActionResult> GetByNameAsync(string studentName)
|
|
|
|
|
{
|
|
|
|
|
var apiResult = new ResultBase()
|
|
|
|
@ -104,7 +107,6 @@ namespace SwaggerStudy.Controllers
|
|
|
|
|
return await Task.FromResult(Ok(apiResult));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public IActionResult Add(StudentVModel vm)
|
|
|
|
|
{
|
|
|
|
@ -139,6 +141,7 @@ namespace SwaggerStudy.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[ActionName("AddAsync")]
|
|
|
|
|
public async Task<IActionResult> AddAsync(StudentVModel vm)
|
|
|
|
|
{
|
|
|
|
|
var apiResult = new ResultBase()
|
|
|
|
@ -205,6 +208,7 @@ namespace SwaggerStudy.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[ActionName("UpdateAsync")]
|
|
|
|
|
public async Task<IActionResult> UpdateAsync(StudentVModel vm)
|
|
|
|
|
{
|
|
|
|
|
var apiResult = new ResultBase()
|
|
|
|
@ -264,6 +268,7 @@ namespace SwaggerStudy.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[ActionName("DeleteAsync")]
|
|
|
|
|
public async Task<IActionResult> DeleteAsync(int studentId)
|
|
|
|
|
{
|
|
|
|
|
var apiResult = new ResultBase()
|
|
|
|
|