Skip to content

Commit

Permalink
chore: add event log
Browse files Browse the repository at this point in the history
  • Loading branch information
chominho96 committed Apr 21, 2024
1 parent 98b5bd9 commit ab37f2d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ public List<SectorRatioResponse> analyzeSectorRatio(final UUID portfolioId) {
.map(ps -> new StockShare(getStock(ps.getStockId()), ps.getShares()))
.toList();
Map<Sector, SectorInfo> sectorInfoMap = sectorAnalysisService.calculateSectorRatios(stockShares);

log.info(String.format("publish read portfolio event [%s]", portfolioId));

return SectorRatioResponse.fromMap(sectorInfoMap);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public ResponseEntity<YearlyDividendResponse> getYearlyDividends(@PathVariable("
@GetMapping("/{id}/sector-ratio")
public ResponseEntity<List<SectorRatioResponse>> getSectorRatios(@PathVariable("id") final UUID portfolioId) {
List<SectorRatioResponse> result = portfolioQueryService.analyzeSectorRatio(portfolioId);
log.info(String.format("publish read portfolio event [%s]", portfolioId));
applicationEventPublisher.publishEvent(new ReadPortfolioEvent(portfolioId));
return ResponseEntity.ok(result);
}
Expand Down

0 comments on commit ab37f2d

Please sign in to comment.