Skip to content

Commit

Permalink
[REMOVE] 주석 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
ssjy4974 committed Jan 26, 2024
1 parent dc76998 commit 38dbb54
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public Mono<Void> subscribeStartTrigger() {
.flatMap(payload -> objectStringConverter.stringToObject(payload, ChatPayload.class))
.flatMap(
chatPayload -> {
log.info("여기 startjob 쪽임");
Object data = chatPayload.getData();
scheduler.startJob((String) data);
return chatWebSocketHandler.sendMessage(
chatPayload); // send message and return its Mono
return chatWebSocketHandler
.sendMessage(chatPayload)
.then(); // send message and return its Mono
})
.then();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ public Mono<Long> publishChatMessage(String message) {
result -> {
try {
ChatPayload chatPayload = objectMapper.readValue(result, ChatPayload.class);
log.info("여기 push쪽 command : {}", chatPayload.getCommand());
if (chatPayload.getCommand().equals(ChatCommand.START)) {
log.info("들어옴");
return reactiveStringRedisTemplate
.convertAndSend(START_TOPIC, result)
.doOnSuccess(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public void scheduleJob(LocalDateTime startTime, String auctionId)
}

public void startJob(String auctionId) {
log.info("startJob : {}", auctionId);
countdown = 3 * 60 * 1000;
if (this.jobDisposable == null || this.jobDisposable.isDisposed()) {
this.jobDisposable =
Expand Down Expand Up @@ -116,7 +115,6 @@ private void updateCountdown() {
}

private Mono<Void> sendCloseCommand(String auctionId) {
log.info("여기나오면안됌 여기는 끝날때만 나오는거야");
ChatPayload<Object> payload = ChatPayload.of(ChatCommand.AUCTION_CLOSE, null);
return auctionService
.endAuction(auctionId)
Expand All @@ -126,7 +124,6 @@ private Mono<Void> sendCloseCommand(String auctionId) {

private Mono<Void> sendTimeSyncCommand() {
ChatPayload<Object> payload = ChatPayload.of(ChatCommand.TIME_SYNC, countdown);
log.info("sync payload {}", payload);
return chatHandler.broadCast(payload).then();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public Mono<Void> start(
}

// 경매 종료
// @PatchMapping("/bids/end/{auctionId}")
// public Mono<Void> end(
// @RequestHeader(name = "role") String role,
// @PathVariable String auctionId
// ) {
// return bidFacade.end(auctionId);
// }
@PatchMapping("/bids/end/{auctionId}")
public Mono<Void> end(
@RequestHeader(name = "role") String role,
@PathVariable String auctionId
) {
return bidFacade.end(auctionId);
}
}
20 changes: 9 additions & 11 deletions src/main/java/com/dailyon/auctionservice/facade/BidFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@ public Mono<Void> start(String auctionId) {
.then();
}

// public Mono<Void> end(String auctionId) {
// log.info("이것도 나오면안댐");
// return auctionService
// .endAuction(auctionId)
// .flatMap(
// auction -> {
// ChatPayload<Object> payload = ChatPayload.of(ChatCommand.AUCTION_CLOSE,
// auctionId);
// return chatHandler.broadCast(payload).then();
// });
// }
public Mono<Void> end(String auctionId) {
return auctionService
.endAuction(auctionId)
.flatMap(
auction -> {
ChatPayload<Object> payload = ChatPayload.of(ChatCommand.AUCTION_CLOSE, auctionId);
return chatHandler.broadCast(payload).then();
});
}
}

0 comments on commit 38dbb54

Please sign in to comment.