From f4e94451a53cbde27619a96c349c0cd915692641 Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 00:11:40 +0900 Subject: [PATCH 01/10] =?UTF-8?q?Feat:=20=EC=8A=A4=ED=84=B0=EB=94=94=20?= =?UTF-8?q?=EC=B0=B8=EC=97=AC=EC=8B=9C=20=EC=9D=B8=EC=9B=90=20=EB=B0=98?= =?UTF-8?q?=EC=98=81=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=20-=20?= =?UTF-8?q?=EC=8A=A4=ED=84=B0=EB=94=94=20=EC=B0=B8=EC=97=AC=EC=8B=9C=20?= =?UTF-8?q?=ED=98=84=EC=A0=9C=20=EC=8A=A4=ED=84=B0=EB=94=94=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=ED=99=95=EC=9D=B8=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20-=20=EC=8A=A4=ED=84=B0=EB=94=94=20=EC=A0=95?= =?UTF-8?q?=EC=9B=90=20=EC=B4=88=EA=B3=BC=EC=8B=9C=20=EC=95=A0=EB=9F=AC=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80=20-=20=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=EB=94=94=20=EC=B0=B8=EC=97=AC=20=ED=9B=84=20=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=EB=94=94=20DB=EC=97=90=20=ED=98=84=EC=A0=9C=20?= =?UTF-8?q?=EC=B0=B8=EC=97=AC=20=EC=9D=B8=EC=9B=90=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umc/StudyFlexBE/dto/response/BaseResponseStatus.java | 4 ++++ src/main/java/com/umc/StudyFlexBE/entity/Study.java | 6 ++++++ src/main/java/com/umc/StudyFlexBE/service/StudyService.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/main/java/com/umc/StudyFlexBE/dto/response/BaseResponseStatus.java b/src/main/java/com/umc/StudyFlexBE/dto/response/BaseResponseStatus.java index f8b9f88..323348c 100644 --- a/src/main/java/com/umc/StudyFlexBE/dto/response/BaseResponseStatus.java +++ b/src/main/java/com/umc/StudyFlexBE/dto/response/BaseResponseStatus.java @@ -56,6 +56,10 @@ public enum BaseResponseStatus { INTERNAL_SERVER_ERROR(false, 500, "서버 내부 오류가 발생했습니다."), + /** + * 7XXX : Study + */ + FULL_STUDY_MEMBER(false, 7001, "스터디 맴버가 이미 가득 찼습니다.") ; diff --git a/src/main/java/com/umc/StudyFlexBE/entity/Study.java b/src/main/java/com/umc/StudyFlexBE/entity/Study.java index e4c9611..846ba4e 100644 --- a/src/main/java/com/umc/StudyFlexBE/entity/Study.java +++ b/src/main/java/com/umc/StudyFlexBE/entity/Study.java @@ -91,7 +91,13 @@ public Double getRankScore() { return rankScore; } + public int participationStudy(){ + if(++currentMembers == maxMembers){ + status = StudyStatus.COMPLETED; + } + return currentMembers; + } } diff --git a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java index e85f97c..16202eb 100644 --- a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java +++ b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java @@ -65,18 +65,23 @@ public StudyAuthorityType checkAuthority(Long studyId, Member member){ } + @Transactional public void participation(Long studyId, Member member){ Study study = studyRepository.findById(studyId).orElseThrow( () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) ); + if(study.getStatus().equals(StudyStatus.COMPLETED)){ + throw new BaseException(BaseResponseStatus.FULL_STUDY_MEMBER); + } StudyParticipation studyParticipation = StudyParticipation.builder() .study(study) .member(member) .build(); studyParticipationRepository.save(studyParticipation); + study.participationStudy(); } @Transactional From 2b79ec839e9cf3b73887661e37db2b529c478475 Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 00:31:23 +0900 Subject: [PATCH 02/10] =?UTF-8?q?Feat:=20Progress,=20Completed=20=EC=97=94?= =?UTF-8?q?=ED=8B=B0=ED=8B=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/umc/StudyFlexBE/entity/Completed.java | 23 +++++++++++++ .../com/umc/StudyFlexBE/entity/Progress.java | 34 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 src/main/java/com/umc/StudyFlexBE/entity/Completed.java create mode 100644 src/main/java/com/umc/StudyFlexBE/entity/Progress.java diff --git a/src/main/java/com/umc/StudyFlexBE/entity/Completed.java b/src/main/java/com/umc/StudyFlexBE/entity/Completed.java new file mode 100644 index 0000000..837a864 --- /dev/null +++ b/src/main/java/com/umc/StudyFlexBE/entity/Completed.java @@ -0,0 +1,23 @@ +package com.umc.StudyFlexBE.entity; + +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Getter +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Builder +public class Completed { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "progress_id") + private Progress progress; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "study_participation_id") + private StudyParticipation studyParticipation; +} diff --git a/src/main/java/com/umc/StudyFlexBE/entity/Progress.java b/src/main/java/com/umc/StudyFlexBE/entity/Progress.java new file mode 100644 index 0000000..bac4a03 --- /dev/null +++ b/src/main/java/com/umc/StudyFlexBE/entity/Progress.java @@ -0,0 +1,34 @@ +package com.umc.StudyFlexBE.entity; + +import jakarta.persistence.*; +import lombok.*; +import org.hibernate.annotations.ColumnDefault; +import org.hibernate.annotations.Fetch; +import org.springframework.boot.context.properties.bind.DefaultValue; + +import java.time.LocalDate; + +@Entity +@Getter +@Builder +@AllArgsConstructor +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Progress { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "start_date") + private LocalDate startDate; + + @Column(name = "completed_number") + @ColumnDefault("0") + private Integer completedNumber; + + private Integer week; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "study_id") + private Study study; + +} From a39748f3d5388d7265cf7c0f55c4db8658b6e73a Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 00:33:56 +0900 Subject: [PATCH 03/10] =?UTF-8?q?Feat:=20=EC=8A=A4=ED=84=B0=EB=94=94=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EC=8B=9C=20=EC=A3=BC=EC=B0=A8=EB=B3=84=20?= =?UTF-8?q?=EA=B8=B0=EC=B4=88=20=EC=A0=95=EB=B3=B4=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80=20-=20=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=EA=B8=B0=20=EC=83=9D=EC=84=B1=20=EC=8B=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=ED=95=9C=20=EC=A3=BC=EC=B0=A8=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=A5=B8=20=EA=B8=B0=EC=B4=88=20=EC=A0=95=EB=B3=B4=20=EB=94=94?= =?UTF-8?q?=EB=B9=84=20=EC=83=9D=EC=84=B1=20-=20Study,=20Progress=20?= =?UTF-8?q?=EA=B0=95=ED=95=9C=EC=97=B0=EA=B4=80=20=EA=B4=80=EA=B3=84=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/umc/StudyFlexBE/entity/Study.java | 5 +++ .../repository/ProgressRepository.java | 7 +++++ .../umc/StudyFlexBE/service/StudyService.java | 31 ++++++++++++++++++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java diff --git a/src/main/java/com/umc/StudyFlexBE/entity/Study.java b/src/main/java/com/umc/StudyFlexBE/entity/Study.java index 846ba4e..179ca62 100644 --- a/src/main/java/com/umc/StudyFlexBE/entity/Study.java +++ b/src/main/java/com/umc/StudyFlexBE/entity/Study.java @@ -76,6 +76,11 @@ public class Study { @OneToMany(mappedBy = "study", cascade = CascadeType.ALL, fetch = FetchType.EAGER) private List studyParticipationList = new ArrayList<>(); + @BatchSize(size = 100) + @Builder.Default + @OneToMany(mappedBy = "study", cascade = CascadeType.ALL, fetch = FetchType.EAGER) + private List progressList = new ArrayList<>(); + @Column(name = "total_progress_rate") private Double totalProgressRate; diff --git a/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java b/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java new file mode 100644 index 0000000..a676a4a --- /dev/null +++ b/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java @@ -0,0 +1,7 @@ +package com.umc.StudyFlexBE.repository; + +import com.umc.StudyFlexBE.entity.Progress; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ProgressRepository extends JpaRepository { +} diff --git a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java index 16202eb..c05ccb0 100644 --- a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java +++ b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java @@ -14,7 +14,9 @@ import java.io.File; import java.io.IOException; +import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -26,13 +28,22 @@ public class StudyService { private final StudyParticipationRepository studyParticipationRepository; private final StudyNoticeRepository studyNoticeRepository; private final CategoryRepository categoryRepository; + private final ProgressRepository progressRepository; + @Autowired - public StudyService(StudyRepository studyRepository, StudyParticipationRepository studyParticipationRepository, StudyNoticeRepository studyNoticeRepository, CategoryRepository categoryRepository) { + public StudyService( + StudyRepository studyRepository, + StudyParticipationRepository studyParticipationRepository, + StudyNoticeRepository studyNoticeRepository, + CategoryRepository categoryRepository, + ProgressRepository progressRepository + ) { this.studyRepository = studyRepository; this.studyParticipationRepository = studyParticipationRepository; this.studyNoticeRepository = studyNoticeRepository; this.categoryRepository = categoryRepository; + this.progressRepository = progressRepository; } public List getLatestStudies() { @@ -86,6 +97,8 @@ public void participation(Long studyId, Member member){ @Transactional public void createStudy(StudyReq studyReq, Member member){ + + //스터디 생성 로직 Category category = categoryRepository.findByName(studyReq.getCategoryName()) .orElseThrow(() -> new BaseException(BaseResponseStatus.NO_SUCH_CATEGORY)); @@ -102,6 +115,22 @@ public void createStudy(StudyReq studyReq, Member member){ .build(); studyRepository.save(study); + + // 스터디 주차별 정보 생성 로직 + List progressesList = new ArrayList<>(); + LocalDate today = LocalDate.now(); + + for(int i = 0; i < studyReq.getTargetWeek(); i++){ + progressesList.add( + Progress.builder() + .startDate(today.plusWeeks(i)) + .week(i+1) + .study(study) + .build() + ); + } + + progressRepository.saveAll(progressesList); } private String uploadImg(MultipartFile img, Long memberId) { From f0bc0292b710f7c9212d8811adfffe4dcb977320 Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 00:48:49 +0900 Subject: [PATCH 04/10] =?UTF-8?q?Feat:=20=EB=AA=A9=ED=91=9C=20=EC=A3=BC?= =?UTF-8?q?=EC=B0=A8,=20=EC=99=84=EB=A3=8C=20=EC=A3=BC=EC=B0=A8=20?= =?UTF-8?q?=EC=86=8D=EC=84=B1=20=EC=B6=94=EA=B0=80=20-=20=EC=A7=84?= =?UTF-8?q?=EC=B2=99=EB=8F=84=3D=20=EC=99=84=EB=A3=8C=EC=A3=BC=EC=B0=A8/?= =?UTF-8?q?=EB=AA=A9=ED=91=9C=EC=A3=BC=EC=B0=A8=20-=20=EC=83=88=20?= =?UTF-8?q?=EC=9D=B8=EC=9B=90=20=EC=B0=B8=EC=97=AC=EC=8B=9C=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EC=A3=BC=EC=B0=A8=20=EC=B4=88=EA=B8=B0=ED=99=94=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/umc/StudyFlexBE/entity/Study.java | 23 ++++++++++++------- .../umc/StudyFlexBE/service/StudyService.java | 4 ++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/umc/StudyFlexBE/entity/Study.java b/src/main/java/com/umc/StudyFlexBE/entity/Study.java index 179ca62..ff26168 100644 --- a/src/main/java/com/umc/StudyFlexBE/entity/Study.java +++ b/src/main/java/com/umc/StudyFlexBE/entity/Study.java @@ -39,7 +39,6 @@ public class Study { @Enumerated(EnumType.STRING) @Column(name = "study_status", columnDefinition = "ENUM('RECRUITING', 'COMPLETED')") - private StudyStatus status; @@ -70,6 +69,14 @@ public class Study { @Column(name = "study_hits") private BigInteger hits; + @Transient + private Double rankScore; + + @Column(name = "completed_week") + private Integer completedWeek; + + @Column(name = "targer_week") + private Integer targetWeek; @BatchSize(size = 100) @Builder.Default @@ -82,11 +89,6 @@ public class Study { private List progressList = new ArrayList<>(); - @Column(name = "total_progress_rate") - private Double totalProgressRate; - - @Transient - private Double rankScore; public void setRankScore(Double rankScore) { this.rankScore = rankScore; @@ -96,13 +98,18 @@ public Double getRankScore() { return rankScore; } - public int participationStudy(){ - if(++currentMembers == maxMembers){ + public int participationStudy() { + ++currentMembers; + if (currentMembers.equals(maxMembers)) { status = StudyStatus.COMPLETED; } + completedWeek = 0; return currentMembers; } + public Double getTotalProgressRate(){ + return (completedWeek*1.0)/targetWeek; + } } diff --git a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java index c05ccb0..eb26180 100644 --- a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java +++ b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java @@ -79,6 +79,7 @@ public StudyAuthorityType checkAuthority(Long studyId, Member member){ @Transactional public void participation(Long studyId, Member member){ + //스터디 참여 테이블에 반영 Study study = studyRepository.findById(studyId).orElseThrow( () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) ); @@ -92,6 +93,8 @@ public void participation(Long studyId, Member member){ .build(); studyParticipationRepository.save(studyParticipation); + + //스터디 현제 인원 변경 study.participationStudy(); } @@ -110,6 +113,7 @@ public void createStudy(StudyReq studyReq, Member member){ .name(studyReq.getStudyName()) .thumbnailUrl(uploadImg(studyReq.getThumbnailUrl(), member.getMember_id())) .maxMembers(studyReq.getMaxMembers()) + .targetWeek(studyReq.getTargetWeek()) .currentMembers(1) .completedAt(LocalDateTime.now().plusWeeks(studyReq.getTargetWeek())) .build(); From 672a1edf072cbd42fc928d3b22f675f430798df0 Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 01:04:38 +0900 Subject: [PATCH 05/10] =?UTF-8?q?Feat:=20Repository=20=EC=96=B4=EB=85=B8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EC=85=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StudyFlexBE/repository/StudyParticipationRepository.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/umc/StudyFlexBE/repository/StudyParticipationRepository.java b/src/main/java/com/umc/StudyFlexBE/repository/StudyParticipationRepository.java index 471bfc6..dc2b4d8 100644 --- a/src/main/java/com/umc/StudyFlexBE/repository/StudyParticipationRepository.java +++ b/src/main/java/com/umc/StudyFlexBE/repository/StudyParticipationRepository.java @@ -4,7 +4,9 @@ import com.umc.StudyFlexBE.entity.Study; import com.umc.StudyFlexBE.entity.StudyParticipation; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +@Repository public interface StudyParticipationRepository extends JpaRepository { boolean existsByStudyAndMember(Study study, Member member); } From b82d2e01aa7c99836a30a5e9c95cf424b6e5c379 Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 01:26:03 +0900 Subject: [PATCH 06/10] =?UTF-8?q?Feat:=20=ED=95=99=EC=8A=B5=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EC=A3=BC=EC=B0=A8=20=EC=84=A0=ED=83=9D=20API=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StudyController.java | 6 ++++ .../dto/response/BaseResponseStatus.java | 5 ++-- .../repository/CompletedRepository.java | 9 ++++++ .../repository/ProgressRepository.java | 6 ++++ .../StudyParticipationRepository.java | 3 ++ .../umc/StudyFlexBE/service/StudyService.java | 30 ++++++++++++++++++- 6 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/umc/StudyFlexBE/repository/CompletedRepository.java diff --git a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java index 40cbb11..1ae546b 100644 --- a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java +++ b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java @@ -95,4 +95,10 @@ public BaseResponse getStudyNotices(@PathVariable Long study_id, @Authenticat return new BaseResponse<>(BaseResponseStatus.SUCCESS,studyNotices); } + + @GetMapping("/app/studies/{study_id}/completed") + public BaseResponse checkCompletedStudyWeek(@PathVariable Long study_id, @RequestParam int week, @AuthenticationPrincipal Member member){ + studyService.checkCompletedStudyWeek(study_id,week,member); + return new BaseResponse<>(BaseResponseStatus.SUCCESS,"학습 완료 체크가 정상적으로 처리되었습니다."); + } } diff --git a/src/main/java/com/umc/StudyFlexBE/dto/response/BaseResponseStatus.java b/src/main/java/com/umc/StudyFlexBE/dto/response/BaseResponseStatus.java index 323348c..28ae301 100644 --- a/src/main/java/com/umc/StudyFlexBE/dto/response/BaseResponseStatus.java +++ b/src/main/java/com/umc/StudyFlexBE/dto/response/BaseResponseStatus.java @@ -59,8 +59,9 @@ public enum BaseResponseStatus { /** * 7XXX : Study */ - FULL_STUDY_MEMBER(false, 7001, "스터디 맴버가 이미 가득 찼습니다.") - + FULL_STUDY_MEMBER(false, 7001, "스터디 맴버가 이미 가득 찼습니다."), + NO_STUDY_PARTICIPANT(false,7002, "스터디 참여 맴버가 아닙니다."), + NO_SUCH_WEEK(false,7003, "해당 주차 학습을 찾을 수 없습니다.") ; private final boolean isSuccess; diff --git a/src/main/java/com/umc/StudyFlexBE/repository/CompletedRepository.java b/src/main/java/com/umc/StudyFlexBE/repository/CompletedRepository.java new file mode 100644 index 0000000..33f6e42 --- /dev/null +++ b/src/main/java/com/umc/StudyFlexBE/repository/CompletedRepository.java @@ -0,0 +1,9 @@ +package com.umc.StudyFlexBE.repository; + +import com.umc.StudyFlexBE.entity.Completed; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CompletedRepository extends JpaRepository { +} diff --git a/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java b/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java index a676a4a..7226164 100644 --- a/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java +++ b/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java @@ -1,7 +1,13 @@ package com.umc.StudyFlexBE.repository; import com.umc.StudyFlexBE.entity.Progress; +import com.umc.StudyFlexBE.entity.Study; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import java.util.Optional; + +@Repository public interface ProgressRepository extends JpaRepository { + Optional findByWeekAndStudy(int week, Study study); } diff --git a/src/main/java/com/umc/StudyFlexBE/repository/StudyParticipationRepository.java b/src/main/java/com/umc/StudyFlexBE/repository/StudyParticipationRepository.java index dc2b4d8..b993288 100644 --- a/src/main/java/com/umc/StudyFlexBE/repository/StudyParticipationRepository.java +++ b/src/main/java/com/umc/StudyFlexBE/repository/StudyParticipationRepository.java @@ -6,7 +6,10 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.Optional; + @Repository public interface StudyParticipationRepository extends JpaRepository { boolean existsByStudyAndMember(Study study, Member member); + Optional findByStudyAndMember(Study study, Member member); } diff --git a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java index eb26180..fcb6a7d 100644 --- a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java +++ b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java @@ -29,6 +29,7 @@ public class StudyService { private final StudyNoticeRepository studyNoticeRepository; private final CategoryRepository categoryRepository; private final ProgressRepository progressRepository; + private final CompletedRepository completedRepository; @Autowired @@ -37,13 +38,15 @@ public StudyService( StudyParticipationRepository studyParticipationRepository, StudyNoticeRepository studyNoticeRepository, CategoryRepository categoryRepository, - ProgressRepository progressRepository + ProgressRepository progressRepository, + CompletedRepository completedRepository ) { this.studyRepository = studyRepository; this.studyParticipationRepository = studyParticipationRepository; this.studyNoticeRepository = studyNoticeRepository; this.categoryRepository = categoryRepository; this.progressRepository = progressRepository; + this.completedRepository = completedRepository; } public List getLatestStudies() { @@ -237,4 +240,29 @@ public StudyNoticesInfoRes getStudyNotices(Long studyId, Member member) { .itemSize(studyNoticesRes.size()) .build(); } + + @Transactional + public void checkCompletedStudyWeek(long studyId, int week, Member member) { + Study study = studyRepository.findById(studyId).orElseThrow( + () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) + ); + + StudyParticipation studyParticipation = studyParticipationRepository.findByStudyAndMember(study, member).orElseThrow( + () -> new BaseException(BaseResponseStatus.NO_STUDY_PARTICIPANT) + ); + + Progress progress = progressRepository.findByWeekAndStudy(week, study).orElseThrow( + () -> new BaseException(BaseResponseStatus.NO_SUCH_WEEK) + ); + + + + completedRepository.save( + Completed.builder() + .studyParticipation(studyParticipation) + .progress(progress) + .build() + ); + + } } From 9a7259e09631180127e404f737cfb5769bf71d82 Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 17:42:19 +0900 Subject: [PATCH 07/10] =?UTF-8?q?Feat:=20=ED=95=99=EC=8A=B5=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EC=A3=BC=EC=B0=A8=20=EC=84=A0=ED=83=9D=20API=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20-=20=ED=95=99=EC=8A=B5=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EC=84=A0=ED=83=9D=EC=8B=9C=20=ED=95=B4=EB=8B=B9=20?= =?UTF-8?q?=EC=A3=BC=EC=B0=A8=20=EC=A0=95=EB=B3=B4=20=EB=B0=98=ED=99=98=20?= =?UTF-8?q?-=20=ED=95=99=EC=8A=B5=20=EC=99=84=EB=A3=8C=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=8B=9C=20=ED=95=B4=EB=8B=B9=20=EC=A3=BC=EC=B0=A8?= =?UTF-8?q?=20=EB=8D=B0=EC=9D=B4=ED=84=B0=EC=97=90=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umc/StudyFlexBE/controller/StudyController.java | 9 +++++++-- .../StudyFlexBE/dto/response/CompletedCheckReq.java | 13 +++++++++++++ .../java/com/umc/StudyFlexBE/entity/Progress.java | 6 ++++-- .../com/umc/StudyFlexBE/service/StudyService.java | 5 ++++- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/umc/StudyFlexBE/dto/response/CompletedCheckReq.java diff --git a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java index 1ae546b..f418f1f 100644 --- a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java +++ b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java @@ -98,7 +98,12 @@ public BaseResponse getStudyNotices(@PathVariable Long study_id, @Authenticat @GetMapping("/app/studies/{study_id}/completed") public BaseResponse checkCompletedStudyWeek(@PathVariable Long study_id, @RequestParam int week, @AuthenticationPrincipal Member member){ - studyService.checkCompletedStudyWeek(study_id,week,member); - return new BaseResponse<>(BaseResponseStatus.SUCCESS,"학습 완료 체크가 정상적으로 처리되었습니다."); + double progress = studyService.checkCompletedStudyWeek(study_id, week, member); + CompletedCheckReq req = CompletedCheckReq.builder() + .week(week) + .completed(true) + .progress(progress) + .build(); + return new BaseResponse<>(BaseResponseStatus.SUCCESS, req); } } diff --git a/src/main/java/com/umc/StudyFlexBE/dto/response/CompletedCheckReq.java b/src/main/java/com/umc/StudyFlexBE/dto/response/CompletedCheckReq.java new file mode 100644 index 0000000..8cc113b --- /dev/null +++ b/src/main/java/com/umc/StudyFlexBE/dto/response/CompletedCheckReq.java @@ -0,0 +1,13 @@ +package com.umc.StudyFlexBE.dto.response; + +import lombok.*; + +@Builder +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class CompletedCheckReq { + private int week; + private double progress; + private boolean completed; +} diff --git a/src/main/java/com/umc/StudyFlexBE/entity/Progress.java b/src/main/java/com/umc/StudyFlexBE/entity/Progress.java index bac4a03..86f2a3a 100644 --- a/src/main/java/com/umc/StudyFlexBE/entity/Progress.java +++ b/src/main/java/com/umc/StudyFlexBE/entity/Progress.java @@ -3,8 +3,6 @@ import jakarta.persistence.*; import lombok.*; import org.hibernate.annotations.ColumnDefault; -import org.hibernate.annotations.Fetch; -import org.springframework.boot.context.properties.bind.DefaultValue; import java.time.LocalDate; @@ -31,4 +29,8 @@ public class Progress { @JoinColumn(name = "study_id") private Study study; + public int addCompletedNumber(){ + return ++completedNumber; + } + } diff --git a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java index fcb6a7d..3c39092 100644 --- a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java +++ b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java @@ -242,7 +242,7 @@ public StudyNoticesInfoRes getStudyNotices(Long studyId, Member member) { } @Transactional - public void checkCompletedStudyWeek(long studyId, int week, Member member) { + public double checkCompletedStudyWeek(long studyId, int week, Member member) { Study study = studyRepository.findById(studyId).orElseThrow( () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) ); @@ -264,5 +264,8 @@ public void checkCompletedStudyWeek(long studyId, int week, Member member) { .build() ); + progress.addCompletedNumber(); + + return (progress.getCompletedNumber()*1.0)/study.getCurrentMembers(); } } From f89496561a0a753c278a27f80a55cf2563c7172e Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 17:53:04 +0900 Subject: [PATCH 08/10] =?UTF-8?q?Feat:=20=ED=95=99=EC=8A=B5=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EB=B0=98=ED=99=98=20=ED=98=95=EC=8B=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20-=20=ED=95=99=EC=8A=B5=20=EC=99=84=EB=A3=8C=20?= =?UTF-8?q?=EB=B0=98=ED=99=98=20=EC=84=9C=EB=B9=84=EC=8A=A4=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B0=98=ED=99=98=ED=98=95=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umc/StudyFlexBE/controller/StudyController.java | 9 ++------- .../{CompletedCheckReq.java => ProgressReq.java} | 7 +++++-- .../java/com/umc/StudyFlexBE/service/StudyService.java | 10 ++++++++-- 3 files changed, 15 insertions(+), 11 deletions(-) rename src/main/java/com/umc/StudyFlexBE/dto/response/{CompletedCheckReq.java => ProgressReq.java} (61%) diff --git a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java index f418f1f..918d2c3 100644 --- a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java +++ b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java @@ -98,12 +98,7 @@ public BaseResponse getStudyNotices(@PathVariable Long study_id, @Authenticat @GetMapping("/app/studies/{study_id}/completed") public BaseResponse checkCompletedStudyWeek(@PathVariable Long study_id, @RequestParam int week, @AuthenticationPrincipal Member member){ - double progress = studyService.checkCompletedStudyWeek(study_id, week, member); - CompletedCheckReq req = CompletedCheckReq.builder() - .week(week) - .completed(true) - .progress(progress) - .build(); - return new BaseResponse<>(BaseResponseStatus.SUCCESS, req); + ProgressReq progressReq = studyService.checkCompletedStudyWeek(study_id, week, member); + return new BaseResponse<>(BaseResponseStatus.SUCCESS, progressReq); } } diff --git a/src/main/java/com/umc/StudyFlexBE/dto/response/CompletedCheckReq.java b/src/main/java/com/umc/StudyFlexBE/dto/response/ProgressReq.java similarity index 61% rename from src/main/java/com/umc/StudyFlexBE/dto/response/CompletedCheckReq.java rename to src/main/java/com/umc/StudyFlexBE/dto/response/ProgressReq.java index 8cc113b..90f3d62 100644 --- a/src/main/java/com/umc/StudyFlexBE/dto/response/CompletedCheckReq.java +++ b/src/main/java/com/umc/StudyFlexBE/dto/response/ProgressReq.java @@ -2,12 +2,15 @@ import lombok.*; +import java.time.LocalDate; + @Builder @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor -public class CompletedCheckReq { +public class ProgressReq { private int week; - private double progress; + private LocalDate start_date; + private double participant_rate; private boolean completed; } diff --git a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java index 3c39092..5da16b0 100644 --- a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java +++ b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java @@ -242,7 +242,7 @@ public StudyNoticesInfoRes getStudyNotices(Long studyId, Member member) { } @Transactional - public double checkCompletedStudyWeek(long studyId, int week, Member member) { + public ProgressReq checkCompletedStudyWeek(long studyId, int week, Member member) { Study study = studyRepository.findById(studyId).orElseThrow( () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) ); @@ -266,6 +266,12 @@ public double checkCompletedStudyWeek(long studyId, int week, Member member) { progress.addCompletedNumber(); - return (progress.getCompletedNumber()*1.0)/study.getCurrentMembers(); + double rate = (progress.getCompletedNumber()*1.0)/study.getCurrentMembers(); + + return ProgressReq.builder() + .completed(true) + .participant_rate(rate) + .start_date(progress.getStartDate()) + .build(); } } From 8bf517e32bfab1f999434a8d22363334148a52df Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 18:13:59 +0900 Subject: [PATCH 09/10] =?UTF-8?q?Feat:=20=ED=95=99=EC=8A=B5=20=EC=A7=84?= =?UTF-8?q?=EB=8F=84=ED=91=9C=20=EC=A1=B0=ED=9A=8C=20API=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StudyController.java | 6 +++++ .../repository/CompletedRepository.java | 3 +++ .../repository/ProgressRepository.java | 2 ++ .../umc/StudyFlexBE/service/StudyService.java | 25 +++++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java index 918d2c3..e887bc0 100644 --- a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java +++ b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java @@ -101,4 +101,10 @@ public BaseResponse checkCompletedStudyWeek(@PathVariable Long study_id, @Req ProgressReq progressReq = studyService.checkCompletedStudyWeek(study_id, week, member); return new BaseResponse<>(BaseResponseStatus.SUCCESS, progressReq); } + + @GetMapping("/app/studies/{study_id}/progress") + public BaseResponse getStudyProgressList(@PathVariable Long study_id, @AuthenticationPrincipal Member member){ + List studyProgressList = studyService.getStudyProgressList(study_id, member); + return new BaseResponse<>(BaseResponseStatus.SUCCESS,studyProgressList); + } } diff --git a/src/main/java/com/umc/StudyFlexBE/repository/CompletedRepository.java b/src/main/java/com/umc/StudyFlexBE/repository/CompletedRepository.java index 33f6e42..311963b 100644 --- a/src/main/java/com/umc/StudyFlexBE/repository/CompletedRepository.java +++ b/src/main/java/com/umc/StudyFlexBE/repository/CompletedRepository.java @@ -1,9 +1,12 @@ package com.umc.StudyFlexBE.repository; import com.umc.StudyFlexBE.entity.Completed; +import com.umc.StudyFlexBE.entity.Progress; +import com.umc.StudyFlexBE.entity.StudyParticipation; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface CompletedRepository extends JpaRepository { + boolean existsByProgressAndStudyParticipation(Progress progress, StudyParticipation studyParticipation); } diff --git a/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java b/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java index 7226164..37d8371 100644 --- a/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java +++ b/src/main/java/com/umc/StudyFlexBE/repository/ProgressRepository.java @@ -5,9 +5,11 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; import java.util.Optional; @Repository public interface ProgressRepository extends JpaRepository { Optional findByWeekAndStudy(int week, Study study); + List findAllByStudy(Study study); } diff --git a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java index 5da16b0..b1a28bb 100644 --- a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java +++ b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java @@ -274,4 +274,29 @@ public ProgressReq checkCompletedStudyWeek(long studyId, int week, Member member .start_date(progress.getStartDate()) .build(); } + + public List getStudyProgressList(long studyId, Member member){ + Study study = studyRepository.findById(studyId).orElseThrow( + () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) + ); + + StudyParticipation studyParticipation = studyParticipationRepository.findByStudyAndMember(study, member).orElseThrow( + () -> new BaseException(BaseResponseStatus.NO_STUDY_PARTICIPANT) + ); + + return progressRepository.findAllByStudy(study) + .stream() + .map(progress -> { + boolean completed = completedRepository.existsByProgressAndStudyParticipation(progress, studyParticipation); + double rate = (progress.getCompletedNumber()*1.0)/study.getCurrentMembers(); + + return ProgressReq.builder() + .week(progress.getWeek()) + .completed(completed) + .start_date(progress.getStartDate()) + .participant_rate(rate) + .build(); + }).collect(Collectors.toList()); + + } } From fba732e6a40c5133fe4e8bcf0ddc57ae35b95ed0 Mon Sep 17 00:00:00 2001 From: jansoon Date: Sat, 6 Jan 2024 18:30:11 +0900 Subject: [PATCH 10/10] =?UTF-8?q?Feat:=20=EC=8A=A4=ED=84=B0=EB=94=94=20?= =?UTF-8?q?=EC=9D=B8=EC=9B=90=20=EB=B0=8F=20=EC=A7=84=EB=8F=84=20=ED=8D=BC?= =?UTF-8?q?=EC=84=BC=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20API=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StudyController.java | 10 ++++++-- .../{ProgressReq.java => ProgressRes.java} | 2 +- .../dto/response/StudyDetailRes.java | 15 ++++++++++++ .../umc/StudyFlexBE/service/StudyService.java | 23 +++++++++++++++---- 4 files changed, 43 insertions(+), 7 deletions(-) rename src/main/java/com/umc/StudyFlexBE/dto/response/{ProgressReq.java => ProgressRes.java} (91%) create mode 100644 src/main/java/com/umc/StudyFlexBE/dto/response/StudyDetailRes.java diff --git a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java index e887bc0..0757b18 100644 --- a/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java +++ b/src/main/java/com/umc/StudyFlexBE/controller/StudyController.java @@ -98,13 +98,19 @@ public BaseResponse getStudyNotices(@PathVariable Long study_id, @Authenticat @GetMapping("/app/studies/{study_id}/completed") public BaseResponse checkCompletedStudyWeek(@PathVariable Long study_id, @RequestParam int week, @AuthenticationPrincipal Member member){ - ProgressReq progressReq = studyService.checkCompletedStudyWeek(study_id, week, member); + ProgressRes progressReq = studyService.checkCompletedStudyWeek(study_id, week, member); return new BaseResponse<>(BaseResponseStatus.SUCCESS, progressReq); } @GetMapping("/app/studies/{study_id}/progress") public BaseResponse getStudyProgressList(@PathVariable Long study_id, @AuthenticationPrincipal Member member){ - List studyProgressList = studyService.getStudyProgressList(study_id, member); + List studyProgressList = studyService.getStudyProgressList(study_id, member); return new BaseResponse<>(BaseResponseStatus.SUCCESS,studyProgressList); } + + @GetMapping("/app/studies/{study_id}/details") + public BaseResponse getStudyDetail(@PathVariable Long study_id){ + StudyDetailRes studyDetail = studyService.getStudyDetail(study_id); + return new BaseResponse<>(BaseResponseStatus.SUCCESS,studyDetail); + } } diff --git a/src/main/java/com/umc/StudyFlexBE/dto/response/ProgressReq.java b/src/main/java/com/umc/StudyFlexBE/dto/response/ProgressRes.java similarity index 91% rename from src/main/java/com/umc/StudyFlexBE/dto/response/ProgressReq.java rename to src/main/java/com/umc/StudyFlexBE/dto/response/ProgressRes.java index 90f3d62..7ed1307 100644 --- a/src/main/java/com/umc/StudyFlexBE/dto/response/ProgressReq.java +++ b/src/main/java/com/umc/StudyFlexBE/dto/response/ProgressRes.java @@ -8,7 +8,7 @@ @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor -public class ProgressReq { +public class ProgressRes { private int week; private LocalDate start_date; private double participant_rate; diff --git a/src/main/java/com/umc/StudyFlexBE/dto/response/StudyDetailRes.java b/src/main/java/com/umc/StudyFlexBE/dto/response/StudyDetailRes.java new file mode 100644 index 0000000..2f782c8 --- /dev/null +++ b/src/main/java/com/umc/StudyFlexBE/dto/response/StudyDetailRes.java @@ -0,0 +1,15 @@ +package com.umc.StudyFlexBE.dto.response; + +import com.umc.StudyFlexBE.entity.StudyStatus; +import lombok.*; + +@Builder +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor +public class StudyDetailRes { + private int max_members; + private int current_members; + private StudyStatus study_status; + private double total_progress_rate; +} diff --git a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java index b1a28bb..dc567e9 100644 --- a/src/main/java/com/umc/StudyFlexBE/service/StudyService.java +++ b/src/main/java/com/umc/StudyFlexBE/service/StudyService.java @@ -242,7 +242,7 @@ public StudyNoticesInfoRes getStudyNotices(Long studyId, Member member) { } @Transactional - public ProgressReq checkCompletedStudyWeek(long studyId, int week, Member member) { + public ProgressRes checkCompletedStudyWeek(long studyId, int week, Member member) { Study study = studyRepository.findById(studyId).orElseThrow( () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) ); @@ -268,14 +268,14 @@ public ProgressReq checkCompletedStudyWeek(long studyId, int week, Member member double rate = (progress.getCompletedNumber()*1.0)/study.getCurrentMembers(); - return ProgressReq.builder() + return ProgressRes.builder() .completed(true) .participant_rate(rate) .start_date(progress.getStartDate()) .build(); } - public List getStudyProgressList(long studyId, Member member){ + public List getStudyProgressList(long studyId, Member member){ Study study = studyRepository.findById(studyId).orElseThrow( () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) ); @@ -290,7 +290,7 @@ public List getStudyProgressList(long studyId, Member member){ boolean completed = completedRepository.existsByProgressAndStudyParticipation(progress, studyParticipation); double rate = (progress.getCompletedNumber()*1.0)/study.getCurrentMembers(); - return ProgressReq.builder() + return ProgressRes.builder() .week(progress.getWeek()) .completed(completed) .start_date(progress.getStartDate()) @@ -299,4 +299,19 @@ public List getStudyProgressList(long studyId, Member member){ }).collect(Collectors.toList()); } + + public StudyDetailRes getStudyDetail(long studyId){ + Study study = studyRepository.findById(studyId).orElseThrow( + () -> new BaseException(BaseResponseStatus.NO_SUCH_STUDY) + ); + + double progress = (study.getCurrentMembers()*1.0)/study.getMaxMembers(); + + return StudyDetailRes.builder() + .max_members(study.getMaxMembers()) + .current_members(study.getCurrentMembers()) + .study_status(study.getStatus()) + .total_progress_rate(progress) + .build(); + } }