Skip to content

Commit

Permalink
fix: updated camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Nov 24, 2024
1 parent f74a9f7 commit d1cb16d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.smeem.application.port.input.dto.response.diary;

import com.smeem.application.domain.diary.Correction;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AccessLevel;
import lombok.Builder;

@Builder(access = AccessLevel.PRIVATE)
public record CorrectionResponse(
@Schema(description = "교정 전 문장", example = "hallo")
String originalSentence,
@Schema(description = "교정 후 문장", example = "hello")
String correctedSentence,
@Schema(description = "교정 사유", example = "스펠링 틀림")
String reason,
@Schema(description = "교정 여부", example = "true")
boolean isCorrected
) {

public static CorrectionResponse from(Correction correction) {
return CorrectionResponse.builder()
.originalSentence(correction.originalSentence())
.correctedSentence(correction.correctedSentence())
.reason(correction.reason())
.isCorrected(correction.isCorrected())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
@Builder(access = AccessLevel.PRIVATE)
public record CorrectionsResponse(
@Schema(description = "코칭 결과")
List<Correction> corrections
List<CorrectionResponse> corrections
) {

public static CorrectionsResponse of(List<Correction> corrections) {
return CorrectionsResponse.builder()
.corrections(corrections)
.corrections(corrections.stream().map(CorrectionResponse::from).toList())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public record RetrieveDiaryResponse(
@Schema(description = "일기 작성자 닉네임")
String username,
@Schema(description = "코칭 결과 정보")
List<Correction> corrections,
List<CorrectionResponse> corrections,
@Schema(description = "코칭 횟수")
int correctionCount,
@Schema(description = "코칭 최대 횟수")
Expand All @@ -45,7 +45,7 @@ public static RetrieveDiaryResponse of(
.content(diary.getContent())
.createdAt(SmeemConverter.toString(diary.getCreatedAt()))
.username(member.getUsername())
.corrections(corrections)
.corrections(corrections.stream().map(CorrectionResponse::from).toList())
.correctionCount(correctionCount)
.correctionMaxCount(1)
.build();
Expand Down

0 comments on commit d1cb16d

Please sign in to comment.