package api

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

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

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