-
Notifications
You must be signed in to change notification settings - Fork 1
[BE-FEAT] 롱 폴링 응답 데이터 추가 #408
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
Changes from 3 commits
b505e43
7f3bae2
f349cd5
89874f0
e680070
04ade29
d8d4b14
11806bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,29 @@ | ||
| package endolphin.backend.domain.personal_event.dto; | ||
|
|
||
| import endolphin.backend.domain.personal_event.entity.PersonalEvent; | ||
| import endolphin.backend.global.google.dto.GoogleEvent; | ||
| import java.time.LocalDateTime; | ||
|
|
||
| public record SyncPersonalEvent( | ||
| Long id, | ||
| Boolean isAdjustable, | ||
| String calendarId, | ||
| String googleEventId, | ||
| String title, | ||
| LocalDateTime startDateTime, | ||
| LocalDateTime endDateTime, | ||
| String status | ||
| ) { | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just ask; status를 enum 말고 String으로 했던 이유가 있었던가요?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. db를 거쳐도 googleEventId 응답에 포함해야 하나요?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 프론트와 협의한 결과, googleEventId를 응답에서 삭제하기로 결정하였습니다.! |
||
| public static SyncPersonalEvent from(GoogleEvent event) { | ||
| return new SyncPersonalEvent(event.eventId(), event.summary(), event.startDateTime(), | ||
| event.endDateTime(), event.status().getValue()); | ||
| return new SyncPersonalEvent(null, null, null, | ||
| event.eventId(), event.summary(), event.startDateTime(), | ||
| event.endDateTime(), event.status().getValue()); | ||
| } | ||
|
|
||
| public static SyncPersonalEvent from(PersonalEvent event, GoogleEvent googleEvent) { | ||
| return new SyncPersonalEvent(event.getId(), event.getIsAdjustable(), event.getCalendarId(), | ||
| googleEvent.eventId(), googleEvent.summary(), googleEvent.startDateTime(), | ||
| googleEvent.endDateTime(), googleEvent.status().getValue()); | ||
| } | ||
| } | ||
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.
tentative를 클라이언트에 주기로한건가요?
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.
db 거치는데 confirmed를 그대로 주는 이유가 있을까요?
update와 create 분기하는 건 어떻게 생각하시나요
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
프론트에서 confirmed를 받고 어떤 동작을 수행하고 있는지는 정확히 모르지만,
백에서 내려주는 응답을 생성, 변경, 삭제 세가지의 상태를 정의해서 주면 더 편한 부분이 있지 않을까 하는 제 생각이었습니다.
백엔드 로직에서도 구글로부터 confirmed를 받으면 해당 id의 일정이 존재하는지 확인 후 update, create로 분기를 하는데요, 프론트도 동일한 방법을 수행해야 한다면 효율성이 떨어지지 않을까 해서요!
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.
백에서 수행한 로직을 프론트에서도 수행하면 비효율적이긴 하겠네요!
어떤 것이 편한 지 프론트와 협의 후 수정하겠습니다!
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.
프론트와 협의한 결과, 백엔드에서 생성, 변경, 삭제를 구분해서 응답하는 걸로 수정하였습니다.!