package handler

import (
	"net/http"

	inspireHandler "apps/backend/internal/handler/inspire"
	"apps/backend/internal/svc"

	"github.com/zeromicro/go-zero/rest"
)

// RegisterInspireStream 註冊靈感 SSE 路由（手寫，避開 goctl JSON envelope）。
func RegisterInspireStream(server *rest.Server, serverCtx *svc.ServiceContext) {
	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodPost,
					Path:    "/chat-stream",
					Handler: inspireHandler.ChatStreamHandler(serverCtx),
				},
			}...,
		),
		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
		rest.WithPrefix("/api/v1/inspire"),
	)
}
