✨ feat(notification): 添加通知方式

This commit is contained in:
naiba committed 2020-12-19 22:14:36 +08:00
1 parent b118958f35
commit d19de0edc2
16 files changed
+391 -58

No files matched your search

+3 -2
View File
@@ -2,6 +2,7 @@ package model
import (
"fmt"
"html/template"
"time"
pb "github.com/naiba/nezha/proto"
@@ -21,6 +22,6 @@ type Server struct {
StreamClose chan<- error `gorm:"-" json:"-"`
}
func (s Server) Marshal() string {
return fmt.Sprintf(`{"ID":%d,"Name":"%s","Secret":"%s"}`, s.ID, s.Name, s.Secret)
func (s Server) Marshal() template.JS {
return template.JS(fmt.Sprintf(`{"ID":%d,"Name":"%s","Secret":"%s"}`, s.ID, s.Name, s.Secret))
}