コード例 #1
0
ファイル: Notification.cs プロジェクト: RedRevenge94/szh
 public static bool AddNotification(NotificationAddModel notification)
 {
     if (AddNotification(Tunnel.GetTunnel(notification.tunnel), notification.condition, notification.measurement_type, notification.value,
                         notification.repeat_after, notification.receivers, notification.isActive))
     {
         return(true);
     }
     return(false);
 }
コード例 #2
0
 public IActionResult CreateNotification([FromBody] NotificationAddModel notification)
 {
     if (notification.condition == null || notification.measurement_type == null || notification.receivers == "" ||
         notification.repeat_after == 0 || notification.tunnel == null || notification.value == 0)
     {
         return(BadRequest());
     }
     else
     {
         if (Notification.AddNotification(notification))
         {
             return(Ok());
         }
     }
     return(BadRequest());
 }