Skip to content

Commit 1c0ca72

Browse files
committed
Merge branch 'main' of https://github.com/prgrms-web-devcourse-final-project/WEB5_6_NeogulCoder_BE into refactor/recruitment-post-method-rename
2 parents 910bff6 + 1ffe461 commit 1c0ca72

File tree

27 files changed

+273
-119
lines changed

27 files changed

+273
-119
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:21-ea-oraclelinux8
1+
FROM openjdk:21-jdk-slim
22

33
# 타임존 설정
44
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime && \

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# WEB5_6_Neogul_Coder_BE
1+
# WEB5_6_Neogul_Coder_BE
2+
3+
## 서비스 소개
4+
5+
## 담당파트
6+
<img width="1238" height="501" alt="image" src="https://github.com/user-attachments/assets/65a7d211-349c-45bf-b5a8-601310ee38bc" />
7+
8+
## 시스템 아키텍처
9+
<img width="787" height="588" alt="image" src="https://github.com/user-attachments/assets/8c247cc3-0d78-4a2e-b71a-1b2cf69b3778" />
10+
11+
## ERD
12+
<img width="2780" height="1562" alt="WEB5_6_NeogulCoder_BE (8)" src="https://github.com/user-attachments/assets/5ad5ccad-fd23-4601-8e13-1b2b082e2b4a" />

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ dependencies {
9494

9595
// 이메일 전송 의존성
9696
implementation 'org.springframework.boot:spring-boot-starter-mail'
97+
98+
// s3
99+
implementation 'software.amazon.awssdk:s3:2.25.61'
97100
}
98101

99102
tasks.named('test') {

src/main/java/grep/neogulcoder/domain/admin/controller/AdminController.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
import grep.neogulcoder.domain.admin.controller.dto.response.AdminStudyResponse;
55
import grep.neogulcoder.domain.admin.controller.dto.response.AdminUserResponse;
66
import grep.neogulcoder.domain.admin.service.AdminService;
7+
import grep.neogulcoder.domain.recruitment.post.service.RecruitmentPostService;
78
import grep.neogulcoder.domain.study.enums.Category;
9+
import grep.neogulcoder.domain.study.service.StudyManagementService;
10+
import grep.neogulcoder.domain.users.service.UserService;
811
import grep.neogulcoder.global.response.ApiResponse;
912
import lombok.RequiredArgsConstructor;
1013
import org.springframework.data.domain.Page;
@@ -15,6 +18,7 @@
1518
import org.springframework.web.bind.annotation.DeleteMapping;
1619
import org.springframework.web.bind.annotation.GetMapping;
1720
import org.springframework.web.bind.annotation.PathVariable;
21+
import org.springframework.web.bind.annotation.PostMapping;
1822
import org.springframework.web.bind.annotation.RequestMapping;
1923
import org.springframework.web.bind.annotation.RequestParam;
2024
import org.springframework.web.bind.annotation.RestController;
@@ -26,6 +30,9 @@
2630
public class AdminController implements AdminSpecification {
2731

2832
private final AdminService adminService;
33+
private final UserService userService;
34+
private final StudyManagementService studyManagementService;
35+
private final RecruitmentPostService recruitmentPostService;
2936

3037
@GetMapping("/users")
3138
public ResponseEntity<ApiResponse<Page<AdminUserResponse>>> getUsers(
@@ -52,6 +59,24 @@ public ResponseEntity<ApiResponse<Page<AdminRecruitmentPostResponse>>> getRecrui
5259
return ResponseEntity.ok(ApiResponse.success(adminService.getAllRecruitmentPosts(page, subject)));
5360
}
5461

62+
@PostMapping("/reactive/user/{userId}")
63+
public ResponseEntity<ApiResponse<Void>> reactiveUser(@PathVariable("userId") Long userId) {
64+
userService.reactiveUser(userId);
65+
return ResponseEntity.ok(ApiResponse.success("회원이 다시 활성화 되었습니다."));
66+
}
67+
68+
@PostMapping("/reactive/study/{studyId}")
69+
public ResponseEntity<ApiResponse<Void>> reactiveStudy(@PathVariable("studyId") Long studyId) {
70+
studyManagementService.reactiveStudy(studyId);
71+
return ResponseEntity.ok(ApiResponse.success("스터디가 다시 활성화 되었습니다."));
72+
}
73+
74+
@PostMapping("/reactive/study/{recruitmentPostId}")
75+
public ResponseEntity<ApiResponse<Void>> reactiveRecruitmentPost(@PathVariable("recruitmentPostId") Long recruitmentPostId) {
76+
recruitmentPostService.reactivePost(recruitmentPostId);
77+
return ResponseEntity.ok(ApiResponse.success("모집글이 다시 활성화 되었습니다."));
78+
}
79+
5580
@DeleteMapping("/users/{userId}")
5681
public ResponseEntity<ApiResponse<Void>> deleteUser(@PathVariable Long userId) {
5782
adminService.deleteUser(userId);

src/main/java/grep/neogulcoder/domain/admin/service/AdminService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import grep.neogulcoder.domain.study.enums.Category;
1010
import grep.neogulcoder.domain.study.repository.StudyQueryRepository;
1111
import grep.neogulcoder.domain.study.repository.StudyRepository;
12+
import grep.neogulcoder.domain.users.entity.User;
1213
import grep.neogulcoder.domain.users.repository.UserRepository;
1314
import grep.neogulcoder.domain.users.service.UserService;
1415
import grep.neogulcoder.global.exception.business.NotFoundException;

src/main/java/grep/neogulcoder/domain/alram/service/AlarmService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public void acceptInvite(Long targetUserId, Long alarmId) {
126126
Long studyId = alarm.getDomainId();
127127
Study study = findValidStudy(studyId);
128128
studyMemberRepository.save(StudyMember.createMember(study, targetUserId));
129-
studyManagementServiceFacade.increaseMemberCount(study, targetUserId);
129+
studyManagementServiceFacade.increaseMemberCount(studyId, targetUserId);
130130
alarm.checkAlarm();
131131
}
132132

src/main/java/grep/neogulcoder/domain/recruitment/post/RecruitmentPost.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,8 @@ public void updateStatus(RecruitmentPostStatus status) {
6363
public void delete() {
6464
this.activated = false;
6565
}
66+
67+
public void reactive() {
68+
this.activated = true;
69+
}
6670
}

src/main/java/grep/neogulcoder/domain/recruitment/post/service/RecruitmentPostService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ public void delete(long recruitmentPostId, long userId) {
9999
recruitmentPost.delete();
100100
}
101101

102+
@Transactional
103+
public void reactivePost(Long recruitmentPostId) {
104+
RecruitmentPost recruitmentPost = postRepository.findByIdAndActivatedTrue(recruitmentPostId)
105+
.orElseThrow(() -> new NotFoundException(NOT_FOUND));
106+
recruitmentPost.reactive();
107+
}
108+
102109
private List<CommentsWithWriterInfo> findCommentsWithWriterInfo(RecruitmentPost post) {
103110
List<CommentsWithWriterInfo> comments = commentQueryRepository.findCommentsWithWriterInfo(post.getId());
104111
List<CommentsWithWriterInfo> withdrawnUserComments = withdrawnUserChangeNameFrom(comments);

src/main/java/grep/neogulcoder/domain/study/Study.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ public void finish() {
118118
this.finished = true;
119119
}
120120

121+
public void reactive() {
122+
this.activated = true;
123+
}
124+
121125
public boolean isReviewableAt(LocalDateTime currentDateTime) {
122126
LocalDateTime reviewableDateTime = this.endDate.plusDays(7);
123127

src/main/java/grep/neogulcoder/domain/study/controller/StudyController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public ResponseEntity<ApiResponse<List<StudyImageResponse>>> getStudyImages(@Aut
6060
public ResponseEntity<ApiResponse<StudyInfoResponse>> getStudyInfo(@PathVariable("studyId") Long studyId,
6161
@AuthenticationPrincipal Principal userDetails) {
6262
Long userId = userDetails.getUserId();
63-
return ResponseEntity.ok(ApiResponse.success(studyService.getMyStudyContent(studyId, userId)));
63+
return ResponseEntity.ok(ApiResponse.success(studyService.getStudyInfo(studyId, userId)));
6464
}
6565

6666
@GetMapping("/{studyId}/me")

0 commit comments

Comments
 (0)