package routes

import (
	"github.com/gofiber/fiber/v2"

	"github.com/break/junhong_cmp_fiber/internal/handler/admin"
	"github.com/break/junhong_cmp_fiber/internal/model/dto"
	"github.com/break/junhong_cmp_fiber/pkg/openapi"
)

func registerSuperAdminRoutes(router fiber.Router, handler *admin.SuperAdminHandler, doc *openapi.Generator, basePath string) {
	group := router.Group("/super-admin")
	groupPath := basePath + "/super-admin"

	Register(group, doc, groupPath, "POST", "/operation-password", handler.SetOperationPassword, RouteSpec{
		Summary: "设置/修改全局操作密码",
		Tags:    []string{"超级管理员"},
		Input:   new(dto.SetOperationPasswordRequest),
		Auth:    true,
	})

	Register(group, doc, groupPath, "GET", "/operation-password/status", handler.GetOperationPasswordStatus, RouteSpec{
		Summary: "查询操作密码是否已设置",
		Tags:    []string{"超级管理员"},
		Output:  new(dto.OperationPasswordStatusResponse),
		Auth:    true,
	})
}
