ADD prefix to all API controllers

This commit is contained in:
2025-05-19 14:52:39 +02:00
parent d24a6fccab
commit c0cb38d48e
9 changed files with 15 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ meta {
} }
get { get {
url: {{base_url}}/download/input/{{video_uuid}} url: {{base_url}}/api/v1/download/input/{{video_uuid}}
body: none body: none
auth: inherit auth: inherit
} }

View File

@@ -5,7 +5,7 @@ meta {
} }
get { get {
url: {{base_url}}/download/output/{{video_uuid}} url: {{base_url}}/api/v1/download/output/{{video_uuid}}
body: none body: none
auth: inherit auth: inherit
} }

View File

@@ -5,7 +5,7 @@ meta {
} }
post { post {
url: {{base_url}}/edit/{{video_uuid}} url: {{base_url}}/api/v1/edit/{{video_uuid}}
body: formUrlEncoded body: formUrlEncoded
auth: inherit auth: inherit
} }

View File

@@ -5,7 +5,7 @@ meta {
} }
get { get {
url: {{base_url}}/process/{{video_uuid}} url: {{base_url}}/api/v1/process/{{video_uuid}}
body: none body: none
auth: inherit auth: inherit
} }

View File

@@ -5,7 +5,7 @@ meta {
} }
get { get {
url: {{base_url}}/progress/{{video_uuid}} url: {{base_url}}/api/v1/progress/{{video_uuid}}
body: none body: none
auth: inherit auth: inherit
} }

View File

@@ -5,7 +5,7 @@ meta {
} }
post { post {
url: {{base_url}}/upload url: {{base_url}}/api/v1/upload
body: multipartForm body: multipartForm
auth: inherit auth: inherit
} }

View File

@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.MediaTypeFactory;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -12,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/download") @RequestMapping("api/v1/download")
public class DownloadController { public class DownloadController {
private final DownloadService downloadService; private final DownloadService downloadService;
@@ -30,8 +31,8 @@ public class DownloadController {
} }
return ResponseEntity.ok() return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"") .header(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + resource.getFilename() + "\"")
.contentType(MediaType.APPLICATION_OCTET_STREAM) .contentType(MediaTypeFactory.getMediaType(resource).orElse(MediaType.APPLICATION_OCTET_STREAM))
.body(resource); .body(resource);
} }
@@ -44,8 +45,8 @@ public class DownloadController {
} }
return ResponseEntity.ok() return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"") .header(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + resource.getFilename() + "\"")
.contentType(MediaType.APPLICATION_OCTET_STREAM) .contentType(MediaTypeFactory.getMediaType(resource).orElse(MediaType.APPLICATION_OCTET_STREAM))
.body(resource); .body(resource);
} }
} }

View File

@@ -8,6 +8,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@RestController @RestController
@RequestMapping("api/v1/")
public class EditController { public class EditController {
private final EditService editService; private final EditService editService;

View File

@@ -5,11 +5,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@RestController @RestController
@RequestMapping("api/v1/")
public class UploadController { public class UploadController {
private final UploadService uploadService; private final UploadService uploadService;