User NFCCode is rögzítésre kerüljön

This commit is contained in:
2025-04-15 19:42:39 +02:00
parent c51ee750f9
commit 4dbda1aac3
3 changed files with 36 additions and 1 deletions
@@ -552,5 +552,35 @@ namespace WorkFlowCheck.API.Controllers
if (retVal.Data == null || retVal.Data.Count <= 0) { retVal.IsSuccess = false; retVal.Errors.Add("No data!"); }
return retVal;
}
[HttpPost("UpdateAllMobileUser")]
public async Task<ApiResponseDTO<List<MobileUserDTO>>> UpdateAllMobileUser([FromBody] List<MobileUserDTO> mobileUserListDTO)
{
var retVal = new ApiResponseDTO<List<MobileUserDTO>>()
{
IsSuccess = true
};
try
{
foreach (var mobileUserDTO in mobileUserListDTO)
{
var userDTO = await _userService.GetUserAsync(mobileUserDTO.Id);
if (userDTO != null && userDTO.Id == mobileUserDTO.Id)
{
userDTO.NFCCode = mobileUserDTO.NFCCode;
var result = await _userService.UpdateUserAsync(userDTO);
}
}
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
}
}