From 17bbdd9c37364c13f35f6fba0cb7713f34b0a721 Mon Sep 17 00:00:00 2001 From: yang Date: Wed, 3 Jul 2024 02:33:56 +0900 Subject: [PATCH 1/5] =?UTF-8?q?RAC-403=20fix=20:=20totalInfo=20text?= =?UTF-8?q?=EC=97=90=EC=84=9C=20500=EC=9E=90=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/postgraduate/domain/senior/domain/entity/Info.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/postgraduate/domain/senior/domain/entity/Info.java b/src/main/java/com/postgraduate/domain/senior/domain/entity/Info.java index 0c475431..60d477a7 100644 --- a/src/main/java/com/postgraduate/domain/senior/domain/entity/Info.java +++ b/src/main/java/com/postgraduate/domain/senior/domain/entity/Info.java @@ -39,7 +39,7 @@ public class Info { @Builder.Default private Boolean etcPostgradu = false; - @Column(nullable = false, columnDefinition = "TEXT") + @Column(nullable = false, length = 500) private String totalInfo; // 모든 Info정보 String으로 가지는 컬럼 - 검색시 사용 @Column(columnDefinition = "TEXT") From a0d13625b5c3a0be8334f77ef498b74cd867dce6 Mon Sep 17 00:00:00 2001 From: yang Date: Wed, 3 Jul 2024 02:34:22 +0900 Subject: [PATCH 2/5] =?UTF-8?q?RAC-403=20fix=20:=20=EA=B8=B0=EC=A1=B4=20se?= =?UTF-8?q?nior=EC=97=90=20mentoringHit=20=EC=B6=94=EA=B0=80=20=EB=B0=8F?= =?UTF-8?q?=20=EC=9D=B8=EB=8D=B1=EC=8A=A4=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/senior/domain/entity/Senior.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/postgraduate/domain/senior/domain/entity/Senior.java b/src/main/java/com/postgraduate/domain/senior/domain/entity/Senior.java index 767f2730..5fecc444 100644 --- a/src/main/java/com/postgraduate/domain/senior/domain/entity/Senior.java +++ b/src/main/java/com/postgraduate/domain/senior/domain/entity/Senior.java @@ -22,7 +22,8 @@ @Index(name = "senior_field_index", columnList = "field"), @Index(name = "senior_etc_field_index", columnList = "etcField"), @Index(name = "senior_postgradu_index", columnList = "postgradu"), - @Index(name = "senior_etc_postgradu_index", columnList = "etcPostgradu") + @Index(name = "senior_etc_postgradu_index", columnList = "etcPostgradu"), + @Index(name = "senior_mentoring_hit_index", columnList = "mentoringHit") }) @Builder @AllArgsConstructor @@ -48,6 +49,9 @@ public class Senior { @Column(nullable = false) private int hit; + @Column(nullable = false) + private int mentoringHit; + @Embedded private Info info; @@ -80,4 +84,12 @@ public void updateStatus(Status status) { public void updateHit() { this.hit++; } + + public void plusMentoringHit() { + this.mentoringHit++; + } + + public void minusMentoringHit() { + this.mentoringHit--; + } } From c23f662cf3676fb25918a18ea032cb70b5a16d9e Mon Sep 17 00:00:00 2001 From: yang Date: Wed, 3 Jul 2024 02:34:49 +0900 Subject: [PATCH 3/5] =?UTF-8?q?RAC-403=20fix=20:=20mentoringHit=20?= =?UTF-8?q?=EC=A6=9D=EA=B0=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/usecase/MentoringApplyingUseCase.java | 9 ++++++++- .../application/usecase/MentoringManageUseCase.java | 4 ++++ .../senior/domain/service/SeniorUpdateService.java | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseCase.java b/src/main/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseCase.java index 5334dd70..23152a2c 100644 --- a/src/main/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseCase.java +++ b/src/main/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseCase.java @@ -12,6 +12,7 @@ import com.postgraduate.domain.payment.domain.entity.Payment; import com.postgraduate.domain.payment.domain.service.PaymentGetService; import com.postgraduate.domain.senior.domain.entity.Senior; +import com.postgraduate.domain.senior.domain.service.SeniorUpdateService; import com.postgraduate.domain.user.domain.entity.User; import com.postgraduate.global.bizppurio.application.usecase.BizppurioJuniorMessage; import com.postgraduate.global.bizppurio.application.usecase.BizppurioSeniorMessage; @@ -26,6 +27,7 @@ @Transactional public class MentoringApplyingUseCase { private final PaymentGetService paymentGetService; + private final SeniorUpdateService seniorUpdateService; private final MentoringGetService mentoringGetService; private final MentoringSaveService mentoringSaveService; private final AccountGetService accountGetService; @@ -41,9 +43,14 @@ public ApplyingResponse applyMentoringWithPayment(User user, MentoringApplyReque Senior senior = payment.getSenior(); Mentoring mentoring = MentoringMapper.mapToMentoring(user, senior, payment, request); mentoringSaveService.save(mentoring); + seniorUpdateService.plusMentoring(senior); Optional account = accountGetService.bySenior(senior); + sendMessage(user, senior); + return new ApplyingResponse(account.isPresent()); + } + + private void sendMessage(User user, Senior senior) { bizppurioJuniorMessage.mentoringApply(user); bizppurioSeniorMessage.mentoringApply(senior.getUser()); - return new ApplyingResponse(account.isPresent()); } } diff --git a/src/main/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseCase.java b/src/main/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseCase.java index ae7217d7..4e5580ea 100644 --- a/src/main/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseCase.java +++ b/src/main/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseCase.java @@ -20,6 +20,7 @@ import com.postgraduate.domain.salary.domain.service.SalaryUpdateService; import com.postgraduate.domain.senior.domain.entity.Senior; import com.postgraduate.domain.senior.domain.service.SeniorGetService; +import com.postgraduate.domain.senior.domain.service.SeniorUpdateService; import com.postgraduate.domain.user.domain.entity.User; import com.postgraduate.global.bizppurio.application.usecase.BizppurioJuniorMessage; import com.postgraduate.global.bizppurio.application.usecase.BizppurioSeniorMessage; @@ -47,6 +48,7 @@ public class MentoringManageUseCase { private final RefuseSaveService refuseSaveService; private final AccountGetService accountGetService; private final SeniorGetService seniorGetService; + private final SeniorUpdateService seniorUpdateService; private final SalaryGetService salaryGetService; private final SalaryUpdateService salaryUpdateService; private final PaymentManageUseCase paymentManageUseCase; @@ -76,6 +78,7 @@ public void updateCancel(User user, Long mentoringId) { Payment payment = mentoring.getPayment(); paymentManageUseCase.refundPayByUser(user, payment.getOrderId()); mentoringUpdateService.updateCancel(mentoring); + seniorUpdateService.minusMentoring(senior); bizppurioSeniorMessage.mentoringRefund(senior.getUser()); } @@ -98,6 +101,7 @@ public void updateRefuse(User user, Long mentoringId, MentoringRefuseRequest req Payment payment = mentoring.getPayment(); paymentManageUseCase.refundPayBySenior(senior, payment.getOrderId()); mentoringUpdateService.updateRefuse(mentoring); + seniorUpdateService.minusMentoring(senior); bizppurioJuniorMessage.mentoringRefuse(mentoring.getUser()); } diff --git a/src/main/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateService.java b/src/main/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateService.java index 16877e9e..980c48df 100644 --- a/src/main/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateService.java +++ b/src/main/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateService.java @@ -25,6 +25,14 @@ public void updateMyPageProfile(Senior senior, Info info, Profile profile) { senior.updateInfo(info); } + public void plusMentoring(Senior senior) { + senior.plusMentoringHit(); + } + + public void minusMentoring(Senior senior) { + senior.minusMentoringHit(); + } + public void updateHit(Senior senior) { senior.updateHit(); } From 6243e417ed0b17e4be05ee9c60f4730493eb8517 Mon Sep 17 00:00:00 2001 From: yang Date: Wed, 3 Jul 2024 02:35:17 +0900 Subject: [PATCH 4/5] =?UTF-8?q?RAC-403=20fix=20:=20=EC=84=A0=EB=B0=B0=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=EC=8B=9C=20=EB=A9=98=ED=86=A0=EB=A7=81=20?= =?UTF-8?q?=ED=9A=9F=EC=88=98=20=EC=A0=95=EB=A0=AC=20=EC=9A=B0=EC=84=A0?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/SeniorDslRepositoryImpl.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/postgraduate/domain/senior/domain/repository/SeniorDslRepositoryImpl.java b/src/main/java/com/postgraduate/domain/senior/domain/repository/SeniorDslRepositoryImpl.java index 505ecb8f..6c303f97 100644 --- a/src/main/java/com/postgraduate/domain/senior/domain/repository/SeniorDslRepositoryImpl.java +++ b/src/main/java/com/postgraduate/domain/senior/domain/repository/SeniorDslRepositoryImpl.java @@ -37,7 +37,7 @@ public class SeniorDslRepositoryImpl implements SeniorDslRepository{ @Override public Page findAllBySearchSenior(String search, String sort, Pageable pageable) { - List results = queryFactory.select(senior.seniorId, senior.user.nickName, senior.hit) + List results = queryFactory.select(senior.seniorId, senior.user.nickName, senior.hit, senior.mentoringHit) .from(senior) .distinct() .leftJoin(senior.user, user) @@ -46,7 +46,8 @@ public Page findAllBySearchSenior(String search, String sort, Pageable p .or(senior.user.nickName.like("%" + search + "%")), senior.user.isDelete.eq(FALSE) ) - .orderBy(orderSpecifier(sort)) + .orderBy(mentoringOrderSpecifier(sort)) + .orderBy(hitOrderSpecifier(sort)) .orderBy(senior.user.nickName.asc()) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) @@ -62,7 +63,8 @@ public Page findAllBySearchSenior(String search, String sort, Pageable p .toList())) .leftJoin(senior.user, user) .fetchJoin() - .orderBy(orderSpecifier(sort)) + .orderBy(mentoringOrderSpecifier(sort)) + .orderBy(hitOrderSpecifier(sort)) .orderBy(senior.user.nickName.asc()) .fetch(); @@ -81,7 +83,7 @@ public Page findAllBySearchSenior(String search, String sort, Pageable p return new PageImpl<>(seniors, pageable, total); } - private OrderSpecifier orderSpecifier(String sort) { + private OrderSpecifier hitOrderSpecifier(String sort) { if (sort == null) return new OrderSpecifier<>(DESC, senior.hit); if (sort.equals("low")) @@ -89,9 +91,18 @@ private OrderSpecifier orderSpecifier(String sort) { return new OrderSpecifier<>(DESC, senior.hit); } + private OrderSpecifier mentoringOrderSpecifier(String sort) { + if (sort == null) + return new OrderSpecifier<>(DESC, senior.mentoringHit); + if (sort.equals("low")) + return new OrderSpecifier<>(ASC, senior.mentoringHit); + return new OrderSpecifier<>(DESC, senior.mentoringHit); + } + + @Override public Page findAllByFieldSenior(String field, String postgradu, Pageable pageable) { - List results = queryFactory.select(senior.seniorId, senior.user.nickName, senior.hit) + List results = queryFactory.select(senior.seniorId, senior.user.nickName, senior.hit, senior.mentoringHit) .from(senior) .distinct() .leftJoin(senior.user, user) @@ -100,6 +111,7 @@ public Page findAllByFieldSenior(String field, String postgradu, Pageabl postgraduSpecifier(postgradu), senior.user.isDelete.eq(FALSE) ) + .orderBy(senior.mentoringHit.desc()) .orderBy(senior.hit.desc()) .orderBy(senior.user.nickName.asc()) .offset(pageable.getOffset()) @@ -116,6 +128,7 @@ public Page findAllByFieldSenior(String field, String postgradu, Pageabl .toList())) .leftJoin(senior.user, user) .fetchJoin() + .orderBy(senior.mentoringHit.desc()) .orderBy(senior.hit.desc()) .orderBy(senior.user.nickName.asc()) .fetch(); From 27748a802dd17ca511d7fff525d6d66f29f8c847 Mon Sep 17 00:00:00 2001 From: yang Date: Wed, 3 Jul 2024 02:35:27 +0900 Subject: [PATCH 5/5] =?UTF-8?q?RAC-403=20fix=20:=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EC=82=AC=ED=95=AD=EC=97=90=20=EB=94=B0=EB=A5=B8=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/usecase/oauth/SignUpUseTypeTest.java | 2 +- .../usecase/MentoringApplyingUseTypeTest.java | 5 ++++- .../usecase/MentoringManageUseTypeTest.java | 5 ++++- .../usecase/MentoringSeniorInfoUseTypeTest.java | 2 +- .../usecase/MentoringUserInfoUseTypeTest.java | 2 +- .../payment/usecase/PaymentManageUseTypeTest.java | 2 +- .../application/usecase/SeniorInfoUseTypeTest.java | 10 +++++----- .../application/usecase/SeniorManageUseTypeTest.java | 2 +- .../application/usecase/SeniorMyPageUseTypeTest.java | 6 +++--- .../senior/domain/service/SeniorUpdateServiceTest.java | 2 +- src/test/java/com/postgraduate/support/Resource.java | 4 ++-- 11 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/test/java/com/postgraduate/domain/auth/application/usecase/oauth/SignUpUseTypeTest.java b/src/test/java/com/postgraduate/domain/auth/application/usecase/oauth/SignUpUseTypeTest.java index 53f357b5..d19427cc 100644 --- a/src/test/java/com/postgraduate/domain/auth/application/usecase/oauth/SignUpUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/auth/application/usecase/oauth/SignUpUseTypeTest.java @@ -86,7 +86,7 @@ void setting() { 1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), FALSE); wish = new Wish(1L, "major", "field", TRUE, user, Status.WAITING); senior = new Senior(1L, user, "a", - APPROVE, 1, info, profile, + APPROVE,1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); } diff --git a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseTypeTest.java b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseTypeTest.java index 624ceca0..8d14d5ca 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringApplyingUseTypeTest.java @@ -16,6 +16,7 @@ import com.postgraduate.domain.senior.domain.entity.Info; import com.postgraduate.domain.senior.domain.entity.Profile; import com.postgraduate.domain.senior.domain.entity.Senior; +import com.postgraduate.domain.senior.domain.service.SeniorUpdateService; import com.postgraduate.domain.user.domain.entity.User; import com.postgraduate.global.bizppurio.application.usecase.BizppurioJuniorMessage; import com.postgraduate.global.bizppurio.application.usecase.BizppurioSeniorMessage; @@ -54,6 +55,8 @@ class MentoringApplyingUseTypeTest { @Mock private AccountGetService accountGetService; @Mock + private SeniorUpdateService seniorUpdateService; + @Mock private BizppurioSeniorMessage bizppurioSeniorMessage; @Mock private BizppurioJuniorMessage bizppurioJuniorMessage; @@ -80,7 +83,7 @@ void setting() { "a", "123", "a", 0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); senior = new Senior(-1L, user, "a", - APPROVE, 1, info, profile, + APPROVE,1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); salary = new Salary(-1L, FALSE, senior, 10000, LocalDate.now(), LocalDateTime.now(), null); account = new Account(-1L, "1", "은행", "유저", senior); diff --git a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseTypeTest.java b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseTypeTest.java index d5770e87..0176f725 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringManageUseTypeTest.java @@ -24,6 +24,7 @@ import com.postgraduate.domain.senior.domain.entity.Profile; import com.postgraduate.domain.senior.domain.entity.Senior; import com.postgraduate.domain.senior.domain.service.SeniorGetService; +import com.postgraduate.domain.senior.domain.service.SeniorUpdateService; import com.postgraduate.domain.user.domain.entity.User; import com.postgraduate.global.bizppurio.application.usecase.BizppurioJuniorMessage; import com.postgraduate.global.bizppurio.application.usecase.BizppurioSeniorMessage; @@ -65,6 +66,8 @@ class MentoringManageUseTypeTest { @Mock private SeniorGetService seniorGetService; @Mock + private SeniorUpdateService seniorUpdateService; + @Mock private SalaryGetService salaryGetService; @Mock private SalaryUpdateService salaryUpdateService; @@ -103,7 +106,7 @@ void setting() { "a", "123", "a", 0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); senior = new Senior(-1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); salary = new Salary(-1L, FALSE, senior, 10000, LocalDate.now(), LocalDateTime.now(), null); account = new Account(-1L, "1", "은행", "유저", senior); diff --git a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringSeniorInfoUseTypeTest.java b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringSeniorInfoUseTypeTest.java index 2b6ff171..5162ffb6 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringSeniorInfoUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringSeniorInfoUseTypeTest.java @@ -68,7 +68,7 @@ void setting() { "a", "123", "a", 0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); senior = new Senior(-1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); salary = new Salary(-1L, FALSE, senior, 10000, LocalDate.now(), LocalDateTime.now(), null); payment = new Payment(-1L, mentoringUser, senior, 20000, "a", "a", "a", LocalDateTime.now(), null, Status.DONE); diff --git a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringUserInfoUseTypeTest.java b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringUserInfoUseTypeTest.java index d4b98e8c..f05fafea 100644 --- a/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringUserInfoUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/mentoring/application/usecase/MentoringUserInfoUseTypeTest.java @@ -64,7 +64,7 @@ void setting() { "a", "123", "a", 0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); senior = new Senior(-1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1,1, info, profile, LocalDateTime.now(), LocalDateTime.now()); salary = new Salary(-1L, FALSE, senior, 10000, LocalDate.now(), LocalDateTime.now(), null); payment = new Payment(-1L, mentoringUser, senior, 20000, "a", "a", "a", LocalDateTime.now(), null, Status.DONE); diff --git a/src/test/java/com/postgraduate/domain/payment/usecase/PaymentManageUseTypeTest.java b/src/test/java/com/postgraduate/domain/payment/usecase/PaymentManageUseTypeTest.java index 8b093cbe..c5310fd1 100644 --- a/src/test/java/com/postgraduate/domain/payment/usecase/PaymentManageUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/payment/usecase/PaymentManageUseTypeTest.java @@ -68,7 +68,7 @@ void setting() { "a", "123", "a", 0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); senior = new Senior(-1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1,1, info, profile, LocalDateTime.now(), LocalDateTime.now()); } diff --git a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorInfoUseTypeTest.java b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorInfoUseTypeTest.java index b310378b..7782af95 100644 --- a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorInfoUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorInfoUseTypeTest.java @@ -62,7 +62,7 @@ void setting() { "a", "12345", "a", 1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); senior = new Senior(1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); } @@ -92,7 +92,7 @@ void getSeniorDetail() { @DisplayName("검색어 기본 페이지 조회") void getSearchSeniorWithNull() { Senior otherSenior = new Senior(-2L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); List seniors = List.of(senior, otherSenior); Page seniorPage = new PageImpl<>(seniors); @@ -110,7 +110,7 @@ void getSearchSeniorWithNull() { @DisplayName("검색어 페이지 조회") void getSearchSeniorWithPage() { Senior senior1 = new Senior(1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); List seniors = List.of(senior, senior1); Page seniorPage = new PageImpl<>(seniors); @@ -128,7 +128,7 @@ void getSearchSeniorWithPage() { @DisplayName("필터 기본 페이지 조회") void getFieldSeniorWithNull() { Senior senior1 = new Senior(1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1,info, profile, LocalDateTime.now(), LocalDateTime.now()); List seniors = List.of(senior, senior1); Page seniorPage = new PageImpl<>(seniors); @@ -146,7 +146,7 @@ void getFieldSeniorWithNull() { @DisplayName("필터 페이지 조회") void getFieldSeniorWithPage() { Senior senior1 = new Senior(1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); List seniors = List.of(senior, senior1); Page seniorPage = new PageImpl<>(seniors); diff --git a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorManageUseTypeTest.java b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorManageUseTypeTest.java index 8eb12465..58cdc9f6 100644 --- a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorManageUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorManageUseTypeTest.java @@ -91,7 +91,7 @@ void setting() { "a", "123", "a", 1, SENIOR, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); senior = new Senior(1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); } diff --git a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorMyPageUseTypeTest.java b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorMyPageUseTypeTest.java index 5ad9afa4..048d3aeb 100644 --- a/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorMyPageUseTypeTest.java +++ b/src/test/java/com/postgraduate/domain/senior/application/usecase/SeniorMyPageUseTypeTest.java @@ -69,14 +69,14 @@ void setting() { "a", "123", "a", 1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE); senior = new Senior(1L, user, "a", - APPROVE, 1, info, profile, + APPROVE, 1, 1, info, profile, LocalDateTime.now(), LocalDateTime.now()); } @Test @DisplayName("Profile Null 선배 자신의 정보 조회") void getSeniorInfoWithNullProfile() { - senior = new Senior(1L, user, "a", WAITING, 1, info, null, LocalDateTime.now(), LocalDateTime.now()); + senior = new Senior(1L, user, "a", WAITING, 1, 1, info, null, LocalDateTime.now(), LocalDateTime.now()); given(seniorGetService.byUser(user)) .willReturn(senior); @@ -121,7 +121,7 @@ void getSeniorMyPageProfile() { @Test @DisplayName("선배 자신의 마이페이지 프로필 작성 이전 Info조회 테스트") void getSeniorMyPageProfileWithNull() { - Senior nullSenior = new Senior(-2L, user, "asd", APPROVE, 1, info, null, LocalDateTime.now(), null); + Senior nullSenior = new Senior(-2L, user, "asd", APPROVE, 1, 1, info, null, LocalDateTime.now(), null); given(seniorGetService.byUser(user)) .willReturn(nullSenior); diff --git a/src/test/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateServiceTest.java b/src/test/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateServiceTest.java index 45eda6d6..f282c1a2 100644 --- a/src/test/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateServiceTest.java +++ b/src/test/java/com/postgraduate/domain/senior/domain/service/SeniorUpdateServiceTest.java @@ -33,7 +33,7 @@ class SeniorUpdateServiceTest { private Senior senior; @BeforeEach void setting() { - senior = new Senior(1L, user, "a", Status.WAITING, 100, new Info(), new Profile(), now(), now()); + senior = new Senior(1L, user, "a", Status.WAITING, 1, 100, new Info(), new Profile(), now(), now()); } @Test diff --git a/src/test/java/com/postgraduate/support/Resource.java b/src/test/java/com/postgraduate/support/Resource.java index 049d88c8..614456af 100644 --- a/src/test/java/com/postgraduate/support/Resource.java +++ b/src/test/java/com/postgraduate/support/Resource.java @@ -32,8 +32,8 @@ public class Resource { private User userOfSenior = new User(-2L, -2L, "mail", "선배", "012", "profile", 0, SENIOR, true, now(), now(), false); private Info info = new Info("major", "서울대학교", "교수님", "키워드1,키워드2", "랩실", "인공지능", false, false, "인공지능,키워드1,키워드2", "chatLink", 30); private Profile profile = new Profile("저는요", "한줄소개", "대상"); - private Senior senior = new Senior(-1L, userOfSenior, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, info, profile, now(), now()); - private Senior otherSenior = new Senior(-3L, otherUser, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, info, null, now(), now()); + private Senior senior = new Senior(-1L, userOfSenior, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, 0, info, profile, now(), now()); + private Senior otherSenior = new Senior(-3L, otherUser, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, 0, info, null, now(), now()); private SalaryAccount salaryAccount = new SalaryAccount("bank", "1234", "holder"); private Salary salary = new Salary(-1L, false, senior, 20000, getSalaryDate(), LocalDateTime.now(), salaryAccount); private Payment payment = new Payment(-1L, user, senior, 20000, "1", "123", "123", LocalDateTime.now(), LocalDateTime.now(), DONE);