This commit is contained in:
mmrbnjd
2024-06-25 17:14:08 +03:30
parent 4631d8f159
commit ce81911242
10 changed files with 76 additions and 23 deletions

View File

@@ -18,8 +18,9 @@ namespace Back.Controllers
private readonly MobileValidation _mobilevalidation;
private readonly ServValidatinMsg _servValidatinMsg;
private readonly servSendMsg _servSendMsg;
private readonly servNotification _servNotification;
public UserController(servUser servUser, MobileValidation mobilevalidation, servCompany servCompany
, ServValidatinMsg servValidatinMsg, servSendMsg servSendMsg)
, ServValidatinMsg servValidatinMsg, servSendMsg servSendMsg, servNotification servNotification)
{
_servUser = servUser;
@@ -27,6 +28,7 @@ namespace Back.Controllers
_servCompany = servCompany;
_servValidatinMsg = servValidatinMsg;
_servSendMsg = servSendMsg;
_servNotification = servNotification;
}
[HttpPost("authenticate")]
[AllowAnonymous]
@@ -92,6 +94,15 @@ namespace Back.Controllers
return Ok(await _servUser.GetDashBoard(Convert.ToInt32(UserID)));
}
[HttpPut("ReadNotification/{ntID}")]
public async Task<ActionResult<bool>> ReadNotification(int ntID)
{
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
var UserID = claim.Value;
return Ok(await _servNotification.ReadNotification(Convert.ToInt32(UserID), ntID));
}
}
}