package router

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

func RegisterMedia(group *gin.RouterGroup, h *Media) {
	files := group.Group("/fileUploadAndDownload")
	files.POST("/upload", h.Upload)
	files.POST("/getFileList", h.List)
	files.POST("/deleteFile", h.Delete)
	files.POST("/deleteFiles", h.DeleteMany)
	files.GET("/findFile", h.Find)
	files.POST("/editFileName", h.Rename)
	files.POST("/importURL", h.ImportURLs)
	files.POST("/listOssFiles", h.Storage)
	categories := group.Group("/attachmentCategory")
	categories.GET("/getCategoryList", h.Categories)
	categories.POST("/addCategory", h.SaveCategory)
	categories.POST("/deleteCategory", h.DeleteCategory)
	upload := group.Group("/mediaUpload")
	upload.POST("/init", h.InitUpload)
	upload.POST("/chunk", h.SaveChunk)
	upload.POST("/complete", h.CompleteUpload)
	upload.DELETE("/:uploadId", h.CancelUpload)
}
