Skip to content

Commit

Permalink
🛠️ Fix Circular Reference Between Profile&Review, User&Profile
Browse files Browse the repository at this point in the history
  • Loading branch information
alpakar02 committed Jan 22, 2025
1 parent 3a12f41 commit d8b6e03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import com.toyProject7.karrot.review.service.ReviewService
import com.toyProject7.karrot.user.controller.User
import com.toyProject7.karrot.user.persistence.UserEntity
import com.toyProject7.karrot.user.service.UserService
import org.springframework.context.annotation.Lazy
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import java.time.Instant
Expand All @@ -25,9 +26,9 @@ import java.time.temporal.ChronoUnit
class ProfileService(
private val profileRepository: ProfileRepository,
private val userService: UserService,
private val reviewService: ReviewService,
private val articleService: ArticleService,
private val imageService: ImageService,
@Lazy private val reviewService: ReviewService,
) {
@Transactional
fun getMyProfile(user: User): Profile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.toyProject7.karrot.user.persistence.UserEntity
import com.toyProject7.karrot.user.persistence.UserPrincipal
import com.toyProject7.karrot.user.persistence.UserRepository
import org.mindrot.jbcrypt.BCrypt
import org.springframework.context.annotation.Lazy
import org.springframework.data.repository.findByIdOrNull
import org.springframework.security.core.userdetails.UsernameNotFoundException
import org.springframework.stereotype.Service
Expand All @@ -30,7 +31,7 @@ import java.time.Instant
class UserService(
private val userRepository: UserRepository,
private val normalUserRepository: NormalUserRepository,
private val profileService: ProfileService,
@Lazy private val profileService: ProfileService,
) {
@Transactional
fun signUp(
Expand Down

0 comments on commit d8b6e03

Please sign in to comment.