upload_api

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// FilesSaveDir 文件保存目录
	FilesSaveDir string
	// FilesSavePathPrefix 文件保存路径前缀
	FilesSavePathPrefix string
	// UploadPath 上传请求路径
	UploadPath string
}

type FileInfo

type FileInfo struct {
	Name        string `json:"name,omitempty"`
	Size        int64  `json:"size,omitempty"`
	Type        string `json:"type,omitempty"`
	Path        string `json:"path,omitempty"`
	QualityPath string `json:"qualityPath,omitempty"`
}

type UploadResponse

type UploadResponse struct {
	Files []*FileInfo `json:"files"`
}

type UploadService

type UploadService struct {
	*Config
}

func NewUploadService

func NewUploadService(cfg *Config) *UploadService

func (*UploadService) GetFileSavePath

func (this_ *UploadService) GetFileSavePath(filePath string) string

func (*UploadService) GetWebApi

func (this_ *UploadService) GetWebApi() (webApi *web.WebApi)

func (*UploadService) Save

func (this_ *UploadService) Save(uploadFile *web.UploadFile, quality int) (res *FileInfo, err error)

func (*UploadService) Upload

func (this_ *UploadService) Upload(request *web.WebRequest) (res any, err error)

Jump to

Keyboard shortcuts

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