示例#1
0
        public IActionResult SetRead([FromBody] NotificationIForm notification)
        {
            TimeZoneInfo zone     = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time");
            DateTime     dateTime = TimeZoneInfo.ConvertTime(DateTime.Now, zone);

            //if set notification is read success
            if (_notiRepo.SetRead(notification.Id_noti))
            {
                Log.Information("Set Read noti from mobile {id_noti} OK. {DateTime}.", notification.Id_noti, dateTime);
                return(Ok(notification.Id_noti));
            }
            //if set notification is read fail
            else
            {
                Log.Information("Error_SetRead {noti}. {DateTime}.", notification.Id_noti, dateTime);
                return(NotFound("Error_SetRead"));
            }
        }
示例#2
0
        public IActionResult DeleteNotification([FromBody] NotificationIForm notification)
        {
            TimeZoneInfo zone     = TimeZoneInfo.FindSystemTimeZoneById("SE Asia Standard Time");
            DateTime     dateTime = TimeZoneInfo.ConvertTime(DateTime.Now, zone);

            //if setting notification is not show on user's mobile success
            if (_notiRepo.DeleteNotification(notification.Id_noti))
            {
                Log.Information("Delete noti from mobile {id_notification} OK. {DateTime}.", notification.Id_noti, dateTime);
                return(Ok(notification.Id_noti));
            }
            //if setting notification is not show on user's mobile fail
            else
            {
                Log.Information("Error_Delete. {DateTime}.", dateTime);
                return(NotFound("Error Delete notification"));
            }
        }