Browse Source

Rename endpoint

atsachlaris 18 hours ago
parent
commit
d67295e4d8
2 changed files with 9 additions and 9 deletions
  1. 5 5
      requests/service.http
  2. 4 4
      src/main/java/es/uv/saic/web/EnhancementController.java

+ 5 - 5
requests/service.http

@@ -1,5 +1,5 @@
 ### Default table
-POST http://127.0.0.1:8080/enhancements/chat/file
+POST http://127.0.0.1:8080/enhancements/single-step/file
 Content-Type: multipart/form-data; boundary=WebAppBoundary
 
 --WebAppBoundary
@@ -10,7 +10,7 @@ Content-Type: text/html
 --WebAppBoundary--
 
 ###
-POST http://127.0.0.1:8080/enhancements/chat/file
+POST http://127.0.0.1:8080/enhancements/single-step/file
 Content-Type: multipart/form-data; boundary=WebAppBoundary
 
 --WebAppBoundary
@@ -22,7 +22,7 @@ Content-Type: text/html
 
 ###
 
-POST http://127.0.0.1:8080/enhancements/chat/file
+POST http://127.0.0.1:8080/enhancements/single-step/file
 Content-Type: multipart/form-data; boundary=WebAppBoundary
 
 --WebAppBoundary
@@ -33,7 +33,7 @@ Content-Type: text/html
 --WebAppBoundary--
 
 ### Form with warnings and critical
-POST http://127.0.0.1:8080/enhancements/chat/file
+POST http://127.0.0.1:8080/enhancements/single-step/file
 Content-Type: multipart/form-data; boundary=WebAppBoundary
 
 --WebAppBoundary
@@ -44,7 +44,7 @@ Content-Type: text/html
 --WebAppBoundary--
 
 ### HTML body
-POST http://127.0.0.1:8080/enhancements/chat
+POST http://127.0.0.1:8080/enhancements/single-step
 Content-Type: application/json
 
 {

+ 4 - 4
src/main/java/es/uv/saic/web/EnhancementController.java

@@ -21,13 +21,13 @@ public class EnhancementController {
 
     private final EnhancementService enhancementService;
 
-    @PostMapping("chat")
-    public String chat(@RequestBody String html) {
+    @PostMapping("single-step")
+    public String singleStepAnalysis(@RequestBody String html) {
         return enhancementService.calculateScoreAndProduceCommentsWithSingleCall(ExtractionRequest.fromHtml(html));
     }
 
-    @PostMapping(value = "chat/file", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public String chatFile(@RequestPart("file") MultipartFile file) {
+    @PostMapping(value = "single-step/file", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public String singleStepAnalysisFile(@RequestPart("file") MultipartFile file) {
         if (file.isEmpty()) {
             throw new ResponseStatusException(BAD_REQUEST, "Uploaded file is empty");
         }