Skip to content

Commit

Permalink
fix: 사진 목록 조회 파라미터 입력할 수 있도록 스웨거 설정, 응답 데이터에 photoId 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bflykky committed Aug 9, 2024
1 parent 2c08862 commit 17684bc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public Agenda createAgenda(Member member, AgendaRequest.CreateAgendaRequest requ
Long shareGroupId = request.getShareGroupId();
ShareGroup shareGroup = shareGroupService.findShareGroup(shareGroupId);
Profile profile = shareGroupService.findProfile(shareGroupId, member.getId());
Agenda newAgenda = agendaConverter.toEntity(profile,request.getTitle(),shareGroup);
agendaPhotoService.saveAgendaPhotoList(newAgenda,request.getAgendasPhotoList());
Agenda newAgenda = agendaConverter.toEntity(profile, request.getTitle(),shareGroup);
agendaPhotoService.saveAgendaPhotoList(newAgenda, request.getAgendasPhotoList());

return agendaRepository.save(newAgenda);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.umc.naoman.global.security.annotation.LoginMember;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -56,6 +57,10 @@ public ResultResponse<PhotoResponse.PhotoUploadInfo> uploadPhotoList(@Valid @Req

@GetMapping("/all")
@Operation(summary = "특정 공유그룹의 전체 사진 조회 API", description = "특정 공유 그룹의 전체 사진을 조회하는 API입니다.")
@Parameters(value = {
@Parameter(name = "page", description = "조회할 페이지를 입력해 주세요.(0번부터 시작)"),
@Parameter(name = "size", description = "한 페이지에 나타낼 사진 개수를 입력해주세요.")
})
public ResultResponse<PhotoResponse.PagedPhotoInfo> getAllPhotoListByShareGroup(@RequestParam Long shareGroupId,
@PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC)
@Parameter(hidden = true) Pageable pageable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public PhotoResponse.PhotoInfo toPhotoInfo(Photo photo) {
String rawUrl = photo.getUrl();

return PhotoResponse.PhotoInfo.builder()
.photoId(photo.getId())
.rawPhotoUrl(rawUrl)
.w200PhotoUrl(createResizedPhotoUrl(rawUrl, W200_PATH_PREFIX))
.w400PhotoUrl(createResizedPhotoUrl(rawUrl, W400_PATH_PREFIX))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static class PagedPhotoInfo {
@AllArgsConstructor
@NoArgsConstructor
public static class PhotoInfo {
private Long photoId;
private String rawPhotoUrl;
private String w200PhotoUrl;
private String w400PhotoUrl;
Expand Down

0 comments on commit 17684bc

Please sign in to comment.