-
Notifications
You must be signed in to change notification settings - Fork 0
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
[1 - 3단계 방탈출 사용자 예약] 재즈(함석명) 미션 제출합니다. #4
base: seokmyungham
Are you sure you want to change the base?
Changes from 46 commits
e9839c2
da08d06
035c771
084c8a8
ddbd79f
fe2d58d
39d5385
ef02237
05bf12d
1c8ca4d
f6ddf1c
d3fea55
0915bd4
1c9957e
af3fa40
ea5a8a6
f65e2a6
b7561fa
cb936aa
bddf8c0
ffe91f3
d9cb606
68562ec
03b2a6d
855c386
9acebf3
950583f
6a45b7d
79c3649
befb697
df1d0d5
74f87ee
3d9a043
d1937cc
e81ab58
5cf59c2
b7af5a2
ff15845
671017c
d4201ba
ea1d1fa
ea4db56
1b981df
509b904
19ae311
c18a929
5a93fc4
2303839
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package roomescape.controller; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
|
||
@Controller | ||
public class HomeController { | ||
|
||
@GetMapping("/") | ||
public String getIndexPage() { | ||
return "index"; | ||
} | ||
} | ||
Comment on lines
+6
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 시간이 없어 미처 변경하지 못했는데 지금은 UserController로 옮겼어 👍 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package roomescape.controller; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequestMapping("/reservation") | ||
public class ReservationController { | ||
|
||
@GetMapping | ||
public String getReservationPage() { | ||
return "reservation"; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package roomescape.controller; | ||
|
||
import java.util.List; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
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.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import roomescape.service.ReservationTimeService; | ||
import roomescape.service.dto.AvailabilityOfTimeRequestDto; | ||
import roomescape.service.dto.ReservationTimeRequestDto; | ||
import roomescape.service.dto.ReservationTimeResponseDto; | ||
|
||
|
@@ -27,11 +31,19 @@ public List<ReservationTimeResponseDto> findReservationTimes() { | |
return reservationTimeService.findAllReservationTimes(); | ||
} | ||
|
||
@GetMapping("/availability") | ||
public List<ReservationTimeResponseDto> findReservationTimesAvailability(@RequestParam String date, | ||
@RequestParam Long themeId) { | ||
return reservationTimeService.findReservationTimesAvailability(new AvailabilityOfTimeRequestDto(date, themeId)); | ||
} | ||
Comment on lines
+34
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. api 엔드포인트를 어떤 크루는 나는 이쪽이 훨씬 합리적인 것 같더라 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 나도 잘 모르는데.. ㅎㅎ REST 규칙 안에서 가져오려고 하는 대상이 무엇인지만 명확하게 알 수 있다면 뭐든 괜찮은 것 같아 |
||
|
||
@ResponseStatus(HttpStatus.CREATED) | ||
@PostMapping | ||
public ReservationTimeResponseDto createReservationTime(@RequestBody ReservationTimeRequestDto requestDto) { | ||
return reservationTimeService.createReservationTime(requestDto); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.NO_CONTENT) | ||
@DeleteMapping("/{id}") | ||
public void deleteReservationTime(@PathVariable long id) { | ||
reservationTimeService.deleteReservationTime(id); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package roomescape.controller; | ||
|
||
import java.util.List; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
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.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import roomescape.service.ThemeService; | ||
import roomescape.service.dto.ThemeRequestDto; | ||
import roomescape.service.dto.ThemeResponseDto; | ||
|
||
@RestController | ||
@RequestMapping("/themes") | ||
public class ThemeApiController { | ||
|
||
private final ThemeService themeService; | ||
|
||
public ThemeApiController(ThemeService themeService) { | ||
this.themeService = themeService; | ||
} | ||
|
||
@GetMapping | ||
public List<ThemeResponseDto> findAllThemes() { | ||
return themeService.findAllThemes(); | ||
} | ||
|
||
@GetMapping("/rank") | ||
public List<ThemeResponseDto> findTopBookedThemes() { | ||
return themeService.findTopBookedThemes(); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.CREATED) | ||
@PostMapping | ||
public ThemeResponseDto createTheme(@RequestBody ThemeRequestDto requestDto) { | ||
return themeService.createTheme(requestDto); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.NO_CONTENT) | ||
@DeleteMapping("/{id}") | ||
public void deleteTheme(@PathVariable long id) { | ||
themeService.deleteTheme(id); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API 명세서 너무 깔끔하게 정리했는데? 👍 👍 👍