Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
현재 유저 조회 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Feb 18, 2024
1 parent 6a97e80 commit d04fd16
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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<GetUserResponse> getUserByGen(Integer gen) {
Expand All @@ -29,4 +36,9 @@ public Flux<GetUserResponse> getUserByMajor(String major) {
.flatMap(userMapper::userToGetUserResponse);
}

public Mono<GetUserResponse> geturrentUser() {
return userFacade.currentUser()
.flatMap(userMapper::userToGetUserResponse);
}

}

0 comments on commit d04fd16

Please sign in to comment.