Skip to content
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

[refactor] #192 - 공연소개 & 유의사항 최대 글자수 500자로 구현 #193

Merged
merged 3 commits into from
Aug 29, 2024
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 @@ -17,6 +17,7 @@
import com.beat.domain.staff.dao.StaffRepository;
import com.beat.domain.staff.domain.Staff;
import com.beat.domain.user.domain.Users;
import com.beat.global.common.exception.BadRequestException;
import com.beat.global.common.exception.ForbiddenException;
import com.beat.global.common.exception.NotFoundException;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -47,6 +48,14 @@ public PerformanceResponse createPerformance(Long memberId, PerformanceRequest r

Users user = member.getUser();

if (request.performanceDescription().length() > 500) {
throw new BadRequestException(PerformanceErrorCode.INVALID_PERFORMANCE_DESCRIPTION_LENGTH);
}

if (request.performanceAttentionNote().length() > 500) {
throw new BadRequestException(PerformanceErrorCode.INVALID_ATTENTION_NOTE_LENGTH);
}

Performance performance = Performance.create(
request.performanceTitle(),
request.genre(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public class Performance extends BaseTimeEntity {
@Column(nullable = false)
private int runningTime;

@Column(nullable = false)
@Column(nullable = false, length = 500)
private String performanceDescription;

@Column(nullable = false)
@Column(nullable = false, length = 500)
private String performanceAttentionNote;

@Enumerated(EnumType.STRING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public enum PerformanceErrorCode implements BaseErrorCode {
PERFORMANCE_DELETE_FAILED(403, "예매자가 1명 이상 있을 경우, 공연을 삭제할 수 없습니다."),
NOT_PERFORMANCE_OWNER(403, "해당 공연의 메이커가 아닙니다."),
MAX_SCHEDULE_LIMIT_EXCEEDED(400, "공연 회차는 최대 3개까지 추가할 수 있습니다."),
INVALID_PERFORMANCE_DESCRIPTION_LENGTH(400, "공연 소개 글자수가 500자를 초과했습니다."),
INVALID_ATTENTION_NOTE_LENGTH(400, "공연 유의사항 글자수가 500자를 초과했습니다."),
INTERNAL_SERVER_ERROR(500, "서버 내부 오류입니다.")
;

Expand Down
Loading