// Package transcribe 提供 transcribe 模块的路由注册
package transcribe

import (
	"github.com/echochat/backend/app/constants"
	"github.com/echochat/backend/app/transcribe/controller"
	"github.com/echochat/backend/pkg/middleware"
	"github.com/gin-gonic/gin"
)

// RegisterRoutes 注册 admin 端的转写路由
//
// 全部走 JWT + admin 角色双重中间件，与 admin 模块同等权限。
//
// 路由：
//   - POST /api/v1/admin/recordings/:id/transcribe   提交转写任务
//   - GET  /api/v1/admin/recordings/:id/transcript   查询转写结果
func RegisterRoutes(r *gin.Engine, ctrl *controller.TranscribeController, jwtAuth gin.HandlerFunc) {
	g := r.Group("/api/v1/admin")
	g.Use(jwtAuth, middleware.RequireRole(constants.RoleAdmin, constants.RoleSuperAdmin))
	{
		g.POST("/recordings/:id/transcribe", ctrl.SubmitTranscribe)
		g.GET("/recordings/:id/transcript", ctrl.GetTranscript)
	}
}
