hfilesvs


hfilesvsHAS内置的文件管理Service,其依赖于hdatabasePlugin

注册

hfilesvs slot

hfilesvsSlot如下

type DownloadRequest struct {
	core.SlotRequestBase

	Path    *string `json:"path" param:"require"`
	Preview *bool   `json:"preview" param:"require"`
}

func (this *Service) Download(req *DownloadRequest, res *core.SlotResponse) {
	...
}

type UploadFileItem struct {
	Name string `json:"name"`
	Data []byte `json:"data"`
}

type UploadRequest struct {
	core.SlotRequestBase

	Files *[]UploadFileItem `json:"files" param:"require"`
}

func (this *Service) Upload(req *UploadRequest, res *core.SlotResponse) {
	...
}

使用

上传

下载