You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1Panel/backend/app/service/file.go

28 lines
535 B

package service
import (
"github.com/1Panel-dev/1Panel/app/dto"
"github.com/1Panel-dev/1Panel/utils/files"
)
type FileService struct {
}
type IFileService interface {
GetFileList(op dto.FileOption) (dto.FileInfo, error)
}
func NewFileService() IFileService {
return FileService{}
}
func (f FileService) GetFileList(op dto.FileOption) (dto.FileInfo, error) {
var fileInfo dto.FileInfo
info, err := files.NewFileInfo(op.FileOption)
if err != nil {
return fileInfo, err
}
fileInfo.FileInfo = *info
return fileInfo, nil
}