Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] User, Auth에 대한 DDD구조로 리팩토링을 진행한다. #91

Merged
merged 22 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b34140c
#78 [refactor] User 도메인의 모델과 인프라의 엔티티를 리팩토링한다.
juuuunny Nov 26, 2024
2e0d62f
#78 [feat] User 모델과 엔티티 사이의 변환을 실행하는 UserMapper 클래스를 생성한다.
juuuunny Nov 26, 2024
bdb3059
#78 [refactor] User 컨트롤러의 주석 설명 변경 및 기본 디폴트 Url을 변경한다.
juuuunny Nov 26, 2024
ee1ec1c
#78 [rename] SmsService를 SmsManager로 변경한다.
juuuunny Nov 26, 2024
acba574
#78 [refactor] Sms 관련 기능을 infra 패키지로 이동하여 리팩토링한다.
juuuunny Nov 26, 2024
0b379b4
#78 [refactor] User 도메인의 repository와 구현체를 분리하여 리팩토링한다.
juuuunny Nov 26, 2024
55bf317
#78 [refactor] UserApplicationService의 회원가입, 닉네임 중복 확인 등의 리팩토링을 진행한다.
juuuunny Nov 26, 2024
b000c99
#78 [refactor] 락을 통한 닉네임 중복 체크 서비스를 본래대로 수정한다
juuuunny Nov 26, 2024
c3604ce
#78 [chore] user 도메인의 공백과 엔터를 알맞게 관리한다.
juuuunny Nov 26, 2024
ca4f673
#78 [refactor] user와 관련된 파일들을 user 패키지 내로 이동한다.
juuuunny Nov 26, 2024
199a69d
#78 [feat] User의 테스트 코드를 리팩토링 한 값에 맞게 수정한다.
juuuunny Nov 26, 2024
5175abc
#78 [feat] User 리팩토링으로 바뀐 Url에 대한 JWT 필터와 Spring 시큐리티에 적용한다.
juuuunny Nov 26, 2024
edb75bb
#78 [feat] 유저 회원가입에 대한 테스트 코드 오류를 수정한다.
juuuunny Nov 26, 2024
32d043c
#78 [chore] global 패키지의 공백 및 엔터를 통일성 있게 맞춘다.
juuuunny Nov 26, 2024
a418d2f
#78 [feat] Mapper의 엔티티에서 도메인 객체로의 변환 시 null 값에 대한 예외 처리를 해준다.
juuuunny Nov 26, 2024
dd8e169
#78 [feat] QueryDsl Q도메인 중복생성 에러를 수정한다.
juuuunny Nov 26, 2024
36cab55
#78 [feat] QueryDsl 관련 build.gradle 설정 파일을 복구한다.
juuuunny Nov 26, 2024
b4a1559
#78 [feat] QueryDsl 관련 build.gradle 설정 파일을 변경한다.
juuuunny Nov 26, 2024
dcda038
#78 [feat] QueryDsl 관련 build.gradle 설정 파일을 복구한다.
juuuunny Nov 26, 2024
0ea7c03
#78 [refactor] 코드 리뷰를 토대로 수정사항을 수정한다.
juuuunny Nov 27, 2024
848b3bf
#78 [refactor] 휴대폰 번호 포맷팅 부분을 user 도메인에서 global util로 이동한다.
juuuunny Nov 27, 2024
2668b50
#78 [refactor] 기준 유저 로그인 시 쿠키 저장을 service에서 handler에서 처리로 변경한다.
juuuunny Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified dump.rdb
Binary file not shown.
38 changes: 0 additions & 38 deletions src/main/java/kusitms/backend/auth/application/AuthService.java

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/kusitms/backend/global/code/BaseCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
public interface BaseCode {
ReasonDto getReason();
ReasonDto getReasonHttpStatus();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
public interface BaseErrorCode {
ErrorReasonDto getReason();
ErrorReasonDto getReasonHttpStatus();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public class QueryDslConfig {
public JPAQueryFactory jpaQueryFactory() {
return new JPAQueryFactory(entityManager);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/kusitms/backend/global/config/S3Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ public void configureS3Cors(AmazonS3 s3) {

s3.setBucketCrossOriginConfiguration(bucketName, configuration);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public OpenAPI customOpenAPI() {

return openAPI;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public WebClient webClient(WebClient.Builder builder) {
.defaultHeader("Content-Type", "application/json")
.build();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public class BaseTimeEntity {

@LastModifiedDate
private LocalDateTime updatedDate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ public class ErrorReasonDto {
private final boolean isSuccess;
private final String code;
private final String message;
}
}
2 changes: 1 addition & 1 deletion src/main/java/kusitms/backend/global/dto/ReasonDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ public class ReasonDto {
private final boolean isSuccess;
private final String code;
private final String message;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public String getCode() {
public HttpStatus getHttpStatus() {
return errorCode.getReasonHttpStatus().getHttpStatus();
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/kusitms/backend/global/redis/RedisManager.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package kusitms.backend.global.redis;

import kusitms.backend.auth.jwt.JWTUtil;
import kusitms.backend.auth.status.AuthErrorStatus;
import kusitms.backend.global.exception.CustomException;
import kusitms.backend.global.status.ErrorStatus;
import kusitms.backend.user.infra.jwt.JWTUtil;
import kusitms.backend.user.status.AuthErrorStatus;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public ReasonDto getReasonHttpStatus() {
.message(message)
.build();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package kusitms.backend.result.application;

import kusitms.backend.auth.jwt.JWTUtil;
import kusitms.backend.user.infra.jwt.JWTUtil;
import kusitms.backend.result.application.dto.request.SaveTopRankedZoneRequestDto;
import kusitms.backend.result.application.dto.response.GetProfileResponseDto;
import kusitms.backend.result.application.dto.response.GetZonesResponseDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
public class ProfileMapper {

public static Profile toDomain(ProfileEntity profileEntity) {

if (profileEntity == null) {
return null;
}

return Profile.toDomain(
profileEntity.getId(),
profileEntity.getImgUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public class ResultMapper {

public static Result toDomain(ResultEntity resultEntity) {

if (resultEntity == null) {
return null;
}

Profile profile = ProfileMapper.toDomain(resultEntity.getProfileEntity());
List<Zone> zones = resultEntity.getZoneEntities().stream()
.map(ZoneMapper::toDomain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
public class ZoneMapper {

public static Zone toDomain(ZoneEntity zoneEntity) {

if (zoneEntity == null) {
return null;
}

return Zone.toDomain(
zoneEntity.getId(),
zoneEntity.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
public class EntertainmentMapper {

public static Entertainment toDomain(EntertainmentEntity entertainmentEntity) {

if (entertainmentEntity == null) {
return null;
}

return Entertainment.toDomain(
entertainmentEntity.getId(),
entertainmentEntity.getImgUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
public class FoodMapper {

public static Food toDomain(FoodEntity foodEntity) {

if (foodEntity == null) {
return null;
}

return Food.toDomain(
foodEntity.getId(),
foodEntity.getImgUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public class StadiumMapper {

public static Stadium toDomain(StadiumEntity stadiumEntity) {

if (stadiumEntity == null) {
return null;
}

List<Food> foods = stadiumEntity.getFoodEntities().stream()
.map(FoodMapper::toDomain)
.toList();
Expand Down
Loading