Skip to content

Commit

Permalink
refactor: MemerService 및 JoinService Trasactional 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchef1 committed May 29, 2024
1 parent 4df427f commit 1fe44ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
import lombok.RequiredArgsConstructor;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class JoinService {
private final MemberRepository memberRepository;
private final ImageService imageService;
private final BCryptPasswordEncoder bCryptPasswordEncoder;

@Transactional
public void join(JoinRequest joinRequest) {
if (!memberRepository.existsByUsername(joinRequest.getUsername())) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public List<MemberResponse> getInactiveMembers() {
.collect(Collectors.toList());
}

@Transactional
public void activateMember(Long id) {
Member member = memberRepository.findById(id)
.orElseThrow(() -> new IllegalArgumentException("해당 회원 가입 신청이 존재하지 않습니다."));
Expand Down

0 comments on commit 1fe44ad

Please sign in to comment.