Fix FileImage

This commit is contained in:
MangKyu
2022-02-01 02:07:58 +09:00
parent 17a89aa943
commit d19d3f5d49
3 changed files with 7 additions and 2 deletions

View File

@@ -5,6 +5,6 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
public final class FileConstants { public final class FileConstants {
public static final String FILE_API_PREFIX = "/file"; public static final String FILE_API_PREFIX = "/api/file";
} }

View File

@@ -23,6 +23,11 @@ public class FileController {
} }
@GetMapping(FILE_API_PREFIX + "/{resourceId}") @GetMapping(FILE_API_PREFIX + "/{resourceId}")
public ResponseEntity<Resource> getFileApi(@PathVariable String resourceId) {
return ResponseEntity.ok(fileService.getFileAsResource(resourceId));
}
@GetMapping("/file/{resourceId}")
public ResponseEntity<Resource> getFile(@PathVariable String resourceId) { public ResponseEntity<Resource> getFile(@PathVariable String resourceId) {
return ResponseEntity.ok(fileService.getFileAsResource(resourceId)); return ResponseEntity.ok(fileService.getFileAsResource(resourceId));
} }

View File

@@ -4,7 +4,7 @@ $(document).ready(function () {
let editor let editor
ClassicEditor.create(document.querySelector('#editor'), { ClassicEditor.create(document.querySelector('#editor'), {
ckfinder: { ckfinder: {
uploadUrl: '/file' uploadUrl: '/api/file'
}}).then(newEditor => { }}).then(newEditor => {
editor = newEditor; editor = newEditor;
}).catch(error => { }).catch(error => {