Skip to content

Commit

Permalink
Merge pull request #67 from DSM-Repo/refactor-project-#2
Browse files Browse the repository at this point in the history
pr: 패키지 분리
  • Loading branch information
dkflfkd53 authored Aug 23, 2024
2 parents ee87267 + 3328cef commit 8a2ca1f
Show file tree
Hide file tree
Showing 215 changed files with 912 additions and 1,007 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package com.example.whopper.domain.auth.application.impl;
package com.example.whopper.application.auth.service;

import com.example.whopper.domain.auth.application.usecase.ReissueTokenUseCase;
import com.example.whopper.domain.auth.dao.RefreshTokenRepository;
import com.example.whopper.domain.auth.domain.RefreshTokenEntity;
import com.example.whopper.domain.auth.dto.response.TokenResponse;
import com.example.whopper.domain.auth.exception.RefreshTokenNotFoundException;
import com.example.whopper.global.security.jwt.JwtTokenProvider;
import com.example.whopper.application.auth.usecase.ReissueTokenUseCase;
import com.example.whopper.domain.refreshtoken.RefreshTokenEntity;
import com.example.whopper.domain.refreshtoken.RefreshTokenRepository;
import com.example.whopper.interfaces.auth.dto.response.TokenResponse;
import com.example.whopper.common.exception.auth.RefreshTokenNotFoundException;
import com.example.whopper.common.security.jwt.JwtTokenProvider;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class ReissueTokenService implements ReissueTokenUseCase {
class ReissueTokenService implements ReissueTokenUseCase {

private final RefreshTokenRepository refreshTokenRepository;
private final JwtTokenProvider jwtTokenProvider;

@Override
public TokenResponse reissueToken(String token) {
RefreshTokenEntity refreshToken = refreshTokenRepository.findByToken(token)
.orElseThrow(()-> RefreshTokenNotFoundException.EXCEPTION);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package com.example.whopper.domain.auth.application.impl;
package com.example.whopper.application.auth.service;

import com.example.whopper.domain.auth.application.usecase.StudentLoginUseCase;
import com.example.whopper.domain.auth.domain.type.UserRole;
import com.example.whopper.domain.auth.dto.request.LoginRequest;
import com.example.whopper.domain.auth.dto.response.TokenResponse;
import com.example.whopper.domain.auth.exception.InvalidUserException;
import com.example.whopper.domain.auth.exception.PasswordMismatchException;
import com.example.whopper.domain.document.application.component.CreateDocumentComponent;
import com.example.whopper.domain.file.domain.DefaultProfileImageProperties;
import com.example.whopper.domain.major.domain.DefaultMajorFacade;
import com.example.whopper.domain.student.dao.StudentMongoRepository;
import com.example.whopper.domain.student.domain.StudentEntity;
import com.example.whopper.domain.student.exception.StudentNotFoundException;
import com.example.whopper.global.security.jwt.JwtTokenProvider;
import com.example.whopper.infra.feign.XquareClient;
import com.example.whopper.infra.feign.dto.response.XquareUserResponse;
import com.example.whopper.infra.feign.exception.XquareException;
import com.example.whopper.application.auth.usecase.StudentLoginUseCase;
import com.example.whopper.domain.refreshtoken.type.UserRole;
import com.example.whopper.interfaces.auth.dto.request.LoginRequest;
import com.example.whopper.interfaces.auth.dto.response.TokenResponse;
import com.example.whopper.common.exception.auth.InvalidUserException;
import com.example.whopper.common.exception.auth.PasswordMismatchException;
import com.example.whopper.application.resume.component.CreateDocumentComponent;
import com.example.whopper.domain.file.DefaultProfileImageProperties;
import com.example.whopper.domain.major.DefaultMajorFacade;
import com.example.whopper.domain.student.StudentMongoRepository;
import com.example.whopper.domain.student.StudentEntity;
import com.example.whopper.common.exception.student.StudentNotFoundException;
import com.example.whopper.common.security.jwt.JwtTokenProvider;
import com.example.whopper.infrastructure.xquare.XquareClient;
import com.example.whopper.infrastructure.xquare.dto.response.XquareUserResponse;
import com.example.whopper.infrastructure.xquare.exception.XquareException;
import lombok.RequiredArgsConstructor;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@RequiredArgsConstructor
public class StudentLoginService implements StudentLoginUseCase {
class StudentLoginService implements StudentLoginUseCase {

private final StudentMongoRepository studentMongoRepository;
private final JwtTokenProvider jwtTokenProvider;
Expand All @@ -33,6 +33,7 @@ public class StudentLoginService implements StudentLoginUseCase {
private final CreateDocumentComponent createDocumentComponent;
private final DefaultProfileImageProperties defaultProfileImageProperties;

@Override
@Transactional
public TokenResponse studentLogin(LoginRequest request) {
return studentMongoRepository.existsByAccountId(request.accountId())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
package com.example.whopper.domain.auth.application.impl;
package com.example.whopper.application.auth.service;

import com.example.whopper.domain.auth.application.usecase.TeacherLoginUseCase;
import com.example.whopper.domain.auth.domain.type.UserRole;
import com.example.whopper.domain.auth.dto.request.LoginRequest;
import com.example.whopper.domain.auth.dto.response.TokenResponse;
import com.example.whopper.domain.auth.exception.InvalidUserException;
import com.example.whopper.domain.auth.exception.PasswordMismatchException;
import com.example.whopper.domain.teacher.dao.TeacherMongoRepository;
import com.example.whopper.domain.teacher.domain.TeacherEntity;
import com.example.whopper.domain.teacher.exception.TeacherNotFoundException;
import com.example.whopper.global.security.jwt.JwtTokenProvider;
import com.example.whopper.infra.feign.XquareClient;
import com.example.whopper.infra.feign.dto.response.XquareUserResponse;
import com.example.whopper.infra.feign.exception.XquareException;
import com.example.whopper.application.auth.usecase.TeacherLoginUseCase;
import com.example.whopper.domain.refreshtoken.type.UserRole;
import com.example.whopper.interfaces.auth.dto.request.LoginRequest;
import com.example.whopper.interfaces.auth.dto.response.TokenResponse;
import com.example.whopper.common.exception.auth.InvalidUserException;
import com.example.whopper.common.exception.auth.PasswordMismatchException;
import com.example.whopper.domain.teacher.TeacherMongoRepository;
import com.example.whopper.domain.teacher.TeacherEntity;
import com.example.whopper.common.exception.teacher.TeacherNotFoundException;
import com.example.whopper.common.security.jwt.JwtTokenProvider;
import com.example.whopper.infrastructure.xquare.XquareClient;
import com.example.whopper.infrastructure.xquare.dto.response.XquareUserResponse;
import com.example.whopper.infrastructure.xquare.exception.XquareException;
import lombok.RequiredArgsConstructor;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class TeacherLoginService implements TeacherLoginUseCase {
class TeacherLoginService implements TeacherLoginUseCase {

private final TeacherMongoRepository teacherMongoRepository;
private final JwtTokenProvider jwtTokenProvider;
private final XquareClient xquareClient;
private final PasswordEncoder passwordEncoder;

@Override
public TokenResponse teacherLogin(LoginRequest request) {
return teacherMongoRepository.existsByAccountId(request.accountId())
? loginExistingTeacher(request)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.whopper.application.auth.usecase;

import com.example.whopper.interfaces.auth.dto.response.TokenResponse;

public interface ReissueTokenUseCase {
TokenResponse reissueToken(String token);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.whopper.application.auth.usecase;

import com.example.whopper.interfaces.auth.dto.request.LoginRequest;
import com.example.whopper.interfaces.auth.dto.response.TokenResponse;

public interface StudentLoginUseCase {
TokenResponse studentLogin(LoginRequest request);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.whopper.application.auth.usecase;

import com.example.whopper.interfaces.auth.dto.request.LoginRequest;
import com.example.whopper.interfaces.auth.dto.response.TokenResponse;

public interface TeacherLoginUseCase {
TokenResponse teacherLogin(LoginRequest request);
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.example.whopper.domain.feedback.application.impl;

import com.example.whopper.domain.document.dao.DocumentRepository;
import com.example.whopper.domain.document.domain.DocumentEntity;
import com.example.whopper.domain.document.domain.element.DocumentStatus;
import com.example.whopper.domain.document.exception.DocumentIllegalStatusException;
import com.example.whopper.domain.document.exception.DocumentNotFoundException;
import com.example.whopper.domain.feedback.application.usecase.AddFeedbackUseCase;
import com.example.whopper.domain.feedback.dao.FeedbackMongoRepository;
import com.example.whopper.domain.feedback.domain.FeedbackEntity;
import com.example.whopper.domain.feedback.dto.FeedbackRequest;
import com.example.whopper.domain.teacher.application.component.TeacherComponent;
package com.example.whopper.application.feedback.service;

import com.example.whopper.domain.resume.DocumentRepository;
import com.example.whopper.domain.resume.DocumentEntity;
import com.example.whopper.domain.resume.element.DocumentStatus;
import com.example.whopper.common.exception.resume.DocumentIllegalStatusException;
import com.example.whopper.common.exception.resume.DocumentNotFoundException;
import com.example.whopper.application.feedback.usecase.AddFeedbackUseCase;
import com.example.whopper.domain.feedback.FeedbackMongoRepository;
import com.example.whopper.domain.feedback.FeedbackEntity;
import com.example.whopper.interfaces.feedback.dto.FeedbackRequest;
import com.example.whopper.application.teacher.component.TeacherComponent;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.example.whopper.domain.feedback.application.impl;
package com.example.whopper.application.feedback.service;

import com.example.whopper.domain.feedback.application.usecase.ConfirmFeedbackUseCase;
import com.example.whopper.domain.feedback.dao.FeedbackMongoRepository;
import com.example.whopper.domain.feedback.exception.FeedbackNotFoundException;
import com.example.whopper.global.error.exception.ForbiddenException;
import com.example.whopper.global.utils.current.CurrentStudent;
import com.example.whopper.application.feedback.usecase.ConfirmFeedbackUseCase;
import com.example.whopper.domain.feedback.FeedbackMongoRepository;
import com.example.whopper.common.exception.feedback.FeedbackNotFoundException;
import com.example.whopper.common.error.exception.ForbiddenException;
import com.example.whopper.application.student.component.CurrentStudent;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.example.whopper.domain.feedback.application.impl;
package com.example.whopper.application.feedback.service;

import com.example.whopper.domain.feedback.application.usecase.DeleteFeedbackUseCase;
import com.example.whopper.domain.feedback.dao.FeedbackMongoRepository;
import com.example.whopper.application.feedback.usecase.DeleteFeedbackUseCase;
import com.example.whopper.domain.feedback.FeedbackMongoRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.example.whopper.domain.feedback.application.impl;

import com.example.whopper.domain.document.domain.DocumentEntity;
import com.example.whopper.domain.feedback.application.usecase.FindFeedbackUseCase;
import com.example.whopper.domain.feedback.dao.FeedbackMongoRepository;
import com.example.whopper.domain.feedback.domain.FeedbackEntity;
import com.example.whopper.domain.feedback.dto.FeedbackResponse;
import com.example.whopper.domain.teacher.application.component.TeacherComponent;
package com.example.whopper.application.feedback.service;

import com.example.whopper.application.feedback.usecase.FindFeedbackUseCase;
import com.example.whopper.application.teacher.component.TeacherComponent;
import com.example.whopper.domain.feedback.FeedbackEntity;
import com.example.whopper.domain.feedback.FeedbackMongoRepository;
import com.example.whopper.domain.resume.DocumentEntity;
import com.example.whopper.global.utils.DataResponseInfo;
import com.example.whopper.global.utils.current.CurrentStudent;
import com.example.whopper.application.student.component.CurrentStudent;
import com.example.whopper.interfaces.feedback.dto.FeedbackResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.example.whopper.domain.feedback.application.impl;
package com.example.whopper.application.feedback.service;

import com.example.whopper.domain.feedback.application.usecase.UpdateFeedbackUseCase;
import com.example.whopper.domain.feedback.dao.FeedbackMongoRepository;
import com.example.whopper.domain.feedback.domain.FeedbackEntity;
import com.example.whopper.domain.feedback.dto.UpdateFeedbackRequest;
import com.example.whopper.domain.feedback.exception.FeedbackNotFoundException;
import com.example.whopper.application.feedback.usecase.UpdateFeedbackUseCase;
import com.example.whopper.domain.feedback.FeedbackMongoRepository;
import com.example.whopper.domain.feedback.FeedbackEntity;
import com.example.whopper.interfaces.feedback.dto.UpdateFeedbackRequest;
import com.example.whopper.common.exception.feedback.FeedbackNotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.whopper.application.feedback.usecase;

import com.example.whopper.interfaces.feedback.dto.FeedbackRequest;

public interface AddFeedbackUseCase {
void addFeedback(FeedbackRequest request);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.whopper.domain.feedback.application.usecase;
package com.example.whopper.application.feedback.usecase;

public interface ConfirmFeedbackUseCase {
void confirm(String id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.whopper.domain.feedback.application.usecase;
package com.example.whopper.application.feedback.usecase;

public interface DeleteFeedbackUseCase {
void deleteFeedback(String feedbackId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.example.whopper.domain.feedback.application.usecase;
package com.example.whopper.application.feedback.usecase;

import com.example.whopper.domain.feedback.dto.FeedbackResponse;
import com.example.whopper.interfaces.feedback.dto.FeedbackResponse;
import com.example.whopper.global.utils.DataResponseInfo;

public interface FindFeedbackUseCase {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.whopper.application.feedback.usecase;

import com.example.whopper.interfaces.feedback.dto.UpdateFeedbackRequest;

public interface UpdateFeedbackUseCase {
void updateFeedback(String id, UpdateFeedbackRequest request);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.example.whopper.domain.file.application.impl;
package com.example.whopper.application.file.impl;

import com.example.whopper.domain.file.application.usecase.ImageUseCase;
import com.example.whopper.infra.s3.AwsS3Properties;
import com.example.whopper.infra.s3.AwsS3FileType;
import com.example.whopper.application.file.usecase.ImageUseCase;
import com.example.whopper.infrastructure.aws.s3.AwsS3Properties;
import com.example.whopper.infrastructure.aws.s3.AwsS3FileType;
import com.example.whopper.domain.file.type.ImageType;

import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.example.whopper.domain.file.application.impl;
package com.example.whopper.application.file.impl;

import com.example.whopper.domain.file.application.usecase.PdfUseCase;
import com.example.whopper.infra.s3.AwsS3FileType;
import com.example.whopper.infra.s3.AwsS3Properties;
import com.example.whopper.application.file.usecase.PdfUseCase;
import com.example.whopper.infrastructure.aws.s3.AwsS3FileType;
import com.example.whopper.infrastructure.aws.s3.AwsS3Properties;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.whopper.domain.file.application.usecase;
package com.example.whopper.application.file.usecase;

import com.example.whopper.domain.file.type.ImageType;
import org.springframework.web.multipart.MultipartFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.whopper.domain.file.application.usecase;
package com.example.whopper.application.file.usecase;

import org.springframework.web.multipart.MultipartFile;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.example.whopper.domain.library.application.impl;
package com.example.whopper.application.library.impl;

import com.example.whopper.domain.library.application.usecase.ChangeLibraryAccessRightUseCase;
import com.example.whopper.domain.library.dao.LibraryMongoRepository;
import com.example.whopper.domain.library.domain.LibraryEntity;
import com.example.whopper.domain.library.domain.type.AccessRight;
import com.example.whopper.domain.library.exception.LibraryNotFoundException;
import com.example.whopper.application.library.usecase.ChangeLibraryAccessRightUseCase;
import com.example.whopper.domain.library.LibraryMongoRepository;
import com.example.whopper.domain.library.LibraryEntity;
import com.example.whopper.domain.library.type.AccessRight;
import com.example.whopper.common.exception.library.LibraryNotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.example.whopper.domain.library.application.impl;
package com.example.whopper.application.library.impl;

import com.example.whopper.domain.library.application.usecase.CreateLibraryUseCase;
import com.example.whopper.domain.library.dao.LibraryMongoRepository;
import com.example.whopper.domain.library.domain.DocumentIndex;
import com.example.whopper.domain.library.domain.LibraryEntity;
import com.example.whopper.domain.library.domain.type.AccessRight;
import com.example.whopper.application.library.usecase.CreateLibraryUseCase;
import com.example.whopper.domain.library.LibraryMongoRepository;
import com.example.whopper.domain.library.DocumentIndex;
import com.example.whopper.domain.library.LibraryEntity;
import com.example.whopper.domain.library.type.AccessRight;
import com.example.whopper.global.utils.DataResponseInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.example.whopper.domain.library.application.impl;
package com.example.whopper.application.library.impl;

import com.example.whopper.domain.file.application.usecase.PdfUseCase;
import com.example.whopper.domain.library.application.usecase.FindLibraryDetailUseCase;
import com.example.whopper.domain.library.dao.LibraryMongoRepository;
import com.example.whopper.domain.library.domain.LibraryEntity;
import com.example.whopper.domain.library.dto.response.LibraryDetailResponse;
import com.example.whopper.domain.library.exception.LibraryNotFoundException;
import com.example.whopper.application.file.usecase.PdfUseCase;
import com.example.whopper.application.library.usecase.FindLibraryDetailUseCase;
import com.example.whopper.domain.library.LibraryMongoRepository;
import com.example.whopper.domain.library.LibraryEntity;
import com.example.whopper.interfaces.library.dto.response.LibraryDetailResponse;
import com.example.whopper.common.exception.library.LibraryNotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand Down
Loading

0 comments on commit 8a2ca1f

Please sign in to comment.