Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.promesa.promesa.domain.artist.exception.ArtistNotFoundException;
import com.promesa.promesa.domain.exhibition.domain.*;
import com.promesa.promesa.domain.exhibition.dto.request.AddExhibitionRequest;
import com.promesa.promesa.domain.exhibition.dto.request.ExhibitionImageRequest;
import com.promesa.promesa.domain.exhibition.dto.request.UpdateExhibitionRequest;
import com.promesa.promesa.domain.exhibition.dto.response.*;
import com.promesa.promesa.domain.exhibition.exception.DuplicateExhibitionTitleException;
Expand Down Expand Up @@ -83,22 +82,6 @@ public ExhibitionDetailResponse getExhibitionInfo(Member member, Long exhibition
return response;
}

/**
* 현재 진행 중인 기획전 조회 : 이미지는 presignedUrl로 반환
* @return
*/
public List<ExhibitionSummary> getOngoingExhibitions() {
List<Exhibition> ongoing = exhibitionRepository.findAllByStatus(ExhibitionStatus.ONGOING);

return ongoing.stream()
.map(exhibition -> {
String imageUrl = s3Service.createPresignedGetUrl(bucketName, exhibition.getThumbnailImageKey());
List<String> artistNames = exhibitionQueryRepository.findArtistNames(exhibition.getId());
return ExhibitionSummary.of(exhibition, artistNames, imageUrl);
})
.toList();
}

/**
* 작가가 참여한 기획전을 조회
* @param artistId
Expand Down Expand Up @@ -160,6 +143,7 @@ public String createExhibition(@Valid AddExhibitionRequest request) {

Exhibition newExhibition = Exhibition.builder()
.title(request.title())
.subtitle(request.subTitle())
.description(request.description())
.startDate(startDate)
.endDate(endDate)
Expand Down Expand Up @@ -193,6 +177,7 @@ public String updateExhibition(Long exhibitionId, @Valid UpdateExhibitionRequest
}

exhibition.setTitle(request.title());
exhibition.setSubtitle(request.subTitle());
exhibition.setDescription(request.description());
exhibition.setStartDate(request.startDate());
exhibition.setEndDate(request.endDate());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class Exhibition extends BaseTimeEntity {
@Column(nullable = false)
private String title;

private String subtitle;

@NotBlank
@Column(nullable = false)
private String description;
Expand Down Expand Up @@ -74,8 +76,9 @@ public List<ExhibitionImage> getDetailImages() {
}

@Builder
public Exhibition(String title, String description, LocalDate startDate, LocalDate endDate, ExhibitionStatus status) {
public Exhibition(String title, String subtitle, String description, LocalDate startDate, LocalDate endDate, ExhibitionStatus status) {
this.title = title;
this.subtitle = subtitle;
this.description = description;
this.startDate = startDate;
this.endDate = endDate;
Expand Down Expand Up @@ -104,6 +107,13 @@ public void setTitle(String title) {
this.title = title;
}

public void setSubtitle(String subTitle) {
if (subTitle == null || subTitle.isBlank()) {
throw ValidationException.EXCEPTION;
}
this.subtitle = subTitle;
}

public void setDescription(String description) {
if (description == null || description.isBlank()) {
throw ValidationException.EXCEPTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ public record AddExhibitionRequest(
@NotBlank(message = "제목은 필수입니다")
String title,

@NotBlank(message = "소제목은 필수입니다")
String subTitle,

@NotBlank(message = "설명은 필수입니다")
String description,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ public record UpdateExhibitionRequest(
@NotBlank(message = "제목은 필수입니다")
String title,

@NotBlank(message = "소제목은 필수입니다")
String subTitle,

@NotBlank(message = "설명은 필수입니다")
String description,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.promesa.promesa.domain.exhibition.dto.response;

import com.promesa.promesa.common.application.S3Service;
import com.promesa.promesa.domain.exhibition.domain.Exhibition;
import com.promesa.promesa.domain.exhibition.domain.ExhibitionStatus;

Expand All @@ -12,6 +11,7 @@ public record ExhibitionSummary(
Long id,
ExhibitionStatus status,
String title,
String subTitle,
String description,
List<String> artistNames, // 참여한 작가 목록
LocalDate startDate,
Expand All @@ -26,6 +26,7 @@ public static ExhibitionSummary of(Exhibition exhibition, List<String> artistNam
exhibition.getId(),
exhibition.getStatus(),
exhibition.getTitle(),
exhibition.getSubtitle(),
exhibition.getDescription(),
artistNames,
exhibition.getStartDate(),
Expand Down
9 changes: 5 additions & 4 deletions src/main/resources/data-local.sql
Original file line number Diff line number Diff line change
Expand Up @@ -509,22 +509,23 @@ INSERT INTO exhibition (
updated_at,
description,
title,
subtitle,
exhibition_status,
start_date,
end_date
) VALUES
(1, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(),
'따뜻한 봄 작품들', '봄 기획전',
'따뜻한 봄 작품들', '봄 기획전', '봄은 따뜻',
'PAST', '2025-03-20', '2025-04-20'),
(2, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(),
'무더운 여름 작품들', '여름 기획전',
'무더운 여름 작품들', '여름 기획전', '여름은 무덥',
'ONGOING', '2025-06-20', '2025-07-20'),
(3, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(),
'상큼한 토마토가 좋아', '토마토 기획전',
'상큼한 토마토가 좋아', '토마토 기획전', '멋쟁이 토마토',
'UPCOMING', '2025-12-20', NULL),
(4, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP(),
'현대적인 감각과 기능성이 돋보이는 모연도예 작가님의 예술 철학을 다양한 작품과 함게 살펴보세요.',
'작품 가이드 Ep.01\n모언도예_차도구 소개',
'작품 가이드 Ep.01', '모언도예_차도구 소개',
'PERMANENT','2025-07-29', NULL);

-- 2) EXHIBITION_IMAGE 테이블: 썸네일(is_thumbnail=1)과 상세 이미지(is_thumbnail=0)로 분리
Expand Down
Loading