add privacy-policy [skip-tests]
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"blackforestbytes.com/simplecloudnotifier/api/ginresp"
|
||||
"blackforestbytes.com/simplecloudnotifier/logic"
|
||||
"blackforestbytes.com/simplecloudnotifier/models"
|
||||
"blackforestbytes.com/simplecloudnotifier/website"
|
||||
"errors"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/ginext"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/rext"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/rs/zerolog/log"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type WebsiteHandler struct {
|
||||
@@ -77,6 +78,18 @@ func (h WebsiteHandler) MessageSent(pctx ginext.PreContext) ginext.HTTPResponse
|
||||
})
|
||||
}
|
||||
|
||||
func (h WebsiteHandler) PrivacyPolicy(pctx ginext.PreContext) ginext.HTTPResponse {
|
||||
ctx, g, errResp := pctx.Start()
|
||||
if errResp != nil {
|
||||
return *errResp
|
||||
}
|
||||
defer ctx.Cancel()
|
||||
|
||||
return h.app.DoRequest(ctx, g, models.TLockNone, func(ctx *logic.AppContext, finishSuccess func(r ginext.HTTPResponse) ginext.HTTPResponse) ginext.HTTPResponse {
|
||||
return h.serveAsset(g, "privacy_policy.html", true)
|
||||
})
|
||||
}
|
||||
|
||||
func (h WebsiteHandler) FaviconIco(pctx ginext.PreContext) ginext.HTTPResponse {
|
||||
ctx, g, errResp := pctx.Start()
|
||||
if errResp != nil {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"blackforestbytes.com/simplecloudnotifier/api/handler"
|
||||
"blackforestbytes.com/simplecloudnotifier/logic"
|
||||
"blackforestbytes.com/simplecloudnotifier/models"
|
||||
"blackforestbytes.com/simplecloudnotifier/swagger"
|
||||
"errors"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/ginext"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
"github.com/go-playground/validator/v10"
|
||||
@@ -98,6 +99,10 @@ func (r *Router) Init(e *ginext.GinWrapper) error {
|
||||
frontend.GET("/message_sent.php").Handle(r.websiteHandler.MessageSent)
|
||||
frontend.GET("/message_sent.html").Handle(r.websiteHandler.MessageSent)
|
||||
|
||||
frontend.GET("/privacy_policy").Handle(r.websiteHandler.PrivacyPolicy)
|
||||
frontend.GET("/privacy_policy.php").Handle(r.websiteHandler.PrivacyPolicy)
|
||||
frontend.GET("/privacy_policy.html").Handle(r.websiteHandler.PrivacyPolicy)
|
||||
|
||||
frontend.GET("/favicon.ico").Handle(r.websiteHandler.FaviconIco)
|
||||
frontend.GET("/favicon.png").Handle(r.websiteHandler.FaviconPNG)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user