fix(comment-nickname): deleted_ 로 시작하는 닉네임 접두사 노출을 제거한다

This commit is contained in:
2026-02-20 18:47:01 +09:00
parent 211eb3507c
commit c3a2ca66f8
6 changed files with 84 additions and 6 deletions

View File

@@ -5,6 +5,8 @@ import java.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
private const val DELETED_NICKNAME_PREFIX = "deleted_"
fun String.convertLocalDateTime(format: String): LocalDateTime {
val dateTimeFormatter = DateTimeFormatter.ofPattern(format)
return LocalDateTime.parse(this, dateTimeFormatter)
@@ -24,3 +26,11 @@ fun String.convertLocalDateTime(
.withZoneSameInstant(ZoneId.of("UTC"))
.toLocalDateTime()
}
fun String.removeDeletedNicknamePrefix(): String {
return if (startsWith(DELETED_NICKNAME_PREFIX)) {
removePrefix(DELETED_NICKNAME_PREFIX)
} else {
this
}
}