diff --git a/src/main/java/com/example/daemawiki/domain/user/service/GetUser.java b/src/main/java/com/example/daemawiki/domain/user/service/GetUser.java index ae6adcd2..13d4de97 100644 --- a/src/main/java/com/example/daemawiki/domain/user/service/GetUser.java +++ b/src/main/java/com/example/daemawiki/domain/user/service/GetUser.java @@ -1,22 +1,29 @@ package com.example.daemawiki.domain.user.service; +import com.example.daemawiki.domain.document.component.facade.DocumentFacade; import com.example.daemawiki.domain.user.dto.GetUserResponse; import com.example.daemawiki.domain.user.model.mapper.UserMapper; import com.example.daemawiki.domain.user.model.type.component.GetMajorType; import com.example.daemawiki.domain.user.repository.UserRepository; +import com.example.daemawiki.domain.user.service.facade.UserFacade; import org.springframework.stereotype.Service; import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; @Service public class GetUser { private final UserRepository userRepository; private final UserMapper userMapper; private final GetMajorType getMajorType; + private final UserFacade userFacade; + private final DocumentFacade documentFacade; - public GetUser(UserRepository userRepository, UserMapper userMapper, GetMajorType getMajorType) { + public GetUser(UserRepository userRepository, UserMapper userMapper, GetMajorType getMajorType, UserFacade userFacade, DocumentFacade documentFacade) { this.userRepository = userRepository; this.userMapper = userMapper; this.getMajorType = getMajorType; + this.userFacade = userFacade; + this.documentFacade = documentFacade; } public Flux getUserByGen(Integer gen) { @@ -29,4 +36,9 @@ public Flux getUserByMajor(String major) { .flatMap(userMapper::userToGetUserResponse); } + public Mono geturrentUser() { + return userFacade.currentUser() + .flatMap(userMapper::userToGetUserResponse); + } + }