Skip to content

Commit

Permalink
[RENAME/#8] OCR 응답 Dto 및 필드명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
seokbeom00 committed Jul 3, 2024
1 parent 76f045f commit 6a24f85
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -18,7 +18,7 @@ public class OcrController {
private final OcrService ocrService;

@PostMapping("/univ")
public ResponseEntity<OcrTextResponse> ocrText(@RequestParam("imageFile") MultipartFile file) throws IOException {
public ResponseEntity<OcrUnivResponse> ocrText(@RequestParam("imageFile") MultipartFile file) throws IOException {
return ResponseEntity.ok(ocrService.ocrText(file));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
Expand Down Expand Up @@ -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()));
}


Expand Down

0 comments on commit 6a24f85

Please sign in to comment.