package ru.ldeloff.hedgehogcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ru.ldeloff.hedgehogcloud.service.FileService;

import java.io.File;
import java.util.List;

@RestController
@RequestMapping("/apps/files")
public class FilesRestController {

    FileService fileService;

    public FilesRestController(FileService fileService) {
        this.fileService = fileService;
    }

    @GetMapping
    public List<File> listFiles(String path) {
        return fileService.list(path);
    }

}
