Skip to content

Commit

Permalink
[NO-JIRA] mixpanel remove (#198)
Browse files Browse the repository at this point in the history
* refactor : mixpanel 제거

* refactor : 커넥션 풀 50개
  • Loading branch information
wjdwnsdnjs13 authored Sep 14, 2024
1 parent 6b3d730 commit 329c88b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
import org.depromeet.spot.application.review.dto.response.BaseReviewResponse;
import org.depromeet.spot.usecase.port.in.review.CreateReviewUsecase;
import org.depromeet.spot.usecase.port.in.review.CreateReviewUsecase.CreateReviewResult;
import org.depromeet.spot.usecase.service.event.MixpanelEvent;
import org.depromeet.spot.usecase.service.event.MixpanelEvent.MixpanelEventName;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
Expand All @@ -39,7 +36,7 @@
@RequestMapping("/api/v1")
public class CreateReviewController {

private final ApplicationEventPublisher applicationEventPublisher;
// private final ApplicationEventPublisher applicationEventPublisher;

private final CreateReviewUsecase createReviewUsecase;

Expand All @@ -55,9 +52,10 @@ public BaseReviewResponse create(
CreateReviewResult result =
createReviewUsecase.create(blockId, memberId, request.toCommand());

// 믹스패널 이벤트(후기 등록 완료) 호출
applicationEventPublisher.publishEvent(
new MixpanelEvent(MixpanelEventName.REVIEW_REGISTER, String.valueOf(memberId)));
// // 믹스패널 이벤트(후기 등록 완료) 호출
// applicationEventPublisher.publishEvent(
// new MixpanelEvent(MixpanelEventName.REVIEW_REGISTER,
// String.valueOf(memberId)));

return BaseReviewResponse.from(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
import org.depromeet.spot.usecase.port.in.review.ReadReviewUsecase.MyRecentReviewResult;
import org.depromeet.spot.usecase.port.in.review.ReadReviewUsecase.MyReviewListResult;
import org.depromeet.spot.usecase.port.in.review.ReadReviewUsecase.ReadReviewResult;
import org.depromeet.spot.usecase.service.event.MixpanelEvent;
import org.depromeet.spot.usecase.service.event.MixpanelEvent.MixpanelEventName;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

Expand All @@ -39,7 +36,7 @@
@RequestMapping("/api/v1")
public class ReadReviewController {

private final ApplicationEventPublisher applicationEventPublisher;
// private final ApplicationEventPublisher applicationEventPublisher;

private final ReadReviewUsecase readReviewUsecase;

Expand Down Expand Up @@ -138,9 +135,10 @@ public BaseReviewResponse findReviewByReviewId(
Long reviewId) {
ReadReviewResult readReviewResult = readReviewUsecase.findReviewById(reviewId, memberId);

// 믹스패널 이벤트(조회수) 발생
applicationEventPublisher.publishEvent(
new MixpanelEvent(MixpanelEventName.REVIEW_OPEN_COUNT, String.valueOf(memberId)));
// // 믹스패널 이벤트(조회수) 발생
// applicationEventPublisher.publishEvent(
// new MixpanelEvent(MixpanelEventName.REVIEW_OPEN_COUNT,
// String.valueOf(memberId)));

return BaseReviewResponse.from(readReviewResult.review());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

import org.depromeet.spot.application.common.annotation.CurrentMember;
import org.depromeet.spot.usecase.port.in.review.like.ReviewLikeUsecase;
import org.depromeet.spot.usecase.service.event.MixpanelEvent;
import org.depromeet.spot.usecase.service.event.MixpanelEvent.MixpanelEventName;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
Expand All @@ -26,7 +23,7 @@
@RequestMapping("/api/v1/reviews")
public class ReviewLikeController {

private final ApplicationEventPublisher applicationEventPublisher;
// private final ApplicationEventPublisher applicationEventPublisher;

private final ReviewLikeUsecase reviewLikeUsecase;

Expand All @@ -38,11 +35,12 @@ public void toggleLike(
@PathVariable @Positive @NotNull final Long reviewId,
@Parameter(hidden = true) Long memberId) {
boolean result = reviewLikeUsecase.toggleLike(memberId, reviewId);
if (result) {
// 리뷰 공감 추이 이벤트 발생
applicationEventPublisher.publishEvent(
new MixpanelEvent(
MixpanelEventName.REVIEW_LIKE_COUNT, String.valueOf(memberId)));
}
// if (result) {
// // 리뷰 공감 추이 이벤트 발생
// applicationEventPublisher.publishEvent(
// new MixpanelEvent(
// MixpanelEventName.REVIEW_LIKE_COUNT,
// String.valueOf(memberId)));
// }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import org.depromeet.spot.application.review.dto.response.scrap.MyScrapListResponse;
import org.depromeet.spot.usecase.port.in.review.scrap.ReviewScrapUsecase;
import org.depromeet.spot.usecase.port.in.review.scrap.ReviewScrapUsecase.MyScrapListResult;
import org.depromeet.spot.usecase.service.event.MixpanelEvent;
import org.depromeet.spot.usecase.service.event.MixpanelEvent.MixpanelEventName;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -32,7 +29,7 @@
@RequestMapping("/api/v1/reviews")
public class ReviewScrapController {

private final ApplicationEventPublisher applicationEventPublisher;
// private final ApplicationEventPublisher applicationEventPublisher;

private final ReviewScrapUsecase reviewScrapUsecase;

Expand All @@ -45,9 +42,10 @@ public boolean toggleScrap(
@Parameter(hidden = true) Long memberId) {
boolean result = reviewScrapUsecase.toggleScrap(memberId, reviewId);

// 믹스패널 이벤트(스크랩 수) 발생
applicationEventPublisher.publishEvent(
new MixpanelEvent(MixpanelEventName.REVIEW_SCRAP_COUNT, String.valueOf(memberId)));
// // 믹스패널 이벤트(스크랩 수) 발생
// applicationEventPublisher.publishEvent(
// new MixpanelEvent(MixpanelEventName.REVIEW_SCRAP_COUNT,
// String.valueOf(memberId)));

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/src/main/resources/application-jpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring:
password: ${DB_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
maximum-pool-size: 300
maximum-pool-size: 50

jpa:
database: mysql
Expand Down

0 comments on commit 329c88b

Please sign in to comment.