From 530af8d3d8c098f5710b67e6a1b961b0eb519ed2 Mon Sep 17 00:00:00 2001 From: SeYoE Date: Tue, 7 Nov 2023 18:03:01 +0900 Subject: [PATCH] =?UTF-8?q?Style:=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=ED=8F=AC=EB=A7=A4=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/academy/model/Academy.java | 23 ++++++++++++++----- .../domain/academy/model/ReviewCount.java | 8 +++---- .../global/aop/LoggingAspect.java | 8 +++---- .../academy/service/AcademyServiceTest.java | 14 ----------- .../member/service/MemberServiceTest.java | 11 --------- 5 files changed, 25 insertions(+), 39 deletions(-) diff --git a/src/main/java/org/guzzing/studayserver/domain/academy/model/Academy.java b/src/main/java/org/guzzing/studayserver/domain/academy/model/Academy.java index 8b08a11b..0e086a2b 100644 --- a/src/main/java/org/guzzing/studayserver/domain/academy/model/Academy.java +++ b/src/main/java/org/guzzing/studayserver/domain/academy/model/Academy.java @@ -1,7 +1,12 @@ package org.guzzing.studayserver.domain.academy.model; -import jakarta.persistence.*; - +import jakarta.persistence.Column; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; import java.util.Objects; import lombok.Getter; import org.guzzing.studayserver.domain.academy.model.vo.Address; @@ -28,7 +33,7 @@ public class Academy extends BaseEntity { @Embedded private Location location; - @Column(name="max_education_fee") + @Column(name = "max_education_fee") private Long maxEducationFee; private Point point; @@ -80,10 +85,16 @@ public void changePoint(Point point) { @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } Academy academy = (Academy) o; - return Objects.equals(id, academy.id) && Objects.equals(academyInfo, academy.academyInfo) && Objects.equals(fullAddress, academy.fullAddress) && Objects.equals(location, academy.location) && Objects.equals(maxEducationFee, academy.maxEducationFee) && Objects.equals(point, academy.point); + return Objects.equals(id, academy.id) && Objects.equals(academyInfo, academy.academyInfo) && Objects.equals( + fullAddress, academy.fullAddress) && Objects.equals(location, academy.location) && Objects.equals( + maxEducationFee, academy.maxEducationFee) && Objects.equals(point, academy.point); } @Override diff --git a/src/main/java/org/guzzing/studayserver/domain/academy/model/ReviewCount.java b/src/main/java/org/guzzing/studayserver/domain/academy/model/ReviewCount.java index 7c22d9a0..48768834 100644 --- a/src/main/java/org/guzzing/studayserver/domain/academy/model/ReviewCount.java +++ b/src/main/java/org/guzzing/studayserver/domain/academy/model/ReviewCount.java @@ -24,16 +24,16 @@ public class ReviewCount { @Column(nullable = false, name = "kindness_count") private int kindnessCount; - @Column(nullable = false,name = "good_facility_count") + @Column(nullable = false, name = "good_facility_count") private int goodFacilityCount; - @Column(nullable = false, name="cheap_fee_count") + @Column(nullable = false, name = "cheap_fee_count") private int cheapFeeCount; - @Column(nullable = false, name="good_management_count") + @Column(nullable = false, name = "good_management_count") private int goodManagementCount; - @Column(nullable = false, name="lovely_teaching_count") + @Column(nullable = false, name = "lovely_teaching_count") private int lovelyTeachingCount; @Column(nullable = false, name = "reviewers_count") diff --git a/src/main/java/org/guzzing/studayserver/global/aop/LoggingAspect.java b/src/main/java/org/guzzing/studayserver/global/aop/LoggingAspect.java index 21fac15b..11c460a5 100644 --- a/src/main/java/org/guzzing/studayserver/global/aop/LoggingAspect.java +++ b/src/main/java/org/guzzing/studayserver/global/aop/LoggingAspect.java @@ -15,7 +15,7 @@ @Component public class LoggingAspect { - private static final String FORMAT = "invoke method : {} - {} (elapsed time : {}) / {}"; + private static final String FORMAT = "invoke method : {} - {} ({}) / elapsed time : {}"; private static final double MILLI_SECOND_TO_SECOND_UNIT = 0.001; private static final double MAX_AFFORDABLE_TIME = 3; @@ -46,10 +46,10 @@ public Object printLog(ProceedingJoinPoint joinPoint) throws Throwable { private String getRequestUrl() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); HttpServletRequest request = attributes.getRequest(); - + String requestURI = request.getRequestURI(); String queryString = request.getQueryString(); - - return MessageFormat.format("{0}{1}", requestURI, queryString); + + return MessageFormat.format("{0}{1}", requestURI, queryString); } } \ No newline at end of file diff --git a/src/test/java/org/guzzing/studayserver/domain/academy/service/AcademyServiceTest.java b/src/test/java/org/guzzing/studayserver/domain/academy/service/AcademyServiceTest.java index 921972af..5fa9273f 100644 --- a/src/test/java/org/guzzing/studayserver/domain/academy/service/AcademyServiceTest.java +++ b/src/test/java/org/guzzing/studayserver/domain/academy/service/AcademyServiceTest.java @@ -1,25 +1,11 @@ package org.guzzing.studayserver.domain.academy.service; -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.List; import org.guzzing.studayserver.domain.academy.model.Academy; import org.guzzing.studayserver.domain.academy.model.Lesson; import org.guzzing.studayserver.domain.academy.model.ReviewCount; import org.guzzing.studayserver.domain.academy.repository.academy.AcademyRepository; import org.guzzing.studayserver.domain.academy.repository.lesson.LessonRepository; import org.guzzing.studayserver.domain.academy.repository.review.ReviewCountRepository; -import org.guzzing.studayserver.domain.academy.service.dto.param.AcademiesByNameParam; -import org.guzzing.studayserver.domain.academy.service.dto.result.AcademiesByLocationResults; -import org.guzzing.studayserver.domain.academy.service.dto.result.AcademiesByNameResult; -import org.guzzing.studayserver.domain.academy.service.dto.result.AcademiesByNameResults; -import org.guzzing.studayserver.domain.academy.service.dto.result.AcademyGetResult; -import org.guzzing.studayserver.domain.academy.service.dto.result.LessonGetResult; -import org.guzzing.studayserver.domain.academy.service.dto.result.ReviewPercentGetResult; -import org.guzzing.studayserver.testutil.fixture.academy.AcademyFixture; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; diff --git a/src/test/java/org/guzzing/studayserver/domain/member/service/MemberServiceTest.java b/src/test/java/org/guzzing/studayserver/domain/member/service/MemberServiceTest.java index b6f70c87..51040101 100644 --- a/src/test/java/org/guzzing/studayserver/domain/member/service/MemberServiceTest.java +++ b/src/test/java/org/guzzing/studayserver/domain/member/service/MemberServiceTest.java @@ -1,17 +1,6 @@ package org.guzzing.studayserver.domain.member.service; -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.List; -import org.guzzing.studayserver.domain.child.model.NickName; -import org.guzzing.studayserver.domain.member.model.Member; -import org.guzzing.studayserver.domain.member.model.vo.MemberProvider; -import org.guzzing.studayserver.domain.member.model.vo.RoleType; import org.guzzing.studayserver.domain.member.repository.MemberRepository; -import org.guzzing.studayserver.domain.member.service.param.MemberRegisterParam; -import org.guzzing.studayserver.domain.member.service.param.MemberRegisterParam.MemberAdditionalChildParam; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles;