feat: add feature to speak with the AI and create report from contexts

This commit is contained in:
2026-04-19 18:27:42 +02:00
parent eb1fb5ca78
commit 7ef93276e1
19 changed files with 656 additions and 33 deletions

View File

@ -7,7 +7,11 @@ import (
)
func SetupRouter(h *handlers.Handler, jwtSecret string) *gin.Engine {
r := gin.Default()
r := gin.New()
r.Use(gin.Recovery())
r.Use(gin.LoggerWithConfig(gin.LoggerConfig{
SkipPaths: []string{"/api/summaries/status"},
}))
r.Use(func(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", "*")
@ -39,8 +43,13 @@ func SetupRouter(h *handlers.Handler, jwtSecret string) *gin.Engine {
authed.GET("/articles/:id", h.GetArticle)
authed.GET("/summaries", h.ListSummaries)
authed.GET("/summaries/status", h.GetGeneratingStatus)
authed.POST("/summaries/generate", h.GenerateSummary)
authed.GET("/reports", h.ListReports)
authed.POST("/reports", h.CreateReport)
authed.DELETE("/reports/:id", h.DeleteReport)
// Admin
admin := authed.Group("/admin")
admin.Use(auth.AdminOnly())