-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/#633 행사 추가 api 요청 명세 변경 #634
The head ref may contain hidden characters: "Feature/#633-\uD589\uC0AC-\uCD94\uAC00-API-\uC694\uCCAD-\uBA85\uC138-\uBCC0\uACBD"
Changes from all commits
2cbac84
d08f7f7
bb20b1e
30d5647
36810d1
53d2ab9
7d99b13
d3aba1b
f50adaa
ab626da
fc31ef3
6cdbf69
7d16992
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
import org.springframework.data.jpa.domain.Specification; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
@Service | ||
@Transactional | ||
|
@@ -178,13 +179,14 @@ private List<EventResponse> filterEventResponseByStatuses( | |
}); | ||
} | ||
|
||
public EventDetailResponse addEvent(final EventDetailRequest request, final LocalDate today) { | ||
public EventDetailResponse addEvent(final EventDetailRequest request, | ||
final List<MultipartFile> images, final LocalDate today) { | ||
final Event event = eventRepository.save(request.toEvent()); | ||
final List<Tag> tags = findAllPersistTagsOrElseThrow(request.getTags()); | ||
event.addAllEventTags(tags); | ||
|
||
final List<String> imageUrls = imageCommandService | ||
.saveImages(ImageType.EVENT, event.getId(), request.getImages()) | ||
.saveImages(ImageType.EVENT, event.getId(), images) | ||
.stream() | ||
.sorted(comparing(Image::getOrder)) | ||
.map(Image::getName) | ||
|
@@ -196,7 +198,7 @@ public EventDetailResponse addEvent(final EventDetailRequest request, final Loca | |
} | ||
|
||
public EventDetailResponse updateEvent(final Long eventId, final EventDetailRequest request, | ||
final LocalDate today) { | ||
final List<MultipartFile> images, final LocalDate today) { | ||
final Event event = eventRepository.findById(eventId) | ||
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. update에서는 images 파라미터가 안 사용 되는 것 같은데 파라미터로 넣으신 이유가 있나요? 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. 관리자 페이지(프론트)를 미리 완성시켜놓으려고 요청 포맷만 미리 수정해두었습니다...! |
||
.orElseThrow(() -> new EventException(NOT_FOUND_EVENT)); | ||
|
||
|
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.
제가 알기로는 request 스니펫이 이해하기 너무 어려워서 의도적으로 문자열로 하드코딩 해 둔 것으로 아는데 혹시 수정하신 이유가 있으신가요
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.
스니펫이 수정되기도 했고, 수정 후의 request 스니펫은 그대로 사용해도 이해하기 어렵지 않을거라 생각해서 수정해주었습니다!
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.
multipart 로 adoc 만들면 엄청 지저분해지지 않아요??