attachment

package
v0.0.0-...-df13ac1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 10 Imported by: 0

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]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL