27 lines
999 B
Java
27 lines
999 B
Java
package de.w665.sharepulse.rest;
|
|
|
|
import de.w665.sharepulse.db.repo.FileUploadRepository;
|
|
import de.w665.sharepulse.model.FileUpload;
|
|
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.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@RestController
|
|
public class TestRestResource extends ApiRestController {
|
|
|
|
private final FileUploadRepository fileUploadRepository;
|
|
|
|
@Autowired
|
|
public TestRestResource(FileUploadRepository fileUploadRepository) {
|
|
this.fileUploadRepository = fileUploadRepository;
|
|
}
|
|
|
|
@GetMapping("test")
|
|
public String test(@RequestParam String id) {
|
|
FileUpload fileUpload = fileUploadRepository.retrieveFileUploadByFileId(id);
|
|
return fileUpload != null ? fileUpload.toString() : "FileUpload not found for id: " + id;
|
|
}
|
|
}
|