package handler import ( "fmt" "os" "server/modules/backend/app" "server/modules/backend/values" "github.com/gin-gonic/gin" "github.com/liangdas/mqant/log" ) func Hot(c *gin.Context) { a := app.NewApp(c) // defer func() { // a.Response() // }() file := c.Request.RequestURI[9:] // index := strings.LastIndex(c.Request.RequestURI, "/") // fileName := c.Request.RequestURI[index+1:] filePath := "hot/" + file log.Debug("path:%v", filePath) if _, err := os.Stat(filePath); err != nil { log.Error("err:%v", err) a.Code = values.CodeRetry a.Response() return } // c.Header("Content-Disposition", "attachment; filename="+file) // c.Header("Content-Type", "application/octet-stream") // c.Header("Content-Disposition", "inline;filename="+file) c.Header("Connection", "keep-alive") // c.Header("Content-Transfer-Encoding", "binary") // c.Header("Cache-Control", "no-cache") c.File(filePath) } func Privacy(c *gin.Context) { id := c.Param("id") filePath := fmt.Sprintf("privacy/PrivacyPolicy%v.html", id) c.File(filePath) } func TermsofService(c *gin.Context) { id := c.Param("id") filePath := fmt.Sprintf("privacy/TERMSOFSERVICE%v.html", id) c.File(filePath) }