Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Attachment = &AttachmentController{}
Functions ¶
This section is empty.
Types ¶
type AttachmentController ¶
type AttachmentController struct {
controller.Controller
}
func (*AttachmentController) ReadFile ¶
func (c *AttachmentController) ReadFile(ctx *fiber.Ctx) error
ReadFile 根据文件路径获取并返回文件内容
@Summary 获取文件内容 @Description 根据文件路径获取并返回文件内容,支持图片等文件类型的直接显示和gzip压缩 @Tags 附件管理 @Accept json @Produce octet-stream @Param file_path path string true "文件路径,支持相对路径和绝对路径" @Success 200 {file} []byte "文件内容(支持gzip压缩)" @Router /file/{file_path} [get]
func (*AttachmentController) Upload ¶
func (c *AttachmentController) Upload(ctx *fiber.Ctx) error
Upload 上传资源
@Summary 上传资源
@Description 上传资源文件接口
@Tags 附件管理
@Accept multipart/form-data
@Produce json
@Security ApiKeyAuth
@Param file formData file true "上传的文件"
@Success 200 {object} response.JSONResponse "成功"
@Router /backend/attachment/upload [post]
Click to show internal directories.
Click to hide internal directories.