Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
529976a
refactor: ์˜คํƒ€ ์ˆ˜์ •
wontop02 May 30, 2026
d09bdf5
refactor: id๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋“  ํ•„๋“œ๋กœ equals, hashCode ์žฌ์ •์˜
wontop02 May 30, 2026
e4f94c6
test: ๋†’์€ ์ˆซ์ž์˜ ID๋กœ existBytimeId, existByThemeId๋ฅผ ํ…Œ์ŠคํŠธํ•ด, ์šฐ์—ฐํžˆ ํ…Œ์ŠคํŠธ๊ฐ€ ํ†ต๊ณผ๋˜๋Š” ์ƒโ€ฆ
wontop02 May 31, 2026
2e3a249
refactor: ๋งค์ง ๋„˜๋ฒ„ ์ƒ์ˆ˜๋กœ ๋ณ€๊ฒฝ
wontop02 May 31, 2026
f4ae3c1
refactor: ์˜ˆ์•ฝ ๊ฐ€๋Šฅ ์ƒํƒœ Enum ๋„์ž… ๋ฐ Service์—์„œ request, response ๋ถ„๋ฆฌ
wontop02 Jun 1, 2026
9796957
refactor: service ์–ด๋…ธํ…Œ์ด์…˜ ๋ณ€๊ฒฝ, Repository Optional ๋ฐ˜ํ™˜ ๋ฐฉ์‹ ๋ณ€๊ฒฝ
wontop02 Jun 2, 2026
0847121
refactor: ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์–ด๋…ธํ…Œ์ด์…˜ ์‚ญ์ œ
wontop02 Jun 3, 2026
bfbffd2
refactor: ํด๋ผ์ด์–ธํŠธ ์ธก ์˜ˆ์™ธ log๋ฅผ info ๋ ˆ๋ฒจ๋กœ ๋ณ€๊ฒฝ
wontop02 Jun 3, 2026
b9ff2e1
refactor: sql๋ฌธ ํ…์ŠคํŠธ ๋ธ”๋ก์œผ๋กœ ๋ณ€๊ฒฝ
wontop02 Jun 3, 2026
17e9986
refactor: ๋Œ€๊ธฐ์ž์˜ ์ด๋ฆ„์ด ๊ฐ™์€์ง€ ํŒ๋ณ„ํ•˜๋Š” ๋กœ์ง์„ Wait ๋„๋ฉ”์ธ ๋‚ด๋ถ€๋กœ ์ด๋™
wontop02 Jun 3, 2026
fa9df39
refactor: wait์™€ reservation ์กฐํšŒ ํ˜•์‹ ๋ถ„๋ฆฌ
wontop02 Jun 4, 2026
cdc32fc
test: ๋ฆฌํŒฉํ† ๋ง ํ›„ ๊นจ์ง„ ํ…Œ์ŠคํŠธ ์ˆ˜์ •
wontop02 Jun 4, 2026
7b57113
refactor: ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๋ฉ”์„œ๋“œ ์‚ญ์ œ
wontop02 Jun 4, 2026
b70fdfe
feat: time, theme์„ ์‚ญ์ œํ•  ๋•Œ ํ•ด๋‹น time, theme๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋Œ€๊ธฐ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๊ธฐ๋Šฅ ๊ตฌํ˜„
wontop02 Jun 4, 2026
f56b912
refactor: ๋ฉ”์„œ๋“œ๋ช… ๋ณ€๊ฒฝ
wontop02 Jun 4, 2026
b779053
fix: ๋Œ€๊ธฐ ์ˆœ๋ฒˆ์ด ์ œ๋Œ€๋กœ ๊ณ„์‚ฐ๋˜์ง€ ์•Š๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ
wontop02 Jun 6, 2026
4ebe46b
refactor: Service์˜ request, response๋ฅผ Controller DTO์™€ ํ†ตํ•ฉ
wontop02 Jun 6, 2026
1a62efd
refactor: ์˜ˆ์™ธ ์ฝ”๋“œ๋ฅผ ๋ชจ์•„๋‘์ง€ ์•Š๊ณ , ์ƒํ™ฉ๋ณ„ ์˜ˆ์™ธ๋ฅผ ๋งŒ๋“ค์–ด ์„œ๋ฒ„์šฉ, ํด๋ผ์ด์–ธํŠธ์šฉ ์˜ˆ์™ธ ๋ฉ”์‹œ์ง€ ๋ถ„๋ฆฌ
wontop02 Jun 7, 2026
6fb2a45
refactor: Response List ๋ž˜ํ•‘ํ•ด ๋ฐ˜ํ™˜
wontop02 Jun 7, 2026
cf48a10
refactor: DTO ๊ณ„์ธต ์ œ๊ฑฐ ๋ฐ Slot, Waits ๋„๋ฉ”์ธ ๋„์ž…
wontop02 Jun 8, 2026
4ce482f
docs: ๋ชจ๋“  API ๋ช…์„ธ ์ถ”๊ฐ€
wontop02 Jun 8, 2026
aa54e78
docs: ๋ˆ„๋ฝ๋œ ๊ณตํ†ต ์˜ˆ์™ธ ๋ช…์„ธ ์ถ”๊ฐ€
wontop02 Jun 8, 2026
9412f30
fix: ์ˆœ๋ฒˆ์ด ์ œ๋Œ€๋กœ ๊ณ„์‚ฐ๋˜์ง€ ์•Š๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ
wontop02 Jun 10, 2026
9f9ca45
test: ๋„๋ฉ”์ธ ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€, ์ˆ˜์ •
wontop02 Jun 10, 2026
5d696a3
refactor: ๋ถˆ๋ณ€ ๊ฐ์ฒด์ธ Wait๋ฅผ ๊ทธ๋Œ€๋กœ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ์ˆ˜์ •
wontop02 Jun 10, 2026
7630386
docs: ์‹ค์ œ ์˜ˆ์™ธ ๋ฉ”์‹œ์ง€์™€ ๋™์ผํ•˜๊ฒŒ ์ˆ˜์ •
wontop02 Jun 10, 2026
0a4cfc5
fix: ์ค‘๋ณต ๊ฒ€์ฆ์— slot ์กฐ๊ฑด ์ถ”๊ฐ€
wontop02 Jun 17, 2026
a819a59
refactor: JdbcRepository๋ฅผ JpaRepository๋กœ ๋ณ€๊ฒฝ
wontop02 Jun 17, 2026
556b94c
refactor: ๋ณ€๊ฒฝ๋œ Repository์— ๋”ฐ๋ผ test ์ˆ˜์ •
wontop02 Jun 17, 2026
4c46694
refactor: WaitRepository์˜ ๋ณ€์ˆ˜๋ช…์„ ๋‹ค๋ฅธ Repository์™€ ํ†ต์ผ์„ฑ ์žˆ๊ฒŒ ๋ณ€๊ฒฝ
wontop02 Jun 17, 2026
61e8c58
feat: Member ๋„๋ฉ”์ธ, ์„œ๋น„์Šค, ๊ด€๋ จ API ์ถ”๊ฐ€
wontop02 Jun 18, 2026
f333c11
refactor: MemberResponse ๋„์ž…ํ•ด ์˜ˆ์•ฝ/๋Œ€๊ธฐ ์กฐํšŒํ•  ๋•Œ member Id์™€ name ๋ชจ๋‘ ๊ฐ€์ ธ์˜ค๋„๋ก ์ˆ˜์ •
wontop02 Jun 18, 2026
c661322
refactor: ์˜ˆ์•ฝ ์‚ญ์ œ ๋กœ์ง ์ˆ˜์ • ๋ฐ flush ์ฒ˜๋ฆฌ ๋กœ์ง ์ถ”๊ฐ€
wontop02 Jun 18, 2026
984673f
merge: ์ถฉ๋Œ ํ•ด๊ฒฐ
wontop02 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
93 changes: 85 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@
- ์˜ˆ์•ฝ/๋Œ€๊ธฐ ์ถ”๊ฐ€
- Http Method: POST
- URL: /reservations
- Request
- Request Header: `Member-Id: {memberId}`
- Request Body
```text
{
"name": "fizz",
"date": "2026-05-02",
"timeId": 1,
"themeId": 1
Expand All @@ -211,7 +211,10 @@
```text
{
"id": 1,
"name": "fizz",
"member": {
"id": 1,
"name": "fizz"
},
"date": "2026-05-02",
"time": {
"id": 1,
Expand All @@ -231,7 +234,10 @@
```text
{
"id": 1,
"name": "fizz",
"member": {
"id": 1,
"name": "fizz"
},
"date": "2026-05-02",
"time": {
"id": 1,
Expand Down Expand Up @@ -303,6 +309,65 @@
}
```

- ๋‚ด ์˜ˆ์•ฝ/๋Œ€๊ธฐ ์กฐํšŒ
- Http Method: GET
- URL: /reservations/mine
- Request Header: `Member-Id: {memberId}`
- Response
- [x] ์ •์ƒ์ ์œผ๋กœ ์กฐํšŒ๋œ ๊ฒฝ์šฐ: `Http Status: 200 OK`
```text
{
"reservations": {
"items": [
{
"id": 1,
"member": {
"id": 1,
"name": "์˜ˆ์•ฝ์ž01"
},
"date": "2026-05-01",
"time": {
"id": 1,
"startAt": "10:00:00"
},
"theme": {
"id": 1,
"name": "์žƒ์–ด๋ฒ„๋ฆฐ ์™•๊ตญ",
"description": "์‚ฌ๋ผ์ง„ ๊ณ ๋Œ€ ์™•๊ตญ์˜ ๋น„๋ฐ€์„ ์ถ”์ ํ•˜๋Š” ๋ชจํ—˜ ํ…Œ๋งˆ",
"thumbnailUrl": "https://example.com/images/lost-kingdom.jpg"
},
"status": "CONFIRMED"
}
]
},
"waits": {
"items": [
{
"id": 1,
"member": {
"id": 1,
"name": "์˜ˆ์•ฝ์ž01"
},
"date": "2026-05-02",
"time": {
"id": 2,
"startAt": "11:00:00"
},
"theme": {
"id": 1,
"name": "์žƒ์–ด๋ฒ„๋ฆฐ ์™•๊ตญ",
"description": "์‚ฌ๋ผ์ง„ ๊ณ ๋Œ€ ์™•๊ตญ์˜ ๋น„๋ฐ€์„ ์ถ”์ ํ•˜๋Š” ๋ชจํ—˜ ํ…Œ๋งˆ",
"thumbnailUrl": "https://example.com/images/lost-kingdom.jpg"
},
"status": "WAITING",
"order": 1,
"createdAt": "2026-05-01T09:00:00"
}
]
}
}
```

- ์‚ฌ์šฉ์ž ์ด๋ฆ„์œผ๋กœ ์˜ˆ์•ฝ/๋Œ€๊ธฐ ์กฐํšŒ
- Http Method: GET
- URL: /reservations?name={name}
Expand All @@ -314,7 +379,10 @@
"items": [
{
"id": 1,
"name": "์˜ˆ์•ฝ์ž01",
"member": {
"id": 1,
"name": "์˜ˆ์•ฝ์ž01"
},
"date": "2026-05-01",
"time": {
"id": 1,
Expand All @@ -334,7 +402,10 @@
"items": [
{
"id": 1,
"name": "์˜ˆ์•ฝ์ž01",
"member": {
"id": 1,
"name": "์˜ˆ์•ฝ์ž01"
},
"date": "2026-05-02",
"time": {
"id": 2,
Expand Down Expand Up @@ -366,7 +437,10 @@
"items": [
{
"id": 1,
"name": "์˜ˆ์•ฝ์ž01",
"member": {
"id": 1,
"name": "์˜ˆ์•ฝ์ž01"
},
"date": "2026-05-01",
"time": {
"id": 1,
Expand All @@ -386,7 +460,10 @@
"items": [
{
"id": 1,
"name": "์˜ˆ์•ฝ์ž02",
"member": {
"id": 2,
"name": "์˜ˆ์•ฝ์ž02"
},
"date": "2026-05-02",
"time": {
"id": 2,
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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'
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/roomescape/controller/ReservationController.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -27,13 +28,22 @@ public ReservationController(ReservationFacade reservationFacade) {

@PostMapping
public ResponseEntity<ReservationWaitResponse> save(
@RequestHeader("Member-Id") Long memberId,
@RequestBody ReservationCreateRequest request) {
ReservationWaitResponse response = reservationFacade.save(request);
ReservationWaitResponse response = reservationFacade.save(request, memberId);
return ResponseEntity.
status(HttpStatus.CREATED)
.body(response);
}

@GetMapping("/mine")
public ResponseEntity<ReservationWaitListResponse> findByMemberId(
@RequestHeader("Member-Id") Long memberId
) {
ReservationWaitListResponse response = reservationFacade.findByMemberId(memberId);
return ResponseEntity.ok(response);
}

@GetMapping(params = "name")
public ResponseEntity<ReservationWaitListResponse> findByName(
@RequestParam("name") String name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.LocalDate;
import java.time.LocalDateTime;
import roomescape.domain.Member;
import roomescape.domain.Reservation;
import roomescape.domain.ReservationTime;
import roomescape.domain.Slot;
Expand All @@ -10,28 +11,24 @@
import roomescape.exception.custom.InvalidRequestArgumentException;

public record ReservationCreateRequest(
String name,
LocalDate date,
Long timeId,
Long themeId
) {

public ReservationCreateRequest {
validate(name, date, timeId, themeId);
validate(date, timeId, themeId);
}

public Reservation toReservation(ReservationTime reservationTime, Theme theme) {
return new Reservation(name, new Slot(date, reservationTime, theme));
public Reservation toReservation(Member member, ReservationTime reservationTime, Theme theme) {
return new Reservation(member, new Slot(date, reservationTime, theme));
}

public Wait toWait(LocalDateTime createdAt, ReservationTime reservationTime, Theme theme) {
return new Wait(createdAt, name, new Slot(date, reservationTime, theme));
public Wait toWait(LocalDateTime createdAt, Member member, ReservationTime reservationTime, Theme theme) {
return new Wait(createdAt, member, new Slot(date, reservationTime, theme));
}

private void validate(String name, LocalDate date, Long timeId, Long themeId) {
if (name == null || name.isBlank()) {
throw new InvalidRequestArgumentException("์˜ˆ์•ฝ์ž ์ด๋ฆ„์€ ๋น„์–ด ์žˆ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.");
}
private void validate(LocalDate date, Long timeId, Long themeId) {
if (date == null) {
throw new InvalidRequestArgumentException("์˜ˆ์•ฝ ๋‚ ์งœ๋Š” ๋น„์–ด ์žˆ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package roomescape.controller.dto.response;

import roomescape.domain.Member;

public record MemberResponse(
Long id,
String name
) {
public static MemberResponse from(Member member) {
return new MemberResponse(
member.getId(),
member.getName()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public record ReservationResponse(
Long id,
String name,
MemberResponse member,
LocalDate date,
ReservationTimeResponse time,
ThemeResponse theme,
Expand All @@ -16,7 +16,7 @@ public record ReservationResponse(
public static ReservationResponse from(Reservation reservation) {
return new ReservationResponse(
reservation.getId(),
reservation.getName(),
MemberResponse.from(reservation.getMember()),
reservation.getDate(),
ReservationTimeResponse.from(reservation.getTime()),
ThemeResponse.from(reservation.getTheme()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public record WaitResponse(
Long id,
String name,
MemberResponse member,
LocalDate date,
ReservationTimeResponse time,
ThemeResponse theme,
Expand All @@ -19,7 +19,7 @@ public record WaitResponse(
public static WaitResponse of(Wait wait, Long order) {
return new WaitResponse(
wait.getId(),
wait.getName(),
MemberResponse.from(wait.getMember()),
wait.getReservationDate(),
ReservationTimeResponse.from(wait.getTime()),
ThemeResponse.from(wait.getTheme()),
Expand Down
59 changes: 59 additions & 0 deletions src/main/java/roomescape/domain/Member.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package roomescape.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import java.util.Objects;
import roomescape.exception.custom.InvalidDomainValueException;

@Entity
public class Member {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String name;

public Member() {
}

public Member(Long id, String name) {
validate(name);
this.id = id;
this.name = name;
}

public Member(String name) {
this(null, name);
}

private void validate(String name) {
if (name == null || name.isBlank()) {
throw new InvalidDomainValueException("ํšŒ์› ์ด๋ฆ„์€ ๋น„์–ด ์žˆ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.");
}
}

public Long getId() {
return id;
}

public String getName() {
return name;
}

@Override
public boolean equals(Object object) {
if (object == null || getClass() != object.getClass()) {
return false;
}
Member member = (Member) object;
return Objects.equals(id, member.id);
}

@Override
public int hashCode() {
return Objects.hashCode(id);
}
}
Loading