diff --git a/src/docs/asciidoc/api/waiting/waiting.adoc b/src/docs/asciidoc/api/waiting/waiting.adoc index 4f5a51b3..96fc4403 100644 --- a/src/docs/asciidoc/api/waiting/waiting.adoc +++ b/src/docs/asciidoc/api/waiting/waiting.adoc @@ -55,7 +55,6 @@ include::{snippets}/member-waiting-controller-docs-test/cancel-waiting/http-requ include::{snippets}/member-waiting-controller-docs-test/cancel-waiting/http-response.adoc[] include::{snippets}/member-waiting-controller-docs-test/cancel-waiting/response-fields.adoc[] - === 웨이팅 입장 API ==== HTTP Request diff --git a/src/main/java/com/prgrms/catchtable/jwt/service/RefreshTokenService.java b/src/main/java/com/prgrms/catchtable/jwt/service/RefreshTokenService.java index 212a8460..684c4c8e 100644 --- a/src/main/java/com/prgrms/catchtable/jwt/service/RefreshTokenService.java +++ b/src/main/java/com/prgrms/catchtable/jwt/service/RefreshTokenService.java @@ -42,7 +42,7 @@ public RefreshToken getRefreshTokenByToken(String refreshToken) { } @Transactional - public void deleteRefreshToken(String email){ + public void deleteRefreshToken(String email) { refreshTokenRepository.deleteRefreshTokenByEmail(email); } } diff --git a/src/main/java/com/prgrms/catchtable/member/controller/MemberController.java b/src/main/java/com/prgrms/catchtable/member/controller/MemberController.java index 06230af7..49913c27 100644 --- a/src/main/java/com/prgrms/catchtable/member/controller/MemberController.java +++ b/src/main/java/com/prgrms/catchtable/member/controller/MemberController.java @@ -21,14 +21,14 @@ public class MemberController { private final MemberService memberService; @GetMapping("/login/kakao") - public ResponseEntity loginRedirect(){ + public ResponseEntity loginRedirect() { HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.setLocation(URI.create("/oauth2/authorization/kakao")); return new ResponseEntity<>(httpHeaders, HttpStatus.MOVED_PERMANENTLY); } @PostMapping("/logout") - public ResponseEntity logout(@LogIn Member member){ + public ResponseEntity logout(@LogIn Member member) { memberService.logout(member.getEmail()); return ResponseEntity.ok("logout"); } diff --git a/src/main/java/com/prgrms/catchtable/member/service/MemberService.java b/src/main/java/com/prgrms/catchtable/member/service/MemberService.java index 9af6d339..02df275e 100644 --- a/src/main/java/com/prgrms/catchtable/member/service/MemberService.java +++ b/src/main/java/com/prgrms/catchtable/member/service/MemberService.java @@ -35,7 +35,7 @@ public Token oauthLogin(OAuthAttribute attributes) { } @Transactional - public void logout(String email){ + public void logout(String email) { refreshTokenService.deleteRefreshToken(email); } diff --git a/src/main/java/com/prgrms/catchtable/owner/controller/OwnerController.java b/src/main/java/com/prgrms/catchtable/owner/controller/OwnerController.java index 5cafb006..8642995d 100644 --- a/src/main/java/com/prgrms/catchtable/owner/controller/OwnerController.java +++ b/src/main/java/com/prgrms/catchtable/owner/controller/OwnerController.java @@ -39,7 +39,7 @@ public ResponseEntity login(@Valid @RequestBody LoginOwnerRequest loginOw } @PostMapping("/logout") - public ResponseEntity logout(@LogIn Owner owner){ + public ResponseEntity logout(@LogIn Owner owner) { ownerService.logout(owner.getEmail()); return ResponseEntity.ok("logout"); } diff --git a/src/main/java/com/prgrms/catchtable/owner/service/OwnerService.java b/src/main/java/com/prgrms/catchtable/owner/service/OwnerService.java index 425dd3b9..b506d02b 100644 --- a/src/main/java/com/prgrms/catchtable/owner/service/OwnerService.java +++ b/src/main/java/com/prgrms/catchtable/owner/service/OwnerService.java @@ -66,7 +66,7 @@ public Token loginOwner(LoginOwnerRequest loginRequest) { } @Transactional - public void logout(String email){ + public void logout(String email) { refreshTokenService.deleteRefreshToken(email); } diff --git a/src/main/java/com/prgrms/catchtable/shop/domain/Shop.java b/src/main/java/com/prgrms/catchtable/shop/domain/Shop.java index 19686be4..45edf862 100644 --- a/src/main/java/com/prgrms/catchtable/shop/domain/Shop.java +++ b/src/main/java/com/prgrms/catchtable/shop/domain/Shop.java @@ -70,7 +70,7 @@ public Shop(String name, BigDecimal rating, Category category, Address address, public int findWaitingNumber() { return ++waitingCount; } - + public void updateMenuList(List menuList) { this.menuList.addAll(menuList); this.menuList.forEach(menu -> menu.insertShop(this)); diff --git a/src/test/java/com/prgrms/catchtable/reservation/controller/MemberReservationControllerTest.java b/src/test/java/com/prgrms/catchtable/reservation/controller/MemberReservationControllerTest.java index 88ea0402..bc4f7134 100644 --- a/src/test/java/com/prgrms/catchtable/reservation/controller/MemberReservationControllerTest.java +++ b/src/test/java/com/prgrms/catchtable/reservation/controller/MemberReservationControllerTest.java @@ -172,7 +172,8 @@ void modifyReservation() throws Exception { ReservationTime reservationTime = reservationTimeRepository.findAll().get(0); Member member1 = memberRepository.findAll().get(0); reservationTime.setOccupiedTrue(); - Reservation reservation = ReservationFixture.getReservationWithMember(reservationTime, member1); + Reservation reservation = ReservationFixture.getReservationWithMember(reservationTime, + member1); Reservation savedReservation = reservationRepository.save(reservation); /** * 수정하려는 예약시간 예제 데이터 생성 @@ -206,7 +207,8 @@ void modifyReservation() throws Exception { void cancelReservation() throws Exception { ReservationTime reservationTime = reservationTimeRepository.findAll().get(0); Member member1 = memberRepository.findAll().get(0); - Reservation reservation = ReservationFixture.getReservationWithMember(reservationTime, member1); + Reservation reservation = ReservationFixture.getReservationWithMember(reservationTime, + member1); Reservation savedReservation = reservationRepository.save(reservation); mockMvc.perform(delete("/reservations/{reservationId}", savedReservation.getId()) diff --git a/src/test/java/com/prgrms/catchtable/reservation/controller/OwnerReservationControllerTest.java b/src/test/java/com/prgrms/catchtable/reservation/controller/OwnerReservationControllerTest.java index 20efc437..443b66ed 100644 --- a/src/test/java/com/prgrms/catchtable/reservation/controller/OwnerReservationControllerTest.java +++ b/src/test/java/com/prgrms/catchtable/reservation/controller/OwnerReservationControllerTest.java @@ -62,7 +62,7 @@ void setUp() { Member member = MemberFixture.member("qwe@naver.com"); Member savedMember = memberRepository.save(member); Reservation reservation = reservationRepository.save( - ReservationFixture.getReservationWithMember(savedReservationTime,savedMember)); + ReservationFixture.getReservationWithMember(savedReservationTime, savedMember)); ReservationTime reservationTime2 = ReservationFixture.getAnotherReservationTimeNotPreOccupied(); reservationTime2.insertShop(shop); diff --git a/src/test/java/com/prgrms/catchtable/reservation/fixture/ReservationFixture.java b/src/test/java/com/prgrms/catchtable/reservation/fixture/ReservationFixture.java index d7c49f9d..fa83e2e0 100644 --- a/src/test/java/com/prgrms/catchtable/reservation/fixture/ReservationFixture.java +++ b/src/test/java/com/prgrms/catchtable/reservation/fixture/ReservationFixture.java @@ -3,7 +3,6 @@ import static com.prgrms.catchtable.reservation.domain.ReservationStatus.COMPLETED; import com.prgrms.catchtable.common.data.shop.ShopData; -import com.prgrms.catchtable.member.MemberFixture; import com.prgrms.catchtable.member.domain.Member; import com.prgrms.catchtable.reservation.domain.Reservation; import com.prgrms.catchtable.reservation.domain.ReservationStatus; @@ -109,7 +108,8 @@ public static Reservation getReservation(ReservationTime reservationTime, Member .build(); } - public static Reservation getReservationWithMember(ReservationTime reservationTime, Member member) { + public static Reservation getReservationWithMember(ReservationTime reservationTime, + Member member) { if (!reservationTime.isOccupied()) { reservationTime.setOccupiedTrue(); } diff --git a/src/test/java/com/prgrms/catchtable/reservation/repository/ReservationRepositoryTest.java b/src/test/java/com/prgrms/catchtable/reservation/repository/ReservationRepositoryTest.java index 2e56cbf0..d3809539 100644 --- a/src/test/java/com/prgrms/catchtable/reservation/repository/ReservationRepositoryTest.java +++ b/src/test/java/com/prgrms/catchtable/reservation/repository/ReservationRepositoryTest.java @@ -73,7 +73,8 @@ void findByIdWithReservationTimeAndShop() { Member member = MemberFixture.member("dlswns661035@gmail.com"); Member savedMember = memberRepository.save(member); - Reservation reservation = ReservationFixture.getReservationWithMember(savedReservationTime, savedMember); + Reservation reservation = ReservationFixture.getReservationWithMember(savedReservationTime, + savedMember); Reservation savedReservation = reservationRepository.save(reservation); Reservation findReservation = reservationRepository.findByIdWithReservationTimeAndShop( diff --git a/src/test/java/com/prgrms/catchtable/reservation/service/MemberReservationServiceTest.java b/src/test/java/com/prgrms/catchtable/reservation/service/MemberReservationServiceTest.java index 6fd4b429..77921a37 100644 --- a/src/test/java/com/prgrms/catchtable/reservation/service/MemberReservationServiceTest.java +++ b/src/test/java/com/prgrms/catchtable/reservation/service/MemberReservationServiceTest.java @@ -204,7 +204,8 @@ void modifyReservation() { ReservationTime modifyTime = ReservationFixture.getAnotherReservationTimeNotPreOccupied(); ReflectionTestUtils.setField(modifyTime, "id", 2L); //수정하려는 예약시간 객체 -> Id : 2 - Reservation reservation = ReservationFixture.getReservationWithMember(reservationTime, MemberFixture.member("dlsw@gamil.com")); + Reservation reservation = ReservationFixture.getReservationWithMember(reservationTime, + MemberFixture.member("dlsw@gamil.com")); ModifyReservationRequest request = ReservationFixture.getModifyReservationRequest( 2L);