package file_export

import (
	"be.ems/src/framework/middleware"
	"github.com/gin-gonic/gin"
)

// Register Routes for file_export
func Register(r *gin.RouterGroup) {

	ueTable := r.Group("/table")
	{
		var m *SysJob
		ueTable.GET("/list",
			middleware.PreAuthorize(nil),
			m.GetFileExportTable,
		)
	}
	ueFile := r.Group("/file")
	{
		var f *FileExport
		ueFile.GET("/list",
			middleware.PreAuthorize(nil),
			f.GetFileList,
		)
		ueFile.GET("/total",
			middleware.PreAuthorize(nil),
			f.Total,
		)
		ueFile.GET("/:fileName",
			middleware.PreAuthorize(nil),
			f.DownloadHandler,
		)
		ueFile.DELETE("/:fileName",
			middleware.PreAuthorize(nil),
			f.Delete,
		)
	}
}
