Skip to content

Commit

Permalink
recruits default 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
1224kang committed Jul 9, 2024
1 parent d25e0fc commit 4e42e00
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 245 deletions.
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/compiler.xml

This file was deleted.

17 changes: 0 additions & 17 deletions .idea/gradle.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/hamsung_project.iml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/jarRepositories.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/misc.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/modules.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules/hamsung_backend.hamsung_project.main.iml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules/hamsung_project.hamsung_project.main.iml

This file was deleted.

124 changes: 0 additions & 124 deletions .idea/uiDesigner.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/vcs.xml

This file was deleted.

5 changes: 3 additions & 2 deletions src/main/java/hamsung/hamsung_project/entity/Recruit.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ public class Recruit {
@Column(name="capacity")
private Integer capacity;

//추가
@Builder.Default()
@Column(name="isRecruit")
private Boolean isRecruit;
private Boolean isRecruit=false;

@Builder.Default()
@Column(name="view")
@ColumnDefault("0")
private Integer view=0;

//
Expand Down
21 changes: 13 additions & 8 deletions src/main/java/hamsung/hamsung_project/entity/Study.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ public class Study {
@Column(name="place")
private String place;

//추가//member_num 기본 1로 재설정.
@Column(name = "member_num")
@ColumnDefault("0")
@ColumnDefault("1")
@Builder.Default()
private Integer member_num=0;
private Integer member_num=1;

//스터디 진행중, 진행완료
//모집완료( 시부터 진행중
Expand All @@ -43,8 +44,11 @@ public class Study {
@Column(name = "end_date")
private LocalDate endDate;

//추가
@Column(name="score")
private Integer score;
@ColumnDefault("0")
@Builder.Default()
private Integer score=0;

@Column(name="leader_id",nullable = false)
private Long leader_id;
Expand All @@ -53,26 +57,27 @@ public class Study {
private String title;



//dto->entity
//추가//default 재설정
public static Study createStudyEntity(RecruitsRequestsDto requestsDto) {
return new Study(
null,
requestsDto.getCategory(),
requestsDto.getPlace(),
0, // members_num 기본값
null, // status 기본값
1, // members_num 기본값
false, // status 기본값
null, // startDate 기본값
null, //endDate 기본값
null, //score 기본값
0, //score 기본값
requestsDto.getUser_id(), //leader_id,
requestsDto.getTitle()
);
}

//추가 //title
public static Study updateStudy(RecruitsRequestsDto dto,Study study){
study.setCategory(dto.getCategory());
study.setPlace(dto.getPlace());
study.setTitle(dto.getTitle());

return study;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public boolean changeIsRecruit(Long id){
}
recruitsRepository.save(target);
target.getStudy().setStartDate(LocalDate.now());
target.getStudy().setStatus(true); //추가..
return target.getIsRecruit();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ public List<ApplyingSummaryDto> findAllAppliers(Long study_id) {
.orElseThrow(() -> new IllegalArgumentException("해당 스터디를 찾을 수 없어요."));

//studyMemberRepository에서 study_id FK로 찾기->studyMemberList를 applyingSummaryList로 바꿔줘야.
//아직 승인되지 않은 studyMember만 반환하도록 수정
List<StudyMember> StudyMemberList = studyMemberRepository.findByStudy_id(study_id);
List<ApplyingSummaryDto> summaryDtoList=new ArrayList<>();
for(StudyMember studyMember:StudyMemberList){
summaryDtoList.add(ApplyingSummaryDto.createSummaryDto(studyMember));
for (StudyMember studyMember : StudyMemberList) {
if (studyMember.getApproval() ==false) {
summaryDtoList.add(ApplyingSummaryDto.createSummaryDto(studyMember));
}
}

// ApplyingSummaryDto.summaryMembers(applyingList);
return summaryDtoList;
}
Expand Down

0 comments on commit 4e42e00

Please sign in to comment.