เพิ่มnoti by keycloak
This commit is contained in:
parent
ef415217c8
commit
356c6eb9c0
2 changed files with 56 additions and 0 deletions
|
|
@ -72,6 +72,47 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
return Success();
|
||||
}
|
||||
|
||||
[HttpPost("keycloak")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdatePropertyByUserKeycloak([FromBody] NotiRequest req)
|
||||
{
|
||||
var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.KeycloakId == req.ReceiverUserId);
|
||||
if (profile == null)
|
||||
return Error(GlobalMessages.DataNotFound);
|
||||
|
||||
await _repositoryNoti.PushNotificationAsync(
|
||||
profile.Id,
|
||||
req.Subject,
|
||||
req.Body,
|
||||
req.Payload,
|
||||
req.IsSendInbox,
|
||||
req.IsSendMail
|
||||
);
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
||||
[HttpPut("{id:length(36)}")]
|
||||
public async Task<ActionResult<ResponseObject>> ReplyPropertyByUser([FromBody] NotiReplyRequest req, Guid id)
|
||||
{
|
||||
var inbox = await _context.Inboxes.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (inbox == null)
|
||||
return Error(GlobalMessages.DataNotFound);
|
||||
var profile = await _context.Profiles.FirstOrDefaultAsync(x => x.KeycloakId == Guid.Parse(inbox.CreatedUserId));
|
||||
if (profile == null)
|
||||
return Error(GlobalMessages.DataNotFound);
|
||||
|
||||
await _repositoryNoti.PushNotificationAsync(
|
||||
profile.Id,
|
||||
req.Subject,
|
||||
req.Body,
|
||||
req.Payload,
|
||||
req.IsSendInbox,
|
||||
req.IsSendMail
|
||||
);
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
||||
[HttpPost("cronjob")]
|
||||
public async Task<ActionResult<ResponseObject>> CornjobProbation([FromBody] NotiCronjobProbationRequest req)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue