-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/#186 calendar event 권한 오류 해결 및 colorchip enum 생성 #201
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
Merged
yeongsinkeem
merged 3 commits into
dev_temp
from
fix/#186-calendar-event-colorchip-enum
Feb 27, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/main/java/org/example/tackit/domain/entity/ColorChip.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package org.example.tackit.domain.entity; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||
| import com.fasterxml.jackson.annotation.JsonValue; | ||
| import lombok.Getter; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @Getter | ||
| @RequiredArgsConstructor | ||
| public enum ColorChip { | ||
| BLUE("blue"), | ||
| GRAY("gray"), | ||
| PINK("pink"), | ||
| ORANGE("orange"), | ||
| GREEN("green"); | ||
|
|
||
| private final String colorName; | ||
|
|
||
| // 프론트엔드 -> 백엔드 역직렬화 용 | ||
| @JsonCreator | ||
| public static ColorChip from(String value) { | ||
| for (ColorChip color : ColorChip.values()) { | ||
| if (color.getColorName().equalsIgnoreCase(value)) { | ||
| return color; | ||
| } | ||
| } | ||
| throw new IllegalArgumentException("지원하지 않는 컬러칩 색상입니다: " + value); | ||
| } | ||
|
|
||
| // 백엔드 -> 프론트엔드 직렬화 용 | ||
| @JsonValue | ||
| public String getColorName() { | ||
| return colorName; | ||
| } | ||
| } | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
15 changes: 8 additions & 7 deletions
15
src/main/java/org/example/tackit/domain/event/dto/EventSimpleResDto.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,21 @@ | ||
| package org.example.tackit.domain.event.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import org.example.tackit.domain.entity.ColorChip; | ||
|
|
||
| @Getter | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @Builder | ||
| public class EventSimpleResDto { | ||
| private Long eventId; | ||
| private String title; | ||
| private LocalDateTime startsAt; | ||
| private LocalDateTime endsAt; | ||
| private String colorChip; | ||
|
|
||
| private Long eventId; | ||
| private String title; | ||
| private LocalDateTime startsAt; | ||
| private LocalDateTime endsAt; | ||
| private ColorChip colorChip; | ||
| } |
25 changes: 15 additions & 10 deletions
25
src/main/java/org/example/tackit/domain/event/dto/EventUpdateReqDto.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,26 @@ | ||
| package org.example.tackit.domain.event.dto; | ||
|
|
||
| import lombok.*; | ||
| import org.example.tackit.domain.entity.EventScope; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.List; | ||
| import lombok.AccessLevel; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import org.example.tackit.domain.entity.ColorChip; | ||
| import org.example.tackit.domain.entity.EventScope; | ||
|
|
||
| @Getter | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @AllArgsConstructor | ||
| @Builder | ||
| public class EventUpdateReqDto { | ||
| private String title; | ||
| private LocalDateTime startsAt; | ||
| private LocalDateTime endsAt; | ||
| private String description; | ||
| private EventScope eventScope; | ||
| private List<Long> participants; | ||
| private String colorChip; | ||
|
|
||
| private String title; | ||
| private LocalDateTime startsAt; | ||
| private LocalDateTime endsAt; | ||
| private String description; | ||
| private EventScope eventScope; | ||
| private List<Long> participants; | ||
| private ColorChip colorChip; | ||
| } |
Oops, something went wrong.
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.
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.
성능 향상을 위해
from메서드를 최적화하는 것을 제안합니다. 현재 구현은from메서드가 호출될 때마다ColorChip.values()를 순회하여 O(N)의 시간 복잡도를 가집니다. Enum의 값이 많아지면 성능에 영향을 줄 수 있습니다.정적
Map을 사용하여 색상 이름을 키로ColorChip인스턴스를 저장하면 O(1) 시간 복잡도로 조회가 가능합니다.아래와 같이 수정할 수 있습니다. 이 변경을 적용하려면 파일 상단에
java.util.Map,java.util.stream.Stream,java.util.stream.Collectors,java.util.function.Function을 임포트해야 합니다.