Files

26 lines
679 B
Go
Raw Permalink Normal View History

2025-12-20 18:32:48 +01:00
package pdfrender
import (
"github.com/gin-gonic/gin"
)
2025-12-21 09:15:08 +01:00
// RegisterRoutes registers protected PDF routes
2025-12-20 18:32:48 +01:00
func RegisterRoutes(r *gin.RouterGroup) {
pdfGrp := r.Group("/pdf")
2025-12-21 09:15:08 +01:00
// List available templates (protected)
2025-12-20 18:32:48 +01:00
pdfGrp.GET("/templates", ListTemplates)
2025-12-21 09:15:08 +01:00
// Export character to PDF (protected)
2025-12-20 18:32:48 +01:00
pdfGrp.GET("/export/:id", ExportCharacterToPDF)
2025-12-21 09:15:08 +01:00
// Cleanup old PDF files (protected)
pdfGrp.POST("/cleanup", CleanupExportTemp)
}
// RegisterPublicRoutes registers public PDF routes (no authentication required)
func RegisterPublicRoutes(r *gin.Engine) {
2025-12-30 08:11:33 +01:00
// Get PDF file from export_temp (public - for direct browser access)
2025-12-21 09:15:08 +01:00
r.GET("/api/pdf/file/:filename", GetPDFFile)
2025-12-20 18:32:48 +01:00
}