package api

import (
	"github.com/gin-gonic/gin"

	"oci-portal/internal/service"
)

// registerConsole 网页控制台:ws 数据面挂 v1 组(浏览器 WebSocket 无法带自定义头,
// token 经 query 在 handler 内校验),会话创建/删除走 JWT 组。
func registerConsole(v1, secured *gin.RouterGroup, console *service.ConsoleService, auth *service.AuthService) {
	ch := &consoleHandler{svc: console, auth: auth}
	v1.GET("/console-sessions/:sessionId/ws", ch.ws)
	secured.POST("/oci-configs/:id/instances/:instanceId/console-sessions", ch.create)
	secured.DELETE("/console-sessions/:sessionId", ch.remove)
}
