mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-29 05:49:07 +08:00
28 lines
535 B
Go
28 lines
535 B
Go
|
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
|
||
|
}
|