| 
									
										
										
										
											2024-02-02 04:17:13 +08:00
										 |  |  | package api | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"github.com/grafana/grafana/pkg/api/response" | 
					
						
							|  |  |  | 	contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | type NotificationsApiHandler struct { | 
					
						
							| 
									
										
										
										
											2024-02-06 02:12:15 +08:00
										 |  |  | 	notificationSrv *NotificationSrv | 
					
						
							| 
									
										
										
										
											2024-02-02 04:17:13 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-06 02:12:15 +08:00
										 |  |  | func NewNotificationsApi(notificationSrv *NotificationSrv) *NotificationsApiHandler { | 
					
						
							| 
									
										
										
										
											2024-02-02 04:17:13 +08:00
										 |  |  | 	return &NotificationsApiHandler{ | 
					
						
							| 
									
										
										
										
											2024-02-06 02:12:15 +08:00
										 |  |  | 		notificationSrv: notificationSrv, | 
					
						
							| 
									
										
										
										
											2024-02-02 04:17:13 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (f *NotificationsApiHandler) handleRouteNotificationsGetTimeInterval(ctx *contextmodel.ReqContext, name string) response.Response { | 
					
						
							| 
									
										
										
										
											2024-02-06 02:12:15 +08:00
										 |  |  | 	return f.notificationSrv.RouteGetTimeInterval(ctx, name) | 
					
						
							| 
									
										
										
										
											2024-02-02 04:17:13 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (f *NotificationsApiHandler) handleRouteNotificationsGetTimeIntervals(ctx *contextmodel.ReqContext) response.Response { | 
					
						
							| 
									
										
										
										
											2024-02-06 02:12:15 +08:00
										 |  |  | 	return f.notificationSrv.RouteGetTimeIntervals(ctx) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (f *NotificationsApiHandler) handleRouteGetReceiver(ctx *contextmodel.ReqContext, name string) response.Response { | 
					
						
							|  |  |  | 	return f.notificationSrv.RouteGetReceiver(ctx, name) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (f *NotificationsApiHandler) handleRouteGetReceivers(ctx *contextmodel.ReqContext) response.Response { | 
					
						
							|  |  |  | 	return f.notificationSrv.RouteGetReceivers(ctx) | 
					
						
							| 
									
										
										
										
											2024-02-02 04:17:13 +08:00
										 |  |  | } |