Skip to content

Commit

Permalink
Merge pull request #48 from EcoMarket-CUK/feature/#47
Browse files Browse the repository at this point in the history
[feature/#47] 테스트용 로그인 컨트롤러 추가, 이전 입찰자에게 message 전송 안되는 부분 수정
  • Loading branch information
veronees authored Nov 11, 2024
2 parents ed8334c + 3a0b6ca commit d5b8314
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

import com.api.jaebichuri.auth.dto.LoginSuccessDto;
import com.api.jaebichuri.auth.dto.TokenResponseDto;
import com.api.jaebichuri.auth.jwt.JwtUtil;
import com.api.jaebichuri.auth.service.AuthService;
import com.api.jaebichuri.global.response.ApiResponse;
import com.api.jaebichuri.member.entity.Member;
import com.api.jaebichuri.member.service.MemberService;
import com.fasterxml.jackson.core.JsonProcessingException;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
Expand Down Expand Up @@ -72,4 +71,13 @@ public ResponseEntity<ApiResponse<String>> logout(@AuthenticationPrincipal Membe
authService.deleteRefreshToken(member);
return ResponseEntity.ok(ApiResponse.onSuccess("로그아웃 성공"));
}


private final JwtUtil jwtUtil;
@Deprecated
@GetMapping("/test/login")
public ResponseEntity<ApiResponse<String>> getTestAccessToken(@RequestParam String clientId) {
String token = jwtUtil.generateAccessToken(clientId);
return ResponseEntity.ok(ApiResponse.onSuccess(token));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public AuctionBidSocketResponse saveAuctionBid(Member member, Long auctionId,
// 입찰 가능한지 조건 검증
validateAuctionBid(member, topAuctionBid, requestBidPrice);

return handleNewAuctionBid(member, auction, requestBidPrice);
return handleNewAuctionBid(member, auction, requestBidPrice, topAuctionBid);
}

private List<BidDatePriceResponse> getBidDatePriceResponseList(Auction auction) {
Expand Down Expand Up @@ -159,7 +159,7 @@ private void validateAuctionBid(Member member, AuctionBid topAuctionBid, Long re
}

private AuctionBidSocketResponse handleNewAuctionBid(Member member, Auction auction,
Long requestBidPrice) {
Long requestBidPrice, AuctionBid previousTopAuctionBid) {
boolean isNotNewBidder = auctionBidRepository.existsByBidderAndAuction(member, auction);

AuctionBid auctionBid = saveAuctionBid(member, auction, requestBidPrice);
Expand All @@ -178,7 +178,7 @@ private AuctionBidSocketResponse handleNewAuctionBid(Member member, Auction auct
getTodayFormat(), requestBidPrice);

return auctionBidMapper.toSocketResponse(requestBidPrice, responseCanBidPrice,
auctionBid.getBidder().getId(), member.getId(), auction.getId(), numOfParticipants,
previousTopAuctionBid.getBidder().getId(), member.getId(), auction.getId(), numOfParticipants,
bidVolumeResponse, bidDatePriceResponse);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws
, "/v2/swagger-config"
, "/swagger-resources/**")
.permitAll()
.requestMatchers("/test/login").permitAll()
.requestMatchers("/oauth2/kakao/**").permitAll()
.requestMatchers("/ws").permitAll()
.requestMatchers("/auctions/**", "/products/**").permitAll()
Expand Down

0 comments on commit d5b8314

Please sign in to comment.