diff --git a/backend/src/main/java/reviewme/highlight/domain/Highlight.java b/backend/src/main/java/reviewme/highlight/domain/Highlight.java index ba2a85ce5..de6714efa 100644 --- a/backend/src/main/java/reviewme/highlight/domain/Highlight.java +++ b/backend/src/main/java/reviewme/highlight/domain/Highlight.java @@ -29,7 +29,7 @@ public class Highlight { @Embedded private HighlightPosition highlightPosition; - public Highlight(long answerId, long lineIndex, long startIndex, long endIndex) { + public Highlight(long answerId, int lineIndex, int startIndex, int endIndex) { this.answerId = answerId; this.highlightPosition = new HighlightPosition(lineIndex, startIndex, endIndex); } diff --git a/backend/src/main/java/reviewme/highlight/domain/HighlightPosition.java b/backend/src/main/java/reviewme/highlight/domain/HighlightPosition.java index cd03bb5b7..25463cd51 100644 --- a/backend/src/main/java/reviewme/highlight/domain/HighlightPosition.java +++ b/backend/src/main/java/reviewme/highlight/domain/HighlightPosition.java @@ -16,15 +16,15 @@ public class HighlightPosition { @Column(name = "line_index", nullable = false) - private long lineIndex; + private int lineIndex; @Column(name = "start_index", nullable = false) - private long startIndex; + private int startIndex; @Column(name = "end_index", nullable = false) - private long endIndex; + private int endIndex; - public HighlightPosition(long lineIndex, long startIndex, long endIndex) { + public HighlightPosition(int lineIndex, int startIndex, int endIndex) { validateNonNegativeIndexNumber(startIndex, endIndex); validateEndIndexOverStartIndex(startIndex, endIndex); this.lineIndex = lineIndex; diff --git a/backend/src/main/java/reviewme/highlight/service/dto/HighlightIndexRangeRequest.java b/backend/src/main/java/reviewme/highlight/service/dto/HighlightIndexRangeRequest.java index fde581308..42b7394e4 100644 --- a/backend/src/main/java/reviewme/highlight/service/dto/HighlightIndexRangeRequest.java +++ b/backend/src/main/java/reviewme/highlight/service/dto/HighlightIndexRangeRequest.java @@ -5,9 +5,9 @@ public record HighlightIndexRangeRequest( @NotNull(message = "시작 인덱스를 입력해주세요.") - Long startIndex, + Integer startIndex, @NotNull(message = "끝 인덱스를 입력해주세요.") - Long endIndex + Integer endIndex ) { } diff --git a/backend/src/main/java/reviewme/highlight/service/dto/HighlightedLineRequest.java b/backend/src/main/java/reviewme/highlight/service/dto/HighlightedLineRequest.java index a8275aea3..9188f3bc9 100644 --- a/backend/src/main/java/reviewme/highlight/service/dto/HighlightedLineRequest.java +++ b/backend/src/main/java/reviewme/highlight/service/dto/HighlightedLineRequest.java @@ -8,7 +8,7 @@ public record HighlightedLineRequest( @NotNull(message = "인덱스를 입력해주세요.") - Long index, + Integer index, @Valid @NotEmpty(message = "하이라이트 범위를 입력해주세요.") List ranges diff --git a/backend/src/test/java/reviewme/highlight/service/HighlightServiceTest.java b/backend/src/test/java/reviewme/highlight/service/HighlightServiceTest.java index d02a9909f..0128b9d3e 100644 --- a/backend/src/test/java/reviewme/highlight/service/HighlightServiceTest.java +++ b/backend/src/test/java/reviewme/highlight/service/HighlightServiceTest.java @@ -66,8 +66,8 @@ class HighlightServiceTest { TextAnswer textAnswer2 = new TextAnswer(questionId, "text answer2"); Review review = reviewRepository.save(new Review(templateId, reviewGroupId, List.of(textAnswer1, textAnswer2))); - HighlightIndexRangeRequest indexRangeRequest = new HighlightIndexRangeRequest(1L, 1L); - HighlightedLineRequest lineRequest = new HighlightedLineRequest(0L, List.of(indexRangeRequest)); + HighlightIndexRangeRequest indexRangeRequest = new HighlightIndexRangeRequest(1, 1); + HighlightedLineRequest lineRequest = new HighlightedLineRequest(0, List.of(indexRangeRequest)); HighlightRequest highlightRequest1 = new HighlightRequest(textAnswer1.getId(), List.of(lineRequest)); HighlightRequest highlightRequest2 = new HighlightRequest(textAnswer2.getId(), List.of(lineRequest)); HighlightsRequest highlightsRequest = new HighlightsRequest( @@ -99,9 +99,9 @@ class HighlightServiceTest { TextAnswer textAnswer2 = new TextAnswer(questionId, "text answer2"); Review review = reviewRepository.save(new Review(templateId, reviewGroupId, List.of(textAnswer1, textAnswer2))); - long startIndex = 2L; - long endIndex = 2L; - long lineIndex = 0; + int startIndex = 2; + int endIndex = 2; + int lineIndex = 0; HighlightIndexRangeRequest indexRangeRequest = new HighlightIndexRangeRequest(startIndex, endIndex); HighlightedLineRequest lineRequest1 = new HighlightedLineRequest(lineIndex, List.of(indexRangeRequest)); HighlightedLineRequest lineRequest2 = new HighlightedLineRequest(lineIndex, List.of(indexRangeRequest)); diff --git a/backend/src/test/java/reviewme/highlight/service/validator/HighlightValidatorTest.java b/backend/src/test/java/reviewme/highlight/service/validator/HighlightValidatorTest.java index 10fddba5f..21f1f8638 100644 --- a/backend/src/test/java/reviewme/highlight/service/validator/HighlightValidatorTest.java +++ b/backend/src/test/java/reviewme/highlight/service/validator/HighlightValidatorTest.java @@ -116,7 +116,7 @@ class HighlightValidatorTest { Review review = reviewRepository.save(new Review(templateId, reviewGroupId, List.of(textAnswer))); long answerLineCount = textAnswer.getContent().lines().count(); - HighlightedLineRequest highlightedLineRequest = new HighlightedLineRequest(answerLineCount, List.of()); + HighlightedLineRequest highlightedLineRequest = new HighlightedLineRequest((int) answerLineCount, List.of()); HighlightRequest highlightRequest = new HighlightRequest(textAnswer.getId(), List.of(highlightedLineRequest)); HighlightsRequest highlightsRequest = new HighlightsRequest(questionId, List.of(highlightRequest));