ปรับปรุง api รับค่าการสแกนนิ้ว เพิ่มเติม

This commit is contained in:
Nakorn Rientrakrunchai
2020-07-27 08:40:44 +07:00
parent b457cb0a13
commit 7e7de0b9f4
4 changed files with 59 additions and 57 deletions

View File

@@ -137,43 +137,43 @@ namespace TodoAPI2.Controllers
}
}
/// <summary>
/// InsertFingerScanToHR
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="model"></param>
/// <returns>Response Result Message</returns>
/// <response code="200">Response Result Message</response>
/// <response code="400">If the model is invalid</response>
/// <response code="500">Error Occurred</response>
[HttpPost("InsertFingerScanToHR")]
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult InsertFingerScanToHR([FromBody] List<string> model)
{
if (ModelState.IsValid)
{
try
{
string rowCount = _repository.InsertFingerScanToHR(model);
var message = new CommonResponseMessage();
message.code = "200";
message.message = "เพิ่มข้อมูลเรียบร้อย จำนวน " + rowCount + " รายการ";
message.data = null;
return Ok(message);
}
catch (Exception ex)
{
_logger.LogCritical($"InsertFingerScanToHR.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
///// <summary>
///// InsertFingerScanToHR
///// </summary>
///// <remarks>
///// </remarks>
///// <param name="model"></param>
///// <returns>Response Result Message</returns>
///// <response code="200">Response Result Message</response>
///// <response code="400">If the model is invalid</response>
///// <response code="500">Error Occurred</response>
//[HttpPost("InsertFingerScanToHR")]
//[ProducesResponseType(typeof(CommonResponseMessage), 200)]
//[ProducesResponseType(400)]
//[ProducesResponseType(500)]
////[ValidateAntiForgeryToken]
//public IActionResult InsertFingerScanToHR([FromBody] List<string> model)
//{
// if (ModelState.IsValid)
// {
// try
// {
// string rowCount = _repository.InsertFingerScanToHR(model);
// var message = new CommonResponseMessage();
// message.code = "200";
// message.message = "เพิ่มข้อมูลเรียบร้อย จำนวน " + rowCount + " รายการ";
// message.data = null;
// return Ok(message);
// }
// catch (Exception ex)
// {
// _logger.LogCritical($"InsertFingerScanToHR.", ex);
// return StatusCode(500, $"{ex.Message}");
// }
// }
return BadRequest(ModelState);
}
// return BadRequest(ModelState);
//}
/// <summary>
/// RecieveFingerScanFromLocal