Skip to content

Commit

Permalink
feat: 네고 가능 여부 조회 API controller 메서드 추가
Browse files Browse the repository at this point in the history
- 네고 가능 여부 조회 API controller 메서드 추가
  • Loading branch information
dldmldlsy committed Jan 18, 2024
1 parent 6dc46c8 commit 79321fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import org.testcontainers.shaded.org.checkerframework.checker.units.qual.C;
import site.goldenticket.common.response.CommonResponse;
import site.goldenticket.domain.nego.dto.request.PriceProposeRequest;
import site.goldenticket.domain.nego.dto.response.HandoverResponse;
import site.goldenticket.domain.nego.dto.response.NegoAvailableResponse;
import site.goldenticket.domain.nego.dto.response.NegoResponse;
import site.goldenticket.domain.nego.dto.response.PayResponse;
import site.goldenticket.domain.nego.dto.response.PriceProposeResponse;
Expand Down Expand Up @@ -63,4 +63,11 @@ public ResponseEntity<CommonResponse<NegoResponse>> denyhandoverProduct(@PathVar
return ResponseEntity.ok(CommonResponse.ok("양도가 거절되었습니다", response));
}

@GetMapping("/available")
public ResponseEntity<CommonResponse<NegoAvailableResponse>> getNegoAvailable(
@RequestParam(name = "productId") Long productId,
@AuthenticationPrincipal PrincipalDetails principalDetails) {
return ResponseEntity.ok(CommonResponse.ok("네고 가능 여부가 조회되었습니다",
negoService.isAvailableNego(principalDetails.getUserId(), productId)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ public NegoAvailableResponse isAvailableNego(Long userId, Long productId) {
ChatRoom chatRoom = chatService.createChatRoom(userId, productId);
negoAvailable = true;
chatRoomId = chatRoom.getId();
System.out.println(chatRoomId);
}
} else {
//네고 이력 있는 경우 : 2차 네고(거절 혹은 승인) OR 재결제 -> 네고 불가
Expand Down

0 comments on commit 79321fd

Please sign in to comment.