Skip to content

Commit

Permalink
[BE] refactor: 트랜잭션을 팀 컨벤션에 맞게 리팩터링 (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
70825 authored Aug 3, 2023
1 parent fd15941 commit d127270
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
@Transactional(readOnly = true)
public class AuthService {

private final MemberService memberService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.funeat.member.application;

import static org.springframework.transaction.annotation.Propagation.REQUIRES_NEW;

import com.funeat.auth.dto.SignUserDto;
import com.funeat.auth.dto.UserInfoDto;
import com.funeat.member.domain.Member;
Expand All @@ -12,7 +10,7 @@
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
@Transactional(readOnly = true)
public class MemberService {

private final MemberRepository memberRepository;
Expand All @@ -21,6 +19,7 @@ public MemberService(final MemberRepository memberRepository) {
this.memberRepository = memberRepository;
}

@Transactional
public SignUserDto findOrCreateMember(final UserInfoDto userInfoDto) {
final String platformId = userInfoDto.getId().toString();

Expand All @@ -29,8 +28,7 @@ public SignUserDto findOrCreateMember(final UserInfoDto userInfoDto) {
.orElseGet(() -> save(userInfoDto));
}

@Transactional(propagation = REQUIRES_NEW)
public SignUserDto save(final UserInfoDto userInfoDto) {
private SignUserDto save(final UserInfoDto userInfoDto) {
final Member member = userInfoDto.toMember();
memberRepository.save(member);

Expand Down

0 comments on commit d127270

Please sign in to comment.