feat: save messages to database (close #37)

This commit is contained in:
JustSong
2022-12-22 17:59:12 +08:00
parent f13ce0d53b
commit d26e578762
19 changed files with 682 additions and 34 deletions

17
common/template.go Normal file
View File

@@ -0,0 +1,17 @@
package common
import (
"embed"
"html/template"
)
//go:embed public
var FS embed.FS
func LoadTemplate() *template.Template {
var funcMap = template.FuncMap{
"unescape": UnescapeHTML,
}
t := template.Must(template.New("").Funcs(funcMap).ParseFS(FS, "public/*.html"))
return t
}