diff --git a/src/main/java/com/ftm/server/adapter/in/web/auth/dto/response/GeneralLoginResponse.java b/src/main/java/com/ftm/server/adapter/in/web/auth/dto/response/GeneralLoginResponse.java index dd74829..82dc3f8 100644 --- a/src/main/java/com/ftm/server/adapter/in/web/auth/dto/response/GeneralLoginResponse.java +++ b/src/main/java/com/ftm/server/adapter/in/web/auth/dto/response/GeneralLoginResponse.java @@ -11,8 +11,8 @@ public class GeneralLoginResponse { private final Long id; private final String nickname; private final String profileImageUrl; - private final String mildLevelName; - private final String spicyLevelName; + private final String normalLevelName; + private final String truthLevelName; @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING) private final LocalDateTime loginTime; @@ -21,8 +21,8 @@ public class GeneralLoginResponse { this.id = authenticatedUserVo.getId(); this.nickname = authenticatedUserVo.getNickname(); this.profileImageUrl = authenticatedUserVo.getProfileImageUrl(); - this.mildLevelName = authenticatedUserVo.getMildLevelName(); - this.spicyLevelName = authenticatedUserVo.getSpicyLevelName(); + this.normalLevelName = authenticatedUserVo.getNormalLevelName(); + this.truthLevelName = authenticatedUserVo.getTruthLevelName(); this.loginTime = LocalDateTime.now(); } diff --git a/src/main/java/com/ftm/server/adapter/in/web/auth/dto/response/SocialLoginResponse.java b/src/main/java/com/ftm/server/adapter/in/web/auth/dto/response/SocialLoginResponse.java index ed3e07d..17f0e16 100644 --- a/src/main/java/com/ftm/server/adapter/in/web/auth/dto/response/SocialLoginResponse.java +++ b/src/main/java/com/ftm/server/adapter/in/web/auth/dto/response/SocialLoginResponse.java @@ -13,8 +13,8 @@ public class SocialLoginResponse { private final String nickname; private final SocialProvider socialProvider; private final String profileImageUrl; - private final String mildLevelName; - private final String spicyLevelName; + private final String normalLevelName; + private final String truthLevelName; @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING) private final LocalDateTime loginTime; @@ -24,8 +24,8 @@ public class SocialLoginResponse { this.nickname = authenticatedUserVo.getNickname(); this.socialProvider = socialProvider; this.profileImageUrl = authenticatedUserVo.getProfileImageUrl(); - this.mildLevelName = authenticatedUserVo.getMildLevelName(); - this.spicyLevelName = authenticatedUserVo.getSpicyLevelName(); + this.normalLevelName = authenticatedUserVo.getNormalLevelName(); + this.truthLevelName = authenticatedUserVo.getTruthLevelName(); this.loginTime = LocalDateTime.now(); } diff --git a/src/main/java/com/ftm/server/adapter/in/web/grooming/controller/level/SaveGroomingLevelController.java b/src/main/java/com/ftm/server/adapter/in/web/grooming/controller/level/SaveGroomingLevelController.java index 8ee7309..cda1a75 100644 --- a/src/main/java/com/ftm/server/adapter/in/web/grooming/controller/level/SaveGroomingLevelController.java +++ b/src/main/java/com/ftm/server/adapter/in/web/grooming/controller/level/SaveGroomingLevelController.java @@ -26,8 +26,12 @@ public ResponseEntity> saveGroomingLevel( SaveGroomingLevelCommand.of( request.getMinScore(), request.getMaxScore(), - request.getMildLevelName(), - request.getSpicyLevelName()); + request.getNormalModeName(), + request.getNormalModeSummary(), + request.getNormalModeDescription(), + request.getTruthModeName(), + request.getTruthModeSummary(), + request.getTruthModeDescription()); saveGroomingLevelUseCase.execute(command); return ResponseEntity.status(HttpStatus.CREATED) diff --git a/src/main/java/com/ftm/server/adapter/in/web/grooming/controller/level/UpdateGroomingLevelController.java b/src/main/java/com/ftm/server/adapter/in/web/grooming/controller/level/UpdateGroomingLevelController.java index 809ac58..a883315 100644 --- a/src/main/java/com/ftm/server/adapter/in/web/grooming/controller/level/UpdateGroomingLevelController.java +++ b/src/main/java/com/ftm/server/adapter/in/web/grooming/controller/level/UpdateGroomingLevelController.java @@ -29,8 +29,12 @@ public ResponseEntity> saveGroomingLevel( levelId, request.getMinScore(), request.getMaxScore(), - request.getMildLevelName(), - request.getSpicyLevelName()); + request.getNormalModeName(), + request.getNormalModeSummary(), + request.getNormalModeDescription(), + request.getTruthModeName(), + request.getTruthModeSummary(), + request.getTruthModeDescription()); updateGroomingLevelUseCase.execute(command); return ResponseEntity.status(HttpStatus.OK) diff --git a/src/main/java/com/ftm/server/adapter/in/web/grooming/dto/request/SaveGroomingLevelRequest.java b/src/main/java/com/ftm/server/adapter/in/web/grooming/dto/request/SaveGroomingLevelRequest.java index 2a8fc17..bd947c0 100644 --- a/src/main/java/com/ftm/server/adapter/in/web/grooming/dto/request/SaveGroomingLevelRequest.java +++ b/src/main/java/com/ftm/server/adapter/in/web/grooming/dto/request/SaveGroomingLevelRequest.java @@ -1,8 +1,6 @@ package com.ftm.server.adapter.in.web.grooming.dto.request; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.*; import lombok.AllArgsConstructor; import lombok.Getter; @@ -18,6 +16,10 @@ public class SaveGroomingLevelRequest { @Max(100) private Integer maxScore; - @NotEmpty private String mildLevelName; - @NotEmpty private String spicyLevelName; + @NotEmpty private String normalModeName; + @NotEmpty private String normalModeSummary; + @NotEmpty private String normalModeDescription; + @NotEmpty private String truthModeName; + @NotEmpty private String truthModeSummary; + @NotEmpty private String truthModeDescription; } diff --git a/src/main/java/com/ftm/server/adapter/in/web/grooming/dto/request/UpdateGroomingLevelRequest.java b/src/main/java/com/ftm/server/adapter/in/web/grooming/dto/request/UpdateGroomingLevelRequest.java index 7a69546..d6bcb4b 100644 --- a/src/main/java/com/ftm/server/adapter/in/web/grooming/dto/request/UpdateGroomingLevelRequest.java +++ b/src/main/java/com/ftm/server/adapter/in/web/grooming/dto/request/UpdateGroomingLevelRequest.java @@ -17,6 +17,10 @@ public class UpdateGroomingLevelRequest { @Max(100) private Integer maxScore; - private String mildLevelName; - private String spicyLevelName; + private String normalModeName; + private String normalModeSummary; + private String normalModeDescription; + private String truthModeName; + private String truthModeSummary; + private String truthModeDescription; } diff --git a/src/main/java/com/ftm/server/adapter/in/web/user/dto/response/SocialUserSignupResponse.java b/src/main/java/com/ftm/server/adapter/in/web/user/dto/response/SocialUserSignupResponse.java index 3f1af44..e318e7e 100644 --- a/src/main/java/com/ftm/server/adapter/in/web/user/dto/response/SocialUserSignupResponse.java +++ b/src/main/java/com/ftm/server/adapter/in/web/user/dto/response/SocialUserSignupResponse.java @@ -13,8 +13,8 @@ public class SocialUserSignupResponse { private final String nickname; private final SocialProvider socialProvider; private final String profileImageUrl; - private final String mildLevelName; - private final String spicyLevelName; + private final String normalLevelName; + private final String truthLevelName; @JsonFormat(pattern = "yyyy-MM-dd HH:mm", shape = JsonFormat.Shape.STRING) private final LocalDateTime loginTime; @@ -25,8 +25,8 @@ public static SocialUserSignupResponse from(SocialUserSignupSummaryVo vo) { vo.getNickname(), vo.getSocialProvider(), vo.getProfileImageUrl(), - vo.getMildLevelName(), - vo.getSpicyLevelName(), + vo.getNormalLevelName(), + vo.getTruthLevelName(), LocalDateTime.now()); } } diff --git a/src/main/java/com/ftm/server/adapter/out/persistence/adapter/auth/AuthDomainPersistenceAdapter.java b/src/main/java/com/ftm/server/adapter/out/persistence/adapter/auth/AuthDomainPersistenceAdapter.java index 83763fb..5ac0ee1 100644 --- a/src/main/java/com/ftm/server/adapter/out/persistence/adapter/auth/AuthDomainPersistenceAdapter.java +++ b/src/main/java/com/ftm/server/adapter/out/persistence/adapter/auth/AuthDomainPersistenceAdapter.java @@ -1,9 +1,12 @@ package com.ftm.server.adapter.out.persistence.adapter.auth; +import com.ftm.server.adapter.out.persistence.mapper.GroomingLevelMapper; import com.ftm.server.adapter.out.persistence.mapper.UserImageMapper; import com.ftm.server.adapter.out.persistence.mapper.UserMapper; +import com.ftm.server.adapter.out.persistence.repository.GroomingLevelRepository; import com.ftm.server.adapter.out.persistence.repository.UserImageRepository; import com.ftm.server.adapter.out.persistence.repository.UserRepository; +import com.ftm.server.application.port.out.persistence.auth.LoadGroomingLevelForAuthPort; import com.ftm.server.application.port.out.persistence.auth.LoadUserForAuthPort; import com.ftm.server.application.port.out.persistence.auth.LoadUserImageForAuthPort; import com.ftm.server.application.query.FindByEmailQuery; @@ -11,6 +14,7 @@ import com.ftm.server.application.query.FindBySocialValueQuery; import com.ftm.server.application.query.FindByUserIdQuery; import com.ftm.server.common.annotation.Adapter; +import com.ftm.server.domain.entity.GroomingLevel; import com.ftm.server.domain.entity.User; import com.ftm.server.domain.entity.UserImage; import java.util.Optional; @@ -20,15 +24,18 @@ @Adapter @RequiredArgsConstructor @Slf4j -public class AuthDomainPersistenceAdapter implements LoadUserForAuthPort, LoadUserImageForAuthPort { +public class AuthDomainPersistenceAdapter + implements LoadUserForAuthPort, LoadUserImageForAuthPort, LoadGroomingLevelForAuthPort { // Repository private final UserRepository userRepository; private final UserImageRepository userImageRepository; + private final GroomingLevelRepository groomingLevelRepository; // Mapper private final UserMapper userMapper; private final UserImageMapper userImageMapper; + private final GroomingLevelMapper groomingLevelMapper; @Override public Optional loadUserById(FindByIdQuery query) { @@ -53,4 +60,11 @@ public Optional loadUserImageByUserId(FindByUserIdQuery query) { .findByUserId(query.getUserId()) .map(userImageMapper::toDomainEntity); } + + @Override + public Optional loadGroomingLevelById(FindByIdQuery query) { + return groomingLevelRepository + .findById(query.getId()) + .map(groomingLevelMapper::toDomainEntity); + } } diff --git a/src/main/java/com/ftm/server/adapter/out/persistence/adapter/grooming/GroomingDomainPersistenceAdapter.java b/src/main/java/com/ftm/server/adapter/out/persistence/adapter/grooming/GroomingDomainPersistenceAdapter.java index e0c20b4..d56300a 100644 --- a/src/main/java/com/ftm/server/adapter/out/persistence/adapter/grooming/GroomingDomainPersistenceAdapter.java +++ b/src/main/java/com/ftm/server/adapter/out/persistence/adapter/grooming/GroomingDomainPersistenceAdapter.java @@ -4,9 +4,9 @@ import com.ftm.server.adapter.out.persistence.model.*; import com.ftm.server.adapter.out.persistence.repository.*; import com.ftm.server.application.port.out.persistence.grooming.*; -import com.ftm.server.application.query.FIndGroomingLevelByScoreQuery; import com.ftm.server.application.query.FindByIdQuery; import com.ftm.server.application.query.FindByUserIdQuery; +import com.ftm.server.application.query.FindGroomingLevelByScoreQuery; import com.ftm.server.application.query.FindGroomingTestResultByUserIdAndTestedAtQuery; import com.ftm.server.common.annotation.Adapter; import com.ftm.server.common.exception.CustomException; @@ -113,7 +113,7 @@ public void saveGroomingTestResults(List results) { } @Override - public Optional loadGroomingLevelByScore(FIndGroomingLevelByScoreQuery query) { + public Optional loadGroomingLevelsByScore(FindGroomingLevelByScoreQuery query) { return groomingLevelRepository .findByScoreInRange(query.getScore()) .map(groomingLevelMapper::toDomainEntity); @@ -136,6 +136,7 @@ public void updateUserGroomingStatus(User user) { // 유저 점수 업데이트 userJpaEntity.updateGroomingScore(user); + // 그루밍 레벨 GroomingLevelJpaEntity groomingLevelJpaEntity = groomingLevelRepository .findById(user.getGroomingLevelId()) diff --git a/src/main/java/com/ftm/server/adapter/out/persistence/mapper/GroomingLevelMapper.java b/src/main/java/com/ftm/server/adapter/out/persistence/mapper/GroomingLevelMapper.java index 7dbb020..7887e87 100644 --- a/src/main/java/com/ftm/server/adapter/out/persistence/mapper/GroomingLevelMapper.java +++ b/src/main/java/com/ftm/server/adapter/out/persistence/mapper/GroomingLevelMapper.java @@ -13,8 +13,12 @@ public GroomingLevel toDomainEntity(GroomingLevelJpaEntity jpaEntity) { jpaEntity.getId(), jpaEntity.getMinScore(), jpaEntity.getMaxScore(), - jpaEntity.getMildLevelName(), - jpaEntity.getSpicyLevelName(), + jpaEntity.getNormalModeName(), + jpaEntity.getNormalModeSummary(), + jpaEntity.getNormalModeDescription(), + jpaEntity.getTruthModeName(), + jpaEntity.getTruthModeSummary(), + jpaEntity.getTruthModeDescription(), jpaEntity.getCreatedAt(), jpaEntity.getUpdatedAt()); } diff --git a/src/main/java/com/ftm/server/adapter/out/persistence/model/GroomingLevelJpaEntity.java b/src/main/java/com/ftm/server/adapter/out/persistence/model/GroomingLevelJpaEntity.java index 8bd00e2..49daacb 100644 --- a/src/main/java/com/ftm/server/adapter/out/persistence/model/GroomingLevelJpaEntity.java +++ b/src/main/java/com/ftm/server/adapter/out/persistence/model/GroomingLevelJpaEntity.java @@ -16,31 +16,54 @@ public class GroomingLevelJpaEntity extends BaseTimeJpaEntity { private Integer minScore; private Integer maxScore; - private String mildLevelName; - private String spicyLevelName; + private String normalModeName; + private String normalModeSummary; + private String normalModeDescription; + private String truthModeName; + private String truthModeSummary; + private String truthModeDescription; @Builder(access = AccessLevel.PRIVATE) private GroomingLevelJpaEntity( - Integer minScore, Integer maxScore, String mildLevelName, String spicyLevelName) { + Integer minScore, + Integer maxScore, + String normalModeName, + String normalModeSummary, + String normalModeDescription, + String truthModeName, + String truthModeSummary, + String truthModeDescription) { this.minScore = minScore; this.maxScore = maxScore; - this.mildLevelName = mildLevelName; - this.spicyLevelName = spicyLevelName; + this.normalModeName = normalModeName; + this.normalModeSummary = normalModeSummary; + this.normalModeDescription = normalModeDescription; + this.truthModeName = truthModeName; + this.truthModeSummary = truthModeSummary; + this.truthModeDescription = truthModeDescription; } public static GroomingLevelJpaEntity from(GroomingLevel groomingLevel) { return GroomingLevelJpaEntity.builder() .minScore(groomingLevel.getMinScore()) .maxScore(groomingLevel.getMaxScore()) - .mildLevelName(groomingLevel.getMildLevelName()) - .spicyLevelName(groomingLevel.getSpicyLevelName()) + .normalModeName(groomingLevel.getNormalModeName()) + .normalModeSummary(groomingLevel.getNormalModeSummary()) + .normalModeDescription(groomingLevel.getNormalModeDescription()) + .truthModeName(groomingLevel.getTruthModeName()) + .truthModeSummary(groomingLevel.getTruthModeSummary()) + .truthModeDescription(groomingLevel.getTruthModeDescription()) .build(); } public void updateGroomingLevelForDomainEntity(GroomingLevel groomingLevel) { this.minScore = groomingLevel.getMinScore(); this.maxScore = groomingLevel.getMaxScore(); - this.mildLevelName = groomingLevel.getMildLevelName(); - this.spicyLevelName = groomingLevel.getSpicyLevelName(); + this.normalModeName = groomingLevel.getNormalModeName(); + this.normalModeSummary = groomingLevel.getNormalModeSummary(); + this.normalModeDescription = groomingLevel.getNormalModeDescription(); + this.truthModeName = groomingLevel.getTruthModeName(); + this.truthModeSummary = groomingLevel.getTruthModeSummary(); + this.truthModeDescription = groomingLevel.getTruthModeDescription(); } } diff --git a/src/main/java/com/ftm/server/adapter/out/persistence/model/UserJpaEntity.java b/src/main/java/com/ftm/server/adapter/out/persistence/model/UserJpaEntity.java index ddd689c..74e69cb 100644 --- a/src/main/java/com/ftm/server/adapter/out/persistence/model/UserJpaEntity.java +++ b/src/main/java/com/ftm/server/adapter/out/persistence/model/UserJpaEntity.java @@ -127,11 +127,11 @@ public void updateGroomingScore(User user) { this.groomingScore = user.getGroomingScore(); } - public void updateGroomingLevel(GroomingLevelJpaEntity groomingLevelJpaEntity) { - this.groomingLevel = groomingLevelJpaEntity; + public void updateGroomingLevel(GroomingLevelJpaEntity groomingLevel) { + this.groomingLevel = groomingLevel; } - public void updateFromDomainEntity(User user, GroomingLevelJpaEntity groomingLevelJpaEntity) { + public void updateFromDomainEntity(User user, GroomingLevelJpaEntity groomingLevel) { this.email = user.getEmail(); this.password = user.getPassword(); @@ -140,7 +140,7 @@ public void updateFromDomainEntity(User user, GroomingLevelJpaEntity groomingLev this.socialProvider = user.getSocialProvider(); this.socialId = user.getSocialId(); this.groomingScore = user.getGroomingScore(); - this.groomingLevel = groomingLevelJpaEntity; + this.groomingLevel = groomingLevel; this.role = user.getRole(); this.favoriteHashtags = user.getFavoriteHashtags(); this.isDeleted = user.getIsDeleted(); diff --git a/src/main/java/com/ftm/server/application/command/grooming/level/SaveGroomingLevelCommand.java b/src/main/java/com/ftm/server/application/command/grooming/level/SaveGroomingLevelCommand.java index 7f3e3c3..d1b11f8 100644 --- a/src/main/java/com/ftm/server/application/command/grooming/level/SaveGroomingLevelCommand.java +++ b/src/main/java/com/ftm/server/application/command/grooming/level/SaveGroomingLevelCommand.java @@ -7,19 +7,49 @@ public class SaveGroomingLevelCommand { private final Integer minScore; private final Integer maxScore; - private final String mildLevelName; - private final String spicyLevelName; + private final String normalModeName; + private final String normalModeSummary; + private final String normalModeDescription; + private final String truthModeName; + private final String truthModeSummary; + private final String truthModeDescription; private SaveGroomingLevelCommand( - Integer minScore, Integer maxScore, String mildLevelName, String spicyLevelName) { + Integer minScore, + Integer maxScore, + String normalModeName, + String normalModeSummary, + String normalModeDescription, + String truthModeName, + String truthModeSummary, + String truthModeDescription) { this.minScore = minScore; this.maxScore = maxScore; - this.mildLevelName = mildLevelName; - this.spicyLevelName = spicyLevelName; + this.normalModeName = normalModeName; + this.normalModeSummary = normalModeSummary; + this.normalModeDescription = normalModeDescription; + this.truthModeName = truthModeName; + this.truthModeSummary = truthModeSummary; + this.truthModeDescription = truthModeDescription; } public static SaveGroomingLevelCommand of( - Integer minScore, Integer maxScore, String mildLevelName, String spicyLevelName) { - return new SaveGroomingLevelCommand(minScore, maxScore, mildLevelName, spicyLevelName); + Integer minScore, + Integer maxScore, + String normalModeName, + String normalModeSummary, + String normalModeDescription, + String truthModeName, + String truthModeSummary, + String truthModeDescription) { + return new SaveGroomingLevelCommand( + minScore, + maxScore, + normalModeName, + normalModeSummary, + normalModeDescription, + truthModeName, + truthModeSummary, + truthModeDescription); } } diff --git a/src/main/java/com/ftm/server/application/command/grooming/level/UpdateGroomingLevelCommand.java b/src/main/java/com/ftm/server/application/command/grooming/level/UpdateGroomingLevelCommand.java index 812eb3a..12a4f5f 100644 --- a/src/main/java/com/ftm/server/application/command/grooming/level/UpdateGroomingLevelCommand.java +++ b/src/main/java/com/ftm/server/application/command/grooming/level/UpdateGroomingLevelCommand.java @@ -8,29 +8,53 @@ public class UpdateGroomingLevelCommand { private final Long id; private final Integer minScore; private final Integer maxScore; - private final String mildLevelName; - private final String spicyLevelName; + private final String normalModeName; + private final String normalModeSummary; + private final String normalModeDescription; + private final String truthModeName; + private final String truthModeSummary; + private final String truthModeDescription; private UpdateGroomingLevelCommand( Long id, Integer minScore, Integer maxScore, - String mildLevelName, - String spicyLevelName) { + String normalModeName, + String normalModeSummary, + String normalModeDescription, + String truthModeName, + String truthModeSummary, + String truthModeDescription) { this.id = id; this.minScore = minScore; this.maxScore = maxScore; - this.mildLevelName = mildLevelName; - this.spicyLevelName = spicyLevelName; + this.normalModeName = normalModeName; + this.normalModeSummary = normalModeSummary; + this.normalModeDescription = normalModeDescription; + this.truthModeName = truthModeName; + this.truthModeSummary = truthModeSummary; + this.truthModeDescription = truthModeDescription; } public static UpdateGroomingLevelCommand of( Long id, Integer minScore, Integer maxScore, - String mildLevelName, - String spicyLevelName) { + String normalModeName, + String normalModeSummary, + String normalModeDescription, + String truthModeName, + String truthModeSummary, + String truthModeDescription) { return new UpdateGroomingLevelCommand( - id, minScore, maxScore, mildLevelName, spicyLevelName); + id, + minScore, + maxScore, + normalModeName, + normalModeSummary, + normalModeDescription, + truthModeName, + truthModeSummary, + truthModeDescription); } } diff --git a/src/main/java/com/ftm/server/application/port/out/persistence/auth/LoadGroomingLevelForAuthPort.java b/src/main/java/com/ftm/server/application/port/out/persistence/auth/LoadGroomingLevelForAuthPort.java new file mode 100644 index 0000000..3151d2e --- /dev/null +++ b/src/main/java/com/ftm/server/application/port/out/persistence/auth/LoadGroomingLevelForAuthPort.java @@ -0,0 +1,12 @@ +package com.ftm.server.application.port.out.persistence.auth; + +import com.ftm.server.application.query.FindByIdQuery; +import com.ftm.server.common.annotation.Port; +import com.ftm.server.domain.entity.GroomingLevel; +import java.util.Optional; + +@Port +public interface LoadGroomingLevelForAuthPort { + + Optional loadGroomingLevelById(FindByIdQuery query); +} diff --git a/src/main/java/com/ftm/server/application/port/out/persistence/grooming/LoadGroomingLevelPort.java b/src/main/java/com/ftm/server/application/port/out/persistence/grooming/LoadGroomingLevelPort.java index fe77c52..df97339 100644 --- a/src/main/java/com/ftm/server/application/port/out/persistence/grooming/LoadGroomingLevelPort.java +++ b/src/main/java/com/ftm/server/application/port/out/persistence/grooming/LoadGroomingLevelPort.java @@ -1,7 +1,7 @@ package com.ftm.server.application.port.out.persistence.grooming; -import com.ftm.server.application.query.FIndGroomingLevelByScoreQuery; import com.ftm.server.application.query.FindByIdQuery; +import com.ftm.server.application.query.FindGroomingLevelByScoreQuery; import com.ftm.server.common.annotation.Port; import com.ftm.server.domain.entity.GroomingLevel; import java.util.Optional; @@ -9,7 +9,7 @@ @Port public interface LoadGroomingLevelPort { - Optional loadGroomingLevelByScore(FIndGroomingLevelByScoreQuery query); + Optional loadGroomingLevelsByScore(FindGroomingLevelByScoreQuery query); Optional loadGroomingLevelById(FindByIdQuery query); } diff --git a/src/main/java/com/ftm/server/application/query/FIndGroomingLevelByScoreQuery.java b/src/main/java/com/ftm/server/application/query/FIndGroomingLevelByScoreQuery.java deleted file mode 100644 index 5085019..0000000 --- a/src/main/java/com/ftm/server/application/query/FIndGroomingLevelByScoreQuery.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.ftm.server.application.query; - -import lombok.Getter; - -@Getter -public class FIndGroomingLevelByScoreQuery { - - private final int score; - - private FIndGroomingLevelByScoreQuery(int score) { - this.score = score; - } - - public static FIndGroomingLevelByScoreQuery of(int score) { - return new FIndGroomingLevelByScoreQuery(score); - } -} diff --git a/src/main/java/com/ftm/server/application/query/FindGroomingLevelByScoreQuery.java b/src/main/java/com/ftm/server/application/query/FindGroomingLevelByScoreQuery.java new file mode 100644 index 0000000..baf4138 --- /dev/null +++ b/src/main/java/com/ftm/server/application/query/FindGroomingLevelByScoreQuery.java @@ -0,0 +1,17 @@ +package com.ftm.server.application.query; + +import lombok.Getter; + +@Getter +public class FindGroomingLevelByScoreQuery { + + private final int score; + + private FindGroomingLevelByScoreQuery(int score) { + this.score = score; + } + + public static FindGroomingLevelByScoreQuery of(int score) { + return new FindGroomingLevelByScoreQuery(score); + } +} diff --git a/src/main/java/com/ftm/server/application/service/auth/GeneralLoginService.java b/src/main/java/com/ftm/server/application/service/auth/GeneralLoginService.java index 05036c2..b7aeaf5 100644 --- a/src/main/java/com/ftm/server/application/service/auth/GeneralLoginService.java +++ b/src/main/java/com/ftm/server/application/service/auth/GeneralLoginService.java @@ -2,6 +2,7 @@ import com.ftm.server.application.command.auth.GeneralLoginCommand; import com.ftm.server.application.port.in.auth.GeneralLoginUseCase; +import com.ftm.server.application.port.out.persistence.auth.LoadGroomingLevelForAuthPort; import com.ftm.server.application.port.out.persistence.auth.LoadUserForAuthPort; import com.ftm.server.application.port.out.persistence.auth.LoadUserImageForAuthPort; import com.ftm.server.application.port.out.security.SecurityAuthenticationPort; @@ -10,6 +11,7 @@ import com.ftm.server.application.vo.auth.AuthenticatedUserVo; import com.ftm.server.common.exception.CustomException; import com.ftm.server.common.response.enums.ErrorResponseCode; +import com.ftm.server.domain.entity.GroomingLevel; import com.ftm.server.domain.entity.User; import com.ftm.server.domain.entity.UserImage; import com.ftm.server.infrastructure.security.UserPrincipal; @@ -28,6 +30,7 @@ public class GeneralLoginService implements GeneralLoginUseCase { private final SecurityAuthenticationPort securityAuthenticationPort; private final LoadUserForAuthPort loadUserForAuthPort; private final LoadUserImageForAuthPort loadUserImageForAuthPort; + private final LoadGroomingLevelForAuthPort loadGroomingLevelForAuthPort; @Override @Transactional @@ -49,10 +52,21 @@ public AuthenticatedUserVo execute( .orElseThrow( () -> new CustomException(ErrorResponseCode.USER_IMAGE_NOT_FOUND)); + GroomingLevel groomingLevel = null; + if (user.getGroomingLevelId() != null) { + groomingLevel = + loadGroomingLevelForAuthPort + .loadGroomingLevelById(FindByIdQuery.of(user.getGroomingLevelId())) + .orElseThrow( + () -> + new CustomException( + ErrorResponseCode.GROOMING_LEVEL_NOT_FOUND)); + } + // 인증 세션 등록 (시큐리티 컨텍스트 등록) securityAuthenticationPort.saveAuthenticatedSession(auth, req, res); - return AuthenticatedUserVo.of(user, userImage); + return AuthenticatedUserVo.of(user, userImage, groomingLevel); } private Authentication createAuthenticationOrThrow(GeneralLoginCommand command) { diff --git a/src/main/java/com/ftm/server/application/service/auth/KakaoLoginService.java b/src/main/java/com/ftm/server/application/service/auth/KakaoLoginService.java index ea22d9b..3e41388 100644 --- a/src/main/java/com/ftm/server/application/service/auth/KakaoLoginService.java +++ b/src/main/java/com/ftm/server/application/service/auth/KakaoLoginService.java @@ -3,8 +3,10 @@ import com.ftm.server.application.command.auth.KakaoLoginCommand; import com.ftm.server.application.port.in.auth.KakaoLoginUseCase; import com.ftm.server.application.port.out.oauth.SocialOAuthClientPort; +import com.ftm.server.application.port.out.persistence.auth.LoadGroomingLevelForAuthPort; import com.ftm.server.application.port.out.persistence.auth.LoadUserForAuthPort; import com.ftm.server.application.port.out.persistence.auth.LoadUserImageForAuthPort; +import com.ftm.server.application.query.FindByIdQuery; import com.ftm.server.application.query.FindBySocialValueQuery; import com.ftm.server.application.query.FindByUserIdQuery; import com.ftm.server.application.vo.auth.AuthenticatedUserVo; @@ -13,6 +15,7 @@ import com.ftm.server.application.vo.auth.SocialLoginSuccessVo; import com.ftm.server.common.exception.CustomException; import com.ftm.server.common.response.enums.ErrorResponseCode; +import com.ftm.server.domain.entity.GroomingLevel; import com.ftm.server.domain.entity.User; import com.ftm.server.domain.entity.UserImage; import com.ftm.server.infrastructure.oauth.kakao.KakaoAuthUser; @@ -27,6 +30,7 @@ public class KakaoLoginService implements KakaoLoginUseCase { private final SocialOAuthClientPort kakaoOAuthClientPort; private final LoadUserForAuthPort loadUserForAuthPort; private final LoadUserImageForAuthPort loadUserImageForAuthPort; + private final LoadGroomingLevelForAuthPort loadGroomingLevelForAuthPort; @Override public SocialLoginOutcomeVo execute(KakaoLoginCommand command) { @@ -49,8 +53,20 @@ public SocialLoginOutcomeVo execute(KakaoLoginCommand command) { () -> new CustomException( ErrorResponseCode.USER_IMAGE_NOT_FOUND)); + GroomingLevel groomingLevel = null; + if (user.getGroomingLevelId() != null) { + groomingLevel = + loadGroomingLevelForAuthPort + .loadGroomingLevelById(FindByIdQuery.of(user.getGroomingLevelId())) + .orElseThrow( + () -> + new CustomException( + ErrorResponseCode + .GROOMING_LEVEL_NOT_FOUND)); + } - return SocialLoginSuccessVo.from(user, AuthenticatedUserVo.of(user, image)); + return SocialLoginSuccessVo.from( + user, AuthenticatedUserVo.of(user, image, groomingLevel)); } // 가입된 회원이 아닌 경우 diff --git a/src/main/java/com/ftm/server/application/service/grooming/LoadGroomingTestHistoryDetailService.java b/src/main/java/com/ftm/server/application/service/grooming/LoadGroomingTestHistoryDetailService.java index 065d419..93078e3 100644 --- a/src/main/java/com/ftm/server/application/service/grooming/LoadGroomingTestHistoryDetailService.java +++ b/src/main/java/com/ftm/server/application/service/grooming/LoadGroomingTestHistoryDetailService.java @@ -6,7 +6,7 @@ import com.ftm.server.application.port.out.cache.LoadGroomingTestsWithCachePort; import com.ftm.server.application.port.out.persistence.grooming.LoadGroomingLevelPort; import com.ftm.server.application.port.out.persistence.grooming.LoadGroomingTestResultPort; -import com.ftm.server.application.query.FIndGroomingLevelByScoreQuery; +import com.ftm.server.application.query.FindGroomingLevelByScoreQuery; import com.ftm.server.application.query.FindGroomingTestResultByUserIdAndTestedAtQuery; import com.ftm.server.application.vo.grooming.*; import com.ftm.server.common.exception.CustomException; @@ -52,15 +52,16 @@ public GroomingTestHistoryDetailVo execute( GroomingTestResultGradesVo grades = calculateGrades(scores); GroomingLevel groomingLevel = loadGroomingLevelPort - .loadGroomingLevelByScore( - FIndGroomingLevelByScoreQuery.of(scores.getTotalScore())) + .loadGroomingLevelsByScore( + FindGroomingLevelByScoreQuery.of(scores.getTotalScore())) .orElseThrow( () -> new CustomException( ErrorResponseCode.GROOMING_LEVEL_NOT_FOUND)); - GroomingLevelVo level = GroomingLevelVo.from(groomingLevel); - return GroomingTestHistoryDetailVo.from(query.getTestedAt(), scores, grades, level); + GroomingLevelVo levelInfo = GroomingLevelVo.from(groomingLevel); + + return GroomingTestHistoryDetailVo.from(query.getTestedAt(), scores, grades, levelInfo); } // 점수 계산 diff --git a/src/main/java/com/ftm/server/application/service/grooming/SubmitGroomingTestService.java b/src/main/java/com/ftm/server/application/service/grooming/SubmitGroomingTestService.java index 971b7d8..332e007 100644 --- a/src/main/java/com/ftm/server/application/service/grooming/SubmitGroomingTestService.java +++ b/src/main/java/com/ftm/server/application/service/grooming/SubmitGroomingTestService.java @@ -6,7 +6,7 @@ import com.ftm.server.application.port.in.grooming.SubmitGroomingTestUseCase; import com.ftm.server.application.port.out.cache.LoadGroomingTestsWithCachePort; import com.ftm.server.application.port.out.persistence.grooming.LoadGroomingLevelPort; -import com.ftm.server.application.query.FIndGroomingLevelByScoreQuery; +import com.ftm.server.application.query.FindGroomingLevelByScoreQuery; import com.ftm.server.application.vo.grooming.*; import com.ftm.server.common.exception.CustomException; import com.ftm.server.common.response.enums.ErrorResponseCode; @@ -42,15 +42,16 @@ public GroomingTestResultVo execute(SubmitGroomingTestCommand command) { GroomingTestResultGradesVo grades = calculateGrades(scores); GroomingLevel groomingLevel = loadGroomingLevelPort - .loadGroomingLevelByScore( - FIndGroomingLevelByScoreQuery.of(scores.getTotalScore())) + .loadGroomingLevelsByScore( + FindGroomingLevelByScoreQuery.of(scores.getTotalScore())) .orElseThrow( () -> new CustomException( ErrorResponseCode.GROOMING_LEVEL_NOT_FOUND)); - GroomingLevelVo level = GroomingLevelVo.from(groomingLevel); - return GroomingTestResultVo.from(command.getUserId(), scores, grades, level); + GroomingLevelVo levelInfo = GroomingLevelVo.from(groomingLevel); + + return GroomingTestResultVo.from(command.getUserId(), scores, grades, levelInfo); } // 점수 계산 diff --git a/src/main/java/com/ftm/server/application/vo/auth/AuthenticatedUserVo.java b/src/main/java/com/ftm/server/application/vo/auth/AuthenticatedUserVo.java index d87d8b8..be67f85 100644 --- a/src/main/java/com/ftm/server/application/vo/auth/AuthenticatedUserVo.java +++ b/src/main/java/com/ftm/server/application/vo/auth/AuthenticatedUserVo.java @@ -12,8 +12,8 @@ public class AuthenticatedUserVo { private final Long id; private final String nickname; private final String profileImageUrl; - private final String mildLevelName; - private final String spicyLevelName; + private final String normalLevelName; + private final String truthLevelName; private AuthenticatedUserVo(User user, UserImage userImage, GroomingLevel groomingLevel) { this.id = user.getId(); @@ -23,8 +23,8 @@ private AuthenticatedUserVo(User user, UserImage userImage, GroomingLevel groomi + "/" + userImage .getObjectKey(); // TODO: 추후 CDN 주소 + getObjectKey() 로 변경해야함 -> 변경완료 - this.mildLevelName = groomingLevel != null ? groomingLevel.getMildLevelName() : null; - this.spicyLevelName = groomingLevel != null ? groomingLevel.getSpicyLevelName() : null; + this.normalLevelName = groomingLevel != null ? groomingLevel.getNormalModeName() : null; + this.truthLevelName = groomingLevel != null ? groomingLevel.getTruthModeName() : null; } // public static AuthenticatedUserVo of(User user, UserImage userImage) { @@ -32,7 +32,8 @@ private AuthenticatedUserVo(User user, UserImage userImage, GroomingLevel groomi // } // 추후 수정 필요 - public static AuthenticatedUserVo of(User user, UserImage userImage) { - return new AuthenticatedUserVo(user, userImage, null); + public static AuthenticatedUserVo of( + User user, UserImage userImage, GroomingLevel groomingLevel) { + return new AuthenticatedUserVo(user, userImage, groomingLevel); } } diff --git a/src/main/java/com/ftm/server/application/vo/grooming/GroomingLevelVo.java b/src/main/java/com/ftm/server/application/vo/grooming/GroomingLevelVo.java index 426e5d2..c9c5516 100644 --- a/src/main/java/com/ftm/server/application/vo/grooming/GroomingLevelVo.java +++ b/src/main/java/com/ftm/server/application/vo/grooming/GroomingLevelVo.java @@ -7,13 +7,49 @@ public class GroomingLevelVo { private final Long groomingLevelId; - private final String mildLevelName; - private final String spicyLevelName; + private final NormalModeLevel normalMode; + private final TruthModeLevel truthMode; + + @Getter + public static class NormalModeLevel { + + private final String name; + private final String summary; + private final String description; + + private NormalModeLevel(GroomingLevel groomingLevel) { + this.name = groomingLevel.getNormalModeName(); + this.summary = groomingLevel.getNormalModeSummary(); + this.description = groomingLevel.getNormalModeDescription(); + } + + public static NormalModeLevel of(GroomingLevel groomingLevel) { + return new NormalModeLevel(groomingLevel); + } + } + + @Getter + public static class TruthModeLevel { + + private final String name; + private final String summary; + private final String description; + + private TruthModeLevel(GroomingLevel groomingLevel) { + this.name = groomingLevel.getTruthModeName(); + this.summary = groomingLevel.getTruthModeSummary(); + this.description = groomingLevel.getTruthModeDescription(); + } + + public static TruthModeLevel of(GroomingLevel groomingLevel) { + return new TruthModeLevel(groomingLevel); + } + } private GroomingLevelVo(GroomingLevel groomingLevel) { this.groomingLevelId = groomingLevel.getId(); - this.mildLevelName = groomingLevel.getMildLevelName(); - this.spicyLevelName = groomingLevel.getSpicyLevelName(); + this.normalMode = NormalModeLevel.of(groomingLevel); + this.truthMode = TruthModeLevel.of(groomingLevel); } public static GroomingLevelVo from(GroomingLevel groomingLevel) { diff --git a/src/main/java/com/ftm/server/application/vo/user/SocialUserSignupSummaryVo.java b/src/main/java/com/ftm/server/application/vo/user/SocialUserSignupSummaryVo.java index 5c51bd2..ee356be 100644 --- a/src/main/java/com/ftm/server/application/vo/user/SocialUserSignupSummaryVo.java +++ b/src/main/java/com/ftm/server/application/vo/user/SocialUserSignupSummaryVo.java @@ -13,24 +13,21 @@ public class SocialUserSignupSummaryVo { private final String nickname; private final SocialProvider socialProvider; private final String profileImageUrl; - private final String mildLevelName; - private final String spicyLevelName; + private final String normalLevelName; + private final String truthLevelName; public static SocialUserSignupSummaryVo from( User user, String userImage, GroomingLevel groomingLevel) { - String mildLevelName = null; - String spicyLevelName = null; - if (groomingLevel != null) { - mildLevelName = groomingLevel.getMildLevelName(); - spicyLevelName = groomingLevel.getMildLevelName(); - } + String normalLevelName = groomingLevel != null ? groomingLevel.getNormalModeName() : null; + String truthLevelName = groomingLevel != null ? groomingLevel.getTruthModeName() : null; + return new SocialUserSignupSummaryVo( user, user.getId(), user.getNickname(), user.getSocialProvider(), PropertiesHolder.CDN_PATH + "/" + userImage, - mildLevelName, - spicyLevelName); + normalLevelName, + truthLevelName); } } diff --git a/src/main/java/com/ftm/server/domain/entity/GroomingLevel.java b/src/main/java/com/ftm/server/domain/entity/GroomingLevel.java index 3b794f2..9d2dfaa 100644 --- a/src/main/java/com/ftm/server/domain/entity/GroomingLevel.java +++ b/src/main/java/com/ftm/server/domain/entity/GroomingLevel.java @@ -15,23 +15,35 @@ public class GroomingLevel extends BaseTime { private Long id; private Integer minScore; private Integer maxScore; - private String mildLevelName; - private String spicyLevelName; + private String normalModeName; + private String normalModeSummary; + private String normalModeDescription; + private String truthModeName; + private String truthModeSummary; + private String truthModeDescription; @Builder(access = AccessLevel.PRIVATE) private GroomingLevel( Long id, Integer minScore, Integer maxScore, - String mildLevelName, - String spicyLevelName, + String normalModeName, + String normalModeSummary, + String normalModeDescription, + String truthModeName, + String truthModeSummary, + String truthModeDescription, LocalDateTime createdAt, LocalDateTime updatedAt) { this.id = id; this.minScore = minScore; this.maxScore = maxScore; - this.mildLevelName = mildLevelName; - this.spicyLevelName = spicyLevelName; + this.normalModeName = normalModeName; + this.normalModeSummary = normalModeSummary; + this.normalModeDescription = normalModeDescription; + this.truthModeName = truthModeName; + this.truthModeSummary = truthModeSummary; + this.truthModeDescription = truthModeDescription; this.createdAt = createdAt; this.updatedAt = updatedAt; } @@ -40,16 +52,24 @@ public static GroomingLevel of( Long id, Integer minScore, Integer maxScore, - String mildLevelName, - String spicyLevelName, + String normalModeName, + String normalModeSummary, + String normalModeDescription, + String truthModeName, + String truthModeSummary, + String truthModeDescription, LocalDateTime createdAt, LocalDateTime updatedAt) { return GroomingLevel.builder() .id(id) .minScore(minScore) .maxScore(maxScore) - .mildLevelName(mildLevelName) - .spicyLevelName(spicyLevelName) + .normalModeName(normalModeName) + .normalModeSummary(normalModeSummary) + .normalModeDescription(normalModeDescription) + .truthModeName(truthModeName) + .truthModeSummary(truthModeSummary) + .truthModeDescription(truthModeDescription) .createdAt(createdAt) .updatedAt(updatedAt) .build(); @@ -59,15 +79,27 @@ public static GroomingLevel create(SaveGroomingLevelCommand command) { return GroomingLevel.builder() .minScore(command.getMinScore()) .maxScore(command.getMaxScore()) - .mildLevelName(command.getMildLevelName()) - .spicyLevelName(command.getSpicyLevelName()) + .normalModeName(command.getNormalModeName()) + .normalModeSummary(command.getNormalModeSummary()) + .normalModeDescription(command.getNormalModeDescription()) + .truthModeName(command.getTruthModeName()) + .truthModeSummary(command.getTruthModeSummary()) + .truthModeDescription(command.getTruthModeDescription()) .build(); } public void update(UpdateGroomingLevelCommand command) { if (command.getMinScore() != null) this.minScore = command.getMinScore(); if (command.getMaxScore() != null) this.maxScore = command.getMaxScore(); - if (command.getMildLevelName() != null) this.mildLevelName = command.getMildLevelName(); - if (command.getSpicyLevelName() != null) this.spicyLevelName = command.getSpicyLevelName(); + if (command.getNormalModeName() != null) this.normalModeName = command.getNormalModeName(); + if (command.getNormalModeSummary() != null) + this.normalModeSummary = command.getNormalModeSummary(); + if (command.getNormalModeDescription() != null) + this.normalModeDescription = command.getNormalModeDescription(); + if (command.getTruthModeName() != null) this.truthModeName = command.getTruthModeName(); + if (command.getTruthModeSummary() != null) + this.truthModeSummary = command.getTruthModeSummary(); + if (command.getTruthModeDescription() != null) + this.truthModeDescription = command.getTruthModeDescription(); } } diff --git a/src/test/java/com/ftm/server/auth/GeneralLoginTest.java b/src/test/java/com/ftm/server/auth/GeneralLoginTest.java index b54584a..9fe6025 100644 --- a/src/test/java/com/ftm/server/auth/GeneralLoginTest.java +++ b/src/test/java/com/ftm/server/auth/GeneralLoginTest.java @@ -57,17 +57,17 @@ public class GeneralLoginTest extends BaseTest { fieldWithPath("data.profileImageUrl") .type(STRING) .description("유저 프로필 이미지 URL"), - fieldWithPath("data.mildLevelName") + fieldWithPath("data.normalLevelName") .type(STRING) .optional() - .description("순한맛 그루밍 레벨 이름") + .description("그루밍 레벨 일반모드 이름") .attributes( new Attributes.Attribute( "nullable", "그루밍 테스트를 아직 진행하지 않은 경우 null")), - fieldWithPath("data.spicyLevelName") + fieldWithPath("data.truthLevelName") .type(STRING) .optional() - .description("매운맛 그루밍 레벨 이름") + .description("그루밍 레벨 진심모드 이름") .attributes( new Attributes.Attribute( "nullable", "그루밍 테스트를 아직 진행하지 않은 경우 null")), diff --git a/src/test/java/com/ftm/server/auth/KakaoLoginTest.java b/src/test/java/com/ftm/server/auth/KakaoLoginTest.java index 833b9aa..b6b17e3 100644 --- a/src/test/java/com/ftm/server/auth/KakaoLoginTest.java +++ b/src/test/java/com/ftm/server/auth/KakaoLoginTest.java @@ -61,14 +61,14 @@ public class KakaoLoginTest extends BaseTest { fieldWithPath("data.profileImageUrl") .type(STRING) .description("유저 프로필 이미지 URL"), - fieldWithPath("data.mildLevelName") + fieldWithPath("data.normalLevelName") .type(STRING) .optional() - .description("순한맛 그루밍 레벨 이름"), - fieldWithPath("data.spicyLevelName") + .description("그루밍 레벨 일반모드 이름"), + fieldWithPath("data.truthLevelName") .type(STRING) .optional() - .description("매운맛 그루밍 레벨 이름"), + .description("그루밍 레벨 진심모드 이름"), fieldWithPath("data.loginTime").type(STRING).description("로그인 시간")); private ResultActions getResultActions(KakaoLoginRequest request) throws Exception { diff --git a/src/test/java/com/ftm/server/grooming/LoadGroomingTestHistoryDetailTest.java b/src/test/java/com/ftm/server/grooming/LoadGroomingTestHistoryDetailTest.java index b5fa792..6ace35d 100644 --- a/src/test/java/com/ftm/server/grooming/LoadGroomingTestHistoryDetailTest.java +++ b/src/test/java/com/ftm/server/grooming/LoadGroomingTestHistoryDetailTest.java @@ -111,12 +111,26 @@ public class LoadGroomingTestHistoryDetailTest extends BaseTest { fieldWithPath("data.level.groomingLevelId") .type(NUMBER) .description("그루밍 레벨 ID"), - fieldWithPath("data.level.mildLevelName") + fieldWithPath("data.level.normalMode").type(OBJECT).description("그루밍 레벨 일반모드"), + fieldWithPath("data.level.normalMode.name") .type(STRING) - .description("그루밍 레벨 순한맛 이름"), - fieldWithPath("data.level.spicyLevelName") + .description("그루밍 레벨 일반모드 이름"), + fieldWithPath("data.level.normalMode.summary") .type(STRING) - .description("그루밍 레벨 매운맛 이름")); + .description("그루밍 레벨 일반모드 요약"), + fieldWithPath("data.level.normalMode.description") + .type(STRING) + .description("그루밍 레벨 일반모드 설명"), + fieldWithPath("data.level.truthMode").type(OBJECT).description("그루밍 레벨 진심모드"), + fieldWithPath("data.level.truthMode.name") + .type(STRING) + .description("그루밍 레벨 진심모드 이름"), + fieldWithPath("data.level.truthMode.summary") + .type(STRING) + .description("그루밍 레벨 진심모드 요약"), + fieldWithPath("data.level.truthMode.description") + .type(STRING) + .description("그루밍 레벨 진심모드 설명")); private RestDocumentationResultHandler getDocument(Integer identifier) { return document( diff --git a/src/test/java/com/ftm/server/grooming/SubmitGroomingTestsTest.java b/src/test/java/com/ftm/server/grooming/SubmitGroomingTestsTest.java index 9abb425..cf1c5dd 100644 --- a/src/test/java/com/ftm/server/grooming/SubmitGroomingTestsTest.java +++ b/src/test/java/com/ftm/server/grooming/SubmitGroomingTestsTest.java @@ -102,12 +102,26 @@ public class SubmitGroomingTestsTest extends BaseTest { fieldWithPath("data.level.groomingLevelId") .type(NUMBER) .description("그루밍 레벨 ID"), - fieldWithPath("data.level.mildLevelName") + fieldWithPath("data.level.normalMode").type(OBJECT).description("그루밍 레벨 일반모드"), + fieldWithPath("data.level.normalMode.name") .type(STRING) - .description("그루밍 레벨 순한맛 이름"), - fieldWithPath("data.level.spicyLevelName") + .description("그루밍 레벨 일반모드 이름"), + fieldWithPath("data.level.normalMode.summary") .type(STRING) - .description("그루밍 레벨 매운맛 이름")); + .description("그루밍 레벨 일반모드 요약"), + fieldWithPath("data.level.normalMode.description") + .type(STRING) + .description("그루밍 레벨 일반모드 설명"), + fieldWithPath("data.level.truthMode").type(OBJECT).description("그루밍 레벨 진심모드"), + fieldWithPath("data.level.truthMode.name") + .type(STRING) + .description("그루밍 레벨 진심모드 이름"), + fieldWithPath("data.level.truthMode.summary") + .type(STRING) + .description("그루밍 레벨 진심모드 요약"), + fieldWithPath("data.level.truthMode.description") + .type(STRING) + .description("그루밍 레벨 진심모드 설명")); private GroomingTestSubmissionRequest getRequest() { List submissions = diff --git a/src/test/java/com/ftm/server/grooming/level/DeleteGroomingLevelTest.java b/src/test/java/com/ftm/server/grooming/level/DeleteGroomingLevelTest.java index 5893bc5..2df31a0 100644 --- a/src/test/java/com/ftm/server/grooming/level/DeleteGroomingLevelTest.java +++ b/src/test/java/com/ftm/server/grooming/level/DeleteGroomingLevelTest.java @@ -32,7 +32,16 @@ private ResultActions getResultActions(Long levelId, MockHttpSession session) th @BeforeEach void setUp() { - SaveGroomingLevelCommand command = SaveGroomingLevelCommand.of(0, 10, "테스트 순한맛", "테스트 매운맛"); + SaveGroomingLevelCommand command = + SaveGroomingLevelCommand.of( + 0, + 5, + "레벨 일반모드 이름", + "레벨 일반모드 요약", + "레벨 일반모드 설명", + "레벨 진심모드 이름", + "레벨 진심모드 요약", + "레벨 진심모드 설명"); GroomingLevel level = GroomingLevel.create(command); levelId = groomingLevelRepository.save(groomingLevelMapper.toJpaEntity(level)).getId(); } diff --git a/src/test/java/com/ftm/server/grooming/level/SaveGroomingLevelTest.java b/src/test/java/com/ftm/server/grooming/level/SaveGroomingLevelTest.java index 423f83a..969484e 100644 --- a/src/test/java/com/ftm/server/grooming/level/SaveGroomingLevelTest.java +++ b/src/test/java/com/ftm/server/grooming/level/SaveGroomingLevelTest.java @@ -29,7 +29,15 @@ private ResultActions getResultActions( void 그루밍_레벨_저장_성공() throws Exception { // given SaveGroomingLevelRequest request = - new SaveGroomingLevelRequest(0, 10, "테스트 순한맛", "테스트 매운맛"); + new SaveGroomingLevelRequest( + 0, + 5, + "레벨 일반모드 이름", + "레벨 일반모드 요약", + "레벨 일반모드 설명", + "레벨 진심모드 이름", + "레벨 진심모드 요약", + "레벨 진심모드 설명"); // when MockHttpSession session = createAdminUserAndLogin(); @@ -44,7 +52,15 @@ private ResultActions getResultActions( void 그루밍_레벨_저장_실패1() throws Exception { // given SaveGroomingLevelRequest request = - new SaveGroomingLevelRequest(0, 10, "테스트 순한맛", "테스트 매운맛"); + new SaveGroomingLevelRequest( + 0, + 10, + "레벨 일반모드 이름", + "레벨 일반모드 요약", + "레벨 일반모드 설명", + "레벨 진심모드 이름", + "레벨 진심모드 요약", + "레벨 진심모드 설명"); // when MockHttpSession session = createUserAndLogin(); @@ -61,7 +77,15 @@ private ResultActions getResultActions( void 그루밍_레벨_저장_실패2() throws Exception { // given SaveGroomingLevelRequest request = - new SaveGroomingLevelRequest(-1, 10, "테스트 순한맛", "테스트 매운맛"); + new SaveGroomingLevelRequest( + -1, + 10, + "레벨 일반모드 이름", + "레벨 일반모드 요약", + "레벨 일반모드 설명", + "레벨 진심모드 이름", + "레벨 진심모드 요약", + "레벨 진심모드 설명"); // when MockHttpSession session = createAdminUserAndLogin(); diff --git a/src/test/java/com/ftm/server/grooming/level/UpdateGroomingLevelTest.java b/src/test/java/com/ftm/server/grooming/level/UpdateGroomingLevelTest.java index 0b7c8e7..84fa00c 100644 --- a/src/test/java/com/ftm/server/grooming/level/UpdateGroomingLevelTest.java +++ b/src/test/java/com/ftm/server/grooming/level/UpdateGroomingLevelTest.java @@ -38,7 +38,16 @@ private ResultActions getResultActions( @BeforeEach void setUp() { - SaveGroomingLevelCommand command = SaveGroomingLevelCommand.of(0, 10, "테스트 순한맛", "테스트 매운맛"); + SaveGroomingLevelCommand command = + SaveGroomingLevelCommand.of( + 0, + 5, + "레벨 일반모드 이름", + "레벨 일반모드 요약", + "레벨 일반모드 설명", + "레벨 진심모드 이름", + "레벨 진심모드 요약", + "레벨 진심모드 설명"); GroomingLevel level = GroomingLevel.create(command); levelId = groomingLevelRepository.save(groomingLevelMapper.toJpaEntity(level)).getId(); } @@ -48,7 +57,15 @@ void setUp() { void 그루밍_레벨_수정_성공() throws Exception { // given UpdateGroomingLevelRequest request = - new UpdateGroomingLevelRequest(1, 9, "테스트 순한맛 수정", "테스트 매운맛 수정"); + new UpdateGroomingLevelRequest( + 1, + 9, + "레벨 일반모드 이름", + "레벨 일반모드 요약", + "레벨 일반모드 설명", + "레벨 진심모드 이름", + "레벨 진심모드 요약", + "레벨 진심모드 설명"); // when MockHttpSession session = createAdminUserAndLogin(); @@ -62,7 +79,8 @@ void setUp() { @Transactional void 그루밍_레벨_수정_실패1() throws Exception { // given - UpdateGroomingLevelRequest request = new UpdateGroomingLevelRequest(1, 9, null, null); + UpdateGroomingLevelRequest request = + new UpdateGroomingLevelRequest(1, 9, null, null, null, null, null, null); // when MockHttpSession session = createUserAndLogin(); @@ -78,7 +96,8 @@ void setUp() { @Transactional void 그루밍_레벨_수정_실패2() throws Exception { // given - UpdateGroomingLevelRequest request = new UpdateGroomingLevelRequest(null, null, null, null); + UpdateGroomingLevelRequest request = + new UpdateGroomingLevelRequest(1, 9, null, null, null, null, null, null); // when MockHttpSession session = createAdminUserAndLogin(); diff --git a/src/test/java/com/ftm/server/user/SocialUserSignupTest.java b/src/test/java/com/ftm/server/user/SocialUserSignupTest.java index 1cc0f68..7a3198d 100644 --- a/src/test/java/com/ftm/server/user/SocialUserSignupTest.java +++ b/src/test/java/com/ftm/server/user/SocialUserSignupTest.java @@ -65,16 +65,16 @@ public class SocialUserSignupTest extends BaseTest { fieldWithPath("data.profileImageUrl") .type(JsonFieldType.STRING) .description("프로필 이미지 url"), - fieldWithPath("data.mildLevelName") + fieldWithPath("data.normalLevelName") .type(JsonFieldType.STRING) - .description("그루밍 레벨 순한맛 이름") + .description("그루밍 레벨 일반모드 이름") .optional() .attributes( new Attributes.Attribute( "nullable", "그루밍 테스트를 아직 진행하지 않은 경우 null")), - fieldWithPath("data.spicyLevelName") + fieldWithPath("data.truthLevelName") .type(JsonFieldType.STRING) - .description("그루밍 레벨 매운맛 이름") + .description("그루밍 레벨 진심모드 이름") .optional() .attributes( new Attributes.Attribute(