package system

import (
	"kra/internal/server/middleware"

	"github.com/gin-gonic/gin"
)

type SysVersionRouter struct{}

// InitSysVersionRouter 初始化版本管理路由
func (s *SysVersionRouter) InitSysVersionRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	sysVersionRouter := Router.Group("sysVersion").Use(middleware.OperationRecordMiddleware())
	sysVersionRouterWithoutRecord := Router.Group("sysVersion")
	sysVersionRouterWithoutAuth := PublicRouter.Group("sysVersion")
	{
		sysVersionRouter.DELETE("deleteSysVersion", versionApi.DeleteSysVersion)           // 删除版本
		sysVersionRouter.DELETE("deleteSysVersionByIds", versionApi.DeleteSysVersionByIds) // 批量删除版本
		sysVersionRouter.POST("exportVersion", versionApi.ExportVersion)                   // 导出版本数据
		sysVersionRouter.POST("importVersion", versionApi.ImportVersion)                   // 导入版本数据
	}
	{
		sysVersionRouterWithoutRecord.GET("findSysVersion", versionApi.FindSysVersion)           // 根据ID获取版本
		sysVersionRouterWithoutRecord.GET("getSysVersionList", versionApi.GetSysVersionList)     // 获取版本列表
		sysVersionRouterWithoutRecord.GET("downloadVersionJson", versionApi.DownloadVersionJson) // 下载版本JSON
	}
	{
		sysVersionRouterWithoutAuth.GET("getSysVersionPublic", versionApi.GetSysVersionPublic) // 公开接口
	}
}
