Skip to content

Commit

Permalink
feat : 회원 가입 이벤트 핸들러 구현 (Fastcampus-Final-Team3#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpdmstjs committed Nov 7, 2023
1 parent 5fcbfb6 commit 266ef8f
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.javajober.member.event;

import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import com.javajober.space.service.SpaceService;

@Component
public class MemberSignupEventHandler {

private final SpaceService spaceService;

public MemberSignupEventHandler(final SpaceService spaceService) {
this.spaceService = spaceService;
}

@EventListener(MemberSignupEvent.class)
@Async("threadPoolTaskExecutor")
public void handleMemberSignupEvent(final MemberSignupEvent event) {
spaceService.initializeAndSaveNewMemberSpaces(event.getMember());
}
}

0 comments on commit 266ef8f

Please sign in to comment.