Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
42eabb9
docs: README.md κΈ°λŠ₯ μš”κ΅¬μ‚¬ν•­ μ—…λ°μ΄νŠΈ
alstj2384 Jun 2, 2026
9b10514
refactor: ReservationName, ReservationTime, Theme을 Slot λ„λ©”μΈμœΌλ‘œ 관리
alstj2384 Jun 3, 2026
32a096e
refactor: 첫 μ˜ˆμ•½μ΄ λ™μ‹œμ— λ“€μ–΄μ˜¬ λ•Œ ν•œ 건만 μŠΉμΈλ¨μ„ 보μž₯ν•˜λ„λ‘ λ³€κ²½
alstj2384 Jun 3, 2026
7355af4
refactor: μˆœμœ„ 계산을 λ„λ©”μΈμ—μ„œ μˆ˜ν–‰ν•˜λ„λ‘ λ³€κ²½
alstj2384 Jun 3, 2026
f01232e
refactor: RoomEscapeFixture에 λΉŒλ” νŒ¨ν„΄μ„ λ„μž…ν•˜μ—¬ μœ μ—°ν•˜κ²Œ ν…ŒμŠ€νŠΈ 객체 μƒμ„±ν•˜λ„λ‘ λ³€κ²½
alstj2384 Jun 3, 2026
6c734ed
refactor: repository saveμ‹œ withId ν˜•νƒœλ‘œ 객체λ₯Ό λ°˜ν™˜ν•˜λ„λ‘ 톡일
alstj2384 Jun 3, 2026
258371e
refactor: Rank μ‚°μ • 둜직 λ©”μ„œλ“œλ‘œ μΆ”μΆœ
alstj2384 Jun 3, 2026
9c3113e
test: ν…ŒμŠ€νŠΈ 클래슀 public μ ‘κ·Όμ œμ–΄μž 제거
alstj2384 Jun 4, 2026
538d01e
refactor: Reservation 생성 λ©”μ„œλ“œ 이름을 create둜 λ³€κ²½
alstj2384 Jun 4, 2026
47d4828
refactor: ν…ŒμŠ€νŠΈ μˆ˜μ •
alstj2384 Jun 4, 2026
16bdcd5
refactor: RankedReservation μ ‘κ·Ό μ œμ–΄μž μˆ˜μ •
alstj2384 Jun 5, 2026
d767880
refactor: SlotService λ―Έμ‚¬μš© λ©”μ„œλ“œ 제거
alstj2384 Jun 5, 2026
25e6e89
refactor: Reservation ensureNotPast tda 적용
alstj2384 Jun 7, 2026
ab706a0
refactor: Reservation Service 흐름을 도메인 μ±…μž„μœΌλ‘œ 뢄리
alstj2384 Jun 7, 2026
34230f8
refactor: Reservations 생성 μ‹œ null 검사 μΆ”κ°€
alstj2384 Jun 7, 2026
84cc19b
test: ReservationService updateμ‹œ WAITING인 경우만 승격 TC μΆ”κ°€
alstj2384 Jun 7, 2026
ae8b3ee
test: μ„œλΉ„μŠ€ ν†΅ν•©ν…ŒμŠ€νŠΈλ₯Ό Mockitoλ₯Ό μ‚¬μš©ν•˜μ§€ μ•Šλ„λ‘ λ³€κ²½
alstj2384 Jun 11, 2026
3a052f2
refactor: Entity 객체 λ―Έμ˜μ† μƒνƒœμž„μ„ λ‚˜νƒ€λ‚΄λŠ” μƒμˆ˜ μΆ”κ°€
alstj2384 Jun 11, 2026
4884727
refactor: isPastFrom 넀이밍 λ³€κ²½
alstj2384 Jun 11, 2026
db935b6
refactor: entity equals & hashCode 제거
alstj2384 Jun 11, 2026
aa73a46
refactor: ENUM 비ꡐ μ‹œ 직접 λΉ„κ΅ν•˜λ„λ‘ λ³€κ²½
alstj2384 Jun 11, 2026
db0de31
refactor: λ””λ―Έν„°μ˜ 법칙을 μ€€μˆ˜ν•˜λ„λ‘ λ³€κ²½
alstj2384 Jun 11, 2026
adc5a62
refactor: λ™μ‹œμ„± ν…ŒμŠ€νŠΈλ₯Ό 톡합 ν…ŒμŠ€νŠΈμ— 포함
alstj2384 Jun 11, 2026
43fbde4
[1 단계] JPA μ „ν™˜
alstj2384 Jun 16, 2026
90bb618
[2 단계] λ‚΄ μ˜ˆμ•½ λͺ©λ‘
alstj2384 Jun 17, 2026
a7ba6a2
[3-4 단계] μ˜ˆμ•½ λŒ€κΈ° 및 관리
alstj2384 Jun 18, 2026
fd088b1
resolve conflict
alstj2384 Jun 18, 2026
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
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.rest-assured:rest-assured:5.3.1'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

runtimeOnly 'com.h2database:h2'
}

Expand Down
17 changes: 4 additions & 13 deletions src/main/java/common/exception/ErrorCode.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package common.exception;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;

@RequiredArgsConstructor
@Getter
public enum ErrorCode {
// μš”μ²­ ν˜•μ‹ 및 ν•„μˆ˜κ°’ μœ„λ°˜ (BAD REQUEST)
INVALID_NAME_LENGTH("이름 κΈΈμ΄λŠ” 1자 ~ 20자 사이여야 ν•©λ‹ˆλ‹€.", HttpStatus.BAD_REQUEST),
Expand All @@ -28,17 +32,4 @@ public enum ErrorCode {

private final String message;
private final HttpStatus httpStatus;

ErrorCode(String message, HttpStatus httpStatus) {
this.message = message;
this.httpStatus = httpStatus;
}

public String getMessage() {
return message;
}

public HttpStatus getHttpStatus() {
return httpStatus;
}
}
17 changes: 4 additions & 13 deletions src/main/java/common/exception/ErrorResponse.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
package common.exception;

import java.time.LocalDateTime;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public class ErrorResponse {
private final LocalDateTime timestamp;
private final String message;

private ErrorResponse(LocalDateTime timestamp, String message) {
this.timestamp = timestamp;
this.message = message;
}

public static ErrorResponse create(String message) {
return new ErrorResponse(LocalDateTime.now(), message);
}

public LocalDateTime getTimestamp() {
return timestamp;
}

public String getMessage() {
return message;
}
}
7 changes: 3 additions & 4 deletions src/main/java/common/exception/RoomEscapeException.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package common.exception;

import lombok.Getter;

@Getter
public class RoomEscapeException extends RuntimeException {
private final ErrorCode errorCode;

public RoomEscapeException(ErrorCode errorCode) {
super(errorCode.getMessage());
this.errorCode = errorCode;
}

public ErrorCode getErrorCode() {
return errorCode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import common.exception.ErrorResponse;
import common.exception.RoomEscapeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.dao.DataAccessException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand All @@ -14,10 +13,10 @@
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
public static final String UNEXPECTED_ERROR = "μ˜ˆμƒμΉ˜ λͺ»ν•œ 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. μž μ‹œ ν›„ λ‹€μ‹œ μ‹œλ„ν•΄μ£Όμ„Έμš”.";
public static final String DATABASE_ERROR = "데이터 베이슀 κ΄€λ ¨ 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. κ΄€λ¦¬μžμ—κ²Œ λ¬Έμ˜ν•΄μ£Όμ„Έμš”";
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);

@ExceptionHandler(RoomEscapeException.class)
public ResponseEntity<ErrorResponse> roomEscapeExceptionHandle(RoomEscapeException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jakarta.validation.Valid;
import java.time.LocalDateTime;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -20,13 +21,10 @@
import roomescape.service.ReservationService;

@RestController
@RequiredArgsConstructor
public class ReservationController {
private final ReservationService reservationService;

public ReservationController(ReservationService reservationService) {
this.reservationService = reservationService;
}

@PostMapping("/reservations")
@ResponseStatus(HttpStatus.CREATED)
public ReservationResponse create(@Valid @RequestBody ReservationCreateRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jakarta.validation.Valid;
import java.time.LocalDate;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -19,13 +20,10 @@
import roomescape.service.ReservationTimeService;

@RestController
@RequiredArgsConstructor
public class ReservationTimeController {
private final ReservationTimeService reservationTimeService;

public ReservationTimeController(ReservationTimeService reservationTimeService) {
this.reservationTimeService = reservationTimeService;
}

@PostMapping("/admin/times")
@ResponseStatus(HttpStatus.CREATED)
public ReservationTimeResponse create(@Valid @RequestBody ReservationTimeCreateRequest request) {
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/roomescape/controller/ThemeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import jakarta.validation.Valid;
import java.time.LocalDate;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -19,13 +20,10 @@
import roomescape.service.ThemeService;

@RestController
@RequiredArgsConstructor
public class ThemeController {
private final ThemeService themeService;

public ThemeController(ThemeService themeService) {
this.themeService = themeService;
}

@PostMapping("/admin/themes")
@ResponseStatus(HttpStatus.CREATED)
public ThemeResponse create(@Valid @RequestBody ThemeCreateRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,16 @@
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import java.time.LocalDate;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public class AvailableTimeFindRequest {
@NotNull(message = "λ‚ μ§œλŠ” ν•„μˆ˜λ‘œ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€.")
private final LocalDate date;

@NotNull(message = "Theme IDλŠ” ν•„μˆ˜λ‘œ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€.")
@Positive(message = "Theme IDλŠ” μ–‘μˆ˜μ—¬μ•Ό ν•©λ‹ˆλ‹€.")
private final Long themeId;

public AvailableTimeFindRequest(LocalDate date, Long themeId) {
this.date = date;
this.themeId = themeId;
}

public LocalDate getDate() {
return date;
}

public Long getThemeId() {
return themeId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import java.time.LocalDate;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public class ReservationCreateRequest {
@NotNull(message = "이름은 ν•„μˆ˜λ‘œ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€")
private final String name;
Expand All @@ -18,27 +22,4 @@ public class ReservationCreateRequest {
@NotNull
@Positive(message = "Theme IDλŠ” μ–‘μˆ˜μ—¬μ•Ό ν•©λ‹ˆλ‹€.")
private final Long themeId;

public ReservationCreateRequest(String name, LocalDate date, Long timeId, Long themeId) {
this.name = name;
this.date = date;
this.timeId = timeId;
this.themeId = themeId;
}

public String getName() {
return name;
}

public LocalDate getDate() {
return date;
}

public Long getTimeId() {
return timeId;
}

public Long getThemeId() {
return themeId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

import jakarta.validation.constraints.NotNull;
import java.time.LocalTime;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public class ReservationTimeCreateRequest {
@NotNull(message = "μ‹œκ°„μ„ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€")
private final LocalTime startAt;

public ReservationTimeCreateRequest(LocalTime startAt) {
this.startAt = startAt;
}

public LocalTime getStartAt() {
return startAt;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import java.time.LocalDate;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public class ReservationUpdateRequest {
@NotNull(message = "이름은 ν•„μˆ˜λ‘œ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€")
private final String name;
Expand All @@ -18,27 +22,4 @@ public class ReservationUpdateRequest {
@NotNull
@Positive(message = "Theme IDλŠ” μ–‘μˆ˜μ—¬μ•Ό ν•©λ‹ˆλ‹€.")
private final Long themeId;

public ReservationUpdateRequest(String name, LocalDate date, Long timeId, Long themeId) {
this.name = name;
this.date = date;
this.timeId = timeId;
this.themeId = themeId;
}

public String getName() {
return name;
}

public LocalDate getDate() {
return date;
}

public Long getTimeId() {
return timeId;
}

public Long getThemeId() {
return themeId;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package roomescape.controller.dto.request;

import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public class ThemeCreateRequest {
@NotNull(message = "이름은 ν•„μˆ˜λ‘œ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€")
private final String name;
Expand All @@ -11,22 +15,4 @@ public class ThemeCreateRequest {

@NotNull(message = "URL은 ν•„μˆ˜λ‘œ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€")
private final String thumbnailUrl;

public ThemeCreateRequest(String name, String description, String thumbnailUrl) {
this.name = name;
this.description = description;
this.thumbnailUrl = thumbnailUrl;
}

public String getName() {
return name;
}

public String getDescription() {
return description;
}

public String getThumbnailUrl() {
return thumbnailUrl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import jakarta.validation.constraints.Positive;
import java.time.LocalDate;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public class ThemeFamousFindRequest {
@Positive(message = "기간은 μ–‘μˆ˜μ—¬μ•Ό ν•©λ‹ˆλ‹€")
private final Long recentDays;
Expand All @@ -11,24 +15,6 @@ public class ThemeFamousFindRequest {

@Positive(message = "κ°œμˆ˜λŠ” μ–‘μˆ˜μ—¬μ•Ό ν•©λ‹ˆλ‹€")
private final Long limit;

public ThemeFamousFindRequest(Long recentDays, LocalDate baseDate, Long limit) {
this.recentDays = recentDays;
this.baseDate = baseDate;
this.limit = limit;
}

public Long getRecentDays() {
return recentDays;
}

public LocalDate getBaseDate() {
return baseDate;
}

public Long getLimit() {
return limit;
}
}


Loading