feat(notification): 添加通知方式

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

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))
}