diff --git a/src/main/java/org/sopt/seonyakServer/global/common/dto/OcrTextResponse.java b/src/main/java/org/sopt/seonyakServer/global/common/dto/OcrTextResponse.java deleted file mode 100644 index 278e01c..0000000 --- a/src/main/java/org/sopt/seonyakServer/global/common/dto/OcrTextResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.sopt.seonyakServer.global.common.dto; - -public record OcrTextResponse( - String univ -) { - public static OcrTextResponse of(String univ) { - return new OcrTextResponse(univ); - } -} diff --git a/src/main/java/org/sopt/seonyakServer/global/common/dto/OcrUnivResponse.java b/src/main/java/org/sopt/seonyakServer/global/common/dto/OcrUnivResponse.java new file mode 100644 index 0000000..5ebfe5f --- /dev/null +++ b/src/main/java/org/sopt/seonyakServer/global/common/dto/OcrUnivResponse.java @@ -0,0 +1,9 @@ +package org.sopt.seonyakServer.global.common.dto; + +public record OcrUnivResponse( + String univName +) { + public static OcrUnivResponse of(String univName) { + return new OcrUnivResponse(univName); + } +} diff --git a/src/main/java/org/sopt/seonyakServer/global/common/external/naver/OcrController.java b/src/main/java/org/sopt/seonyakServer/global/common/external/naver/OcrController.java index c841161..8ef773e 100644 --- a/src/main/java/org/sopt/seonyakServer/global/common/external/naver/OcrController.java +++ b/src/main/java/org/sopt/seonyakServer/global/common/external/naver/OcrController.java @@ -2,7 +2,7 @@ import java.io.IOException; import lombok.RequiredArgsConstructor; -import org.sopt.seonyakServer.global.common.dto.OcrTextResponse; +import org.sopt.seonyakServer.global.common.dto.OcrUnivResponse; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -18,7 +18,7 @@ public class OcrController { private final OcrService ocrService; @PostMapping("/univ") - public ResponseEntity ocrText(@RequestParam("imageFile") MultipartFile file) throws IOException { + public ResponseEntity ocrText(@RequestParam("imageFile") MultipartFile file) throws IOException { return ResponseEntity.ok(ocrService.ocrText(file)); } } diff --git a/src/main/java/org/sopt/seonyakServer/global/common/external/naver/OcrService.java b/src/main/java/org/sopt/seonyakServer/global/common/external/naver/OcrService.java index 0463b75..38f03fc 100644 --- a/src/main/java/org/sopt/seonyakServer/global/common/external/naver/OcrService.java +++ b/src/main/java/org/sopt/seonyakServer/global/common/external/naver/OcrService.java @@ -16,7 +16,7 @@ import lombok.RequiredArgsConstructor; import org.json.JSONArray; import org.json.JSONObject; -import org.sopt.seonyakServer.global.common.dto.OcrTextResponse; +import org.sopt.seonyakServer.global.common.dto.OcrUnivResponse; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; @@ -25,7 +25,7 @@ public class OcrService { private final OcrConfig ocrConfig; - public OcrTextResponse ocrText(MultipartFile file) throws IOException { + public OcrUnivResponse ocrText(MultipartFile file) throws IOException { // OCR 설정파일로부터 URL, Secret Key 가져옴 String apiUrl = ocrConfig.getApiUrl(); String apiKey = ocrConfig.getApiKey(); @@ -76,7 +76,7 @@ public OcrTextResponse ocrText(MultipartFile file) throws IOException { } br.close(); - return OcrTextResponse.of(extractUnivText(response.toString())); + return OcrUnivResponse.of(extractUnivText(response.toString())); }