Skip to content

Commit

Permalink
refactor: 미션 생성 이벤트 네이밍 변경 (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
songyi00 authored Aug 5, 2024
1 parent 4af2366 commit dcb86dd
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.nexters.goalpanzi.application.mission.dto.request.CreateMissionCommand;
import com.nexters.goalpanzi.application.mission.dto.response.MissionDetailResponse;
import com.nexters.goalpanzi.application.mission.event.DeleteMissionEvent;
import com.nexters.goalpanzi.application.mission.event.JoinMissionEvent;
import com.nexters.goalpanzi.application.mission.event.CreateMissionEvent;
import com.nexters.goalpanzi.domain.mission.InvitationCode;
import com.nexters.goalpanzi.domain.mission.Mission;
import com.nexters.goalpanzi.domain.mission.repository.MissionRepository;
Expand Down Expand Up @@ -36,8 +36,10 @@ public MissionDetailResponse createMission(final CreateMissionCommand command) {
generateInvitationCode()
)
);
eventPublisher.publishEvent(
new JoinMissionEvent(mission.getHostMemberId(), mission.getInvitationCode().getCode()));
eventPublisher.publishEvent(new CreateMissionEvent(
mission.getHostMemberId(),
mission.getInvitationCode().getCode())
);

return MissionDetailResponse.from(mission);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.nexters.goalpanzi.application.mission.dto.request.MissionVerificationQuery;
import com.nexters.goalpanzi.application.mission.dto.request.MyMissionVerificationQuery;
import com.nexters.goalpanzi.application.mission.dto.response.MissionVerificationResponse;
import com.nexters.goalpanzi.application.ncp.ObjectStorageClient;
import com.nexters.goalpanzi.application.upload.ObjectStorageClient;
import com.nexters.goalpanzi.domain.common.BaseEntity;
import com.nexters.goalpanzi.domain.member.Member;
import com.nexters.goalpanzi.domain.member.repository.MemberRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.nexters.goalpanzi.application.mission.event;

public record JoinMissionEvent(
public record CreateMissionEvent(
Long memberId,
String invitationCode
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.nexters.goalpanzi.application.mission.MissionMemberService;
import com.nexters.goalpanzi.application.mission.MissionVerificationService;
import com.nexters.goalpanzi.application.mission.event.DeleteMissionEvent;
import com.nexters.goalpanzi.application.mission.event.JoinMissionEvent;
import com.nexters.goalpanzi.application.mission.event.CreateMissionEvent;
import com.nexters.goalpanzi.domain.mission.InvitationCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -23,7 +23,7 @@ public class MissionMemberEventHandler {
private final MissionVerificationService missionVerificationService;

@TransactionalEventListener(phase = TransactionPhase.BEFORE_COMMIT)
void handleJoinMissionEvent(final JoinMissionEvent event) {
void handleCreateMissionEvent(final CreateMissionEvent event) {
missionMemberService.joinMission(event.memberId(), new InvitationCode(event.invitationCode()));
log.info("Handled JoinMissionEvent for memberId: {}", event.memberId());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.nexters.goalpanzi.application.ncp;
package com.nexters.goalpanzi.application.upload;

import org.springframework.stereotype.Repository;
import org.springframework.web.multipart.MultipartFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.amazonaws.services.s3.transfer.TransferManager;
import com.amazonaws.services.s3.transfer.TransferManagerBuilder;
import com.amazonaws.services.s3.transfer.Upload;
import com.nexters.goalpanzi.application.ncp.ObjectStorageClient;
import com.nexters.goalpanzi.application.upload.ObjectStorageClient;
import com.nexters.goalpanzi.exception.BadRequestException;
import com.nexters.goalpanzi.exception.BaseException;
import jakarta.annotation.PostConstruct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.nexters.goalpanzi.application.auth.dto.response.LoginResponse;
import com.nexters.goalpanzi.application.mission.dto.response.MissionDetailResponse;
import com.nexters.goalpanzi.application.mission.dto.response.MissionVerificationResponse;
import com.nexters.goalpanzi.application.ncp.ObjectStorageClient;
import com.nexters.goalpanzi.application.upload.ObjectStorageClient;
import com.nexters.goalpanzi.domain.mission.DayOfWeek;
import com.nexters.goalpanzi.domain.mission.TimeOfDay;
import com.nexters.goalpanzi.exception.ErrorCode;
Expand Down

0 comments on commit dcb86dd

Please sign in to comment.