-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1주차 세미나] 선택 구현 과제 #4
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
choyeongju
assigned choyeongju, khyojun, daehwan2da, airoca, yeeun0702 and sansan20535 and unassigned choyeongju, khyojun and daehwan2da
Oct 10, 2024
3 tasks
daehwan2da
reviewed
Oct 16, 2024
@@ -37,4 +37,13 @@ void patchDiary(final String id, final String body) { | |||
throw new IdNotExistException(); | |||
} | |||
} | |||
|
|||
void restoreDiary(final String id) { | |||
final Long diaryId = Long.parseLong(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id 에 숫자가 아닌 값이 들어오는 경우에 대한 검증이 필요해보여요
daehwan2da
reviewed
Oct 16, 2024
@@ -12,4 +15,16 @@ public static void validate(final String body){ | |||
throw new DiaryBodyLengthException(); | |||
} | |||
} | |||
|
|||
public static int countGraphemeClusters(String body) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 어디서 호출해요?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TODO
[1주차 과제] String 에 대해서 #5
Map<Long, Diary> 형태로 저장소를 구현하고 Diary 객체에 속성 필드값을 추가하는 방법도 있겠지만.. 코드를 너무 많이 건드려야 할 것 같아서 중간고사의 시간 압박 이슈와 약간의 귀찮음 이슈로…
삭제된 일기를 복구하는 기능
⭐ ’삭제된 일기’를 저장해두는 별도의 자료구조를 만든다!
yeongju.cho/src/main/java/org/sopt/week1/DiaryRepository.java
Line 13 in 18b978b
동작 과정은 다음과 같습니다.
일기 수정은 하루에 2번만
⭐ 마찬가지로 ’수정 횟수’와 ‘마지막 수정 날짜’ 를 저장해두는 별도의 자료구조를 만든다.
동작 과정은 다음과 같습니다.
yeongju.cho/src/main/java/org/sopt/week1/DiaryRepository.java
Lines 56 to 73 in 18b978b
application 이 종료되어도 일기가 계속해서 저장되었으면 좋겠어요! (아직 구현 미완료)
⭐ 파일 입출력
한 줄 일기의 글자수 제한은 유지하면서, 이모지를 넣을 수 없을까요??
⏩ Grapheme Cluster 란?
여러 개의 코드 포인트로 이루어져 있어도 하나의 시각적 문자로 인식되는 문자열의 단위
이모지나 합성된 문자를 하나의 문자처럼 처리할 수 있다 ( é 는 'e' + 악센트 )
⏩ 구현 방법의 종류
✅ 정규식을 사용해서 구현했습니다.
정규 표현식을 사용하여 유니코드의 Grapheme Cluster 단위로 문자열을 나누거나 계산한다.
yeongju.cho/src/main/java/org/sopt/week1/DiaryValidator.java
Lines 20 to 30 in 18b978b