-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifiy_message.go
32 lines (25 loc) · 947 Bytes
/
notifiy_message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package api
import (
"net/http"
"github.com/mstgnz/cronjob/pkg/response"
"github.com/mstgnz/cronjob/services"
)
type NotifyMessageHandler struct {
*services.NotifyMessageService
}
func (h *NotifyMessageHandler) ListHandler(w http.ResponseWriter, r *http.Request) error {
statusCode, result := h.ListService(w, r)
return response.WriteJSON(w, statusCode, result)
}
func (h *NotifyMessageHandler) CreateHandler(w http.ResponseWriter, r *http.Request) error {
statusCode, result := h.CreateService(w, r)
return response.WriteJSON(w, statusCode, result)
}
func (h *NotifyMessageHandler) UpdateHandler(w http.ResponseWriter, r *http.Request) error {
statusCode, result := h.UpdateService(w, r)
return response.WriteJSON(w, statusCode, result)
}
func (h *NotifyMessageHandler) DeleteHandler(w http.ResponseWriter, r *http.Request) error {
statusCode, result := h.DeleteService(w, r)
return response.WriteJSON(w, statusCode, result)
}