-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
103 changed files
with
3,430 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/com/gdschongik/gdsc/domain/member/dto/response/MemberAccountInfoResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.gdschongik.gdsc.domain.member.dto.response; | ||
|
||
import com.gdschongik.gdsc.domain.member.domain.Member; | ||
|
||
public record MemberAccountInfoResponse(String name, String githubHandle) { | ||
public static MemberAccountInfoResponse of(Member member, String githubHandle) { | ||
return new MemberAccountInfoResponse(member.getName(), githubHandle); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/gdschongik/gdsc/domain/study/api/CommonStudyController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.gdschongik.gdsc.domain.study.api; | ||
|
||
import com.gdschongik.gdsc.domain.study.application.CommonStudyService; | ||
import com.gdschongik.gdsc.domain.study.dto.response.CommonStudyResponse; | ||
import com.gdschongik.gdsc.domain.study.dto.response.StudyAnnouncementResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "Common Study", description = "공통 스터디 API입니다.") | ||
@RestController | ||
@RequestMapping("/common/studies") | ||
@RequiredArgsConstructor | ||
public class CommonStudyController { | ||
|
||
private final CommonStudyService commonStudyService; | ||
|
||
@Operation(summary = "스터디 기본 정보 조회", description = "스터디 기본 정보를 조회합니다.") | ||
@GetMapping("/{studyId}") | ||
public ResponseEntity<CommonStudyResponse> getStudyInformation(@PathVariable Long studyId) { | ||
CommonStudyResponse response = commonStudyService.getStudyInformation(studyId); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
@Operation(summary = "스터디 공지 목록 조회", description = "스터디 공지 목록을 조회합니다.") | ||
@GetMapping("/{studyId}/announcements") | ||
public ResponseEntity<List<StudyAnnouncementResponse>> getStudyAnnouncements(@PathVariable Long studyId) { | ||
List<StudyAnnouncementResponse> response = commonStudyService.getStudyAnnouncements(studyId); | ||
return ResponseEntity.ok(response); | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
src/main/java/com/gdschongik/gdsc/domain/study/api/MentorStudyController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.gdschongik.gdsc.domain.study.api; | ||
|
||
import com.gdschongik.gdsc.domain.study.application.MentorStudyService; | ||
import com.gdschongik.gdsc.domain.study.dto.request.StudyAnnouncementCreateUpdateRequest; | ||
import com.gdschongik.gdsc.domain.study.dto.request.StudyUpdateRequest; | ||
import com.gdschongik.gdsc.domain.study.dto.response.MentorStudyResponse; | ||
import com.gdschongik.gdsc.domain.study.dto.response.StudyStudentResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@Tag(name = "Mentor Study", description = "멘토 스터디 API입니다.") | ||
@RestController | ||
@RequestMapping("/mentor/studies") | ||
@RequiredArgsConstructor | ||
public class MentorStudyController { | ||
|
||
private final MentorStudyService mentorStudyService; | ||
|
||
@Operation(summary = "스터디 정보 작성", description = "스터디 기본 정보와 상세 정보를 작성합니다.") | ||
@PatchMapping("/{studyId}") | ||
public ResponseEntity<Void> updateStudy(@PathVariable Long studyId, @RequestBody StudyUpdateRequest request) { | ||
mentorStudyService.updateStudy(studyId, request); | ||
return ResponseEntity.ok().build(); | ||
} | ||
|
||
@Operation(summary = "내 스터디 조회", description = "내가 멘토로 있는 스터디를 조회합니다.") | ||
@GetMapping("/me") | ||
public ResponseEntity<List<MentorStudyResponse>> getStudiesInCharge() { | ||
List<MentorStudyResponse> response = mentorStudyService.getStudiesInCharge(); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
@Operation(summary = "스터디 수강생 명단 조회", description = "해당 스터디의 수강생 명단을 조회합니다") | ||
@GetMapping("/{studyId}/students") | ||
public ResponseEntity<List<StudyStudentResponse>> getStudyStudents(@PathVariable Long studyId) { | ||
List<StudyStudentResponse> response = mentorStudyService.getStudyStudents(studyId); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
@Operation(summary = "스터디 공지 생성", description = "스터디의 공지사항을 생성합니다.") | ||
@PostMapping("/{studyId}/announcements") | ||
public ResponseEntity<Void> createStudyAnnouncement( | ||
@PathVariable Long studyId, @Valid @RequestBody StudyAnnouncementCreateUpdateRequest request) { | ||
mentorStudyService.createStudyAnnouncement(studyId, request); | ||
return ResponseEntity.ok().build(); | ||
} | ||
|
||
@Operation(summary = "스터디 공지 수정", description = "스터디의 공지사항을 수정합니다.") | ||
@PutMapping("/announcements/{studyAnnouncementId}") | ||
public ResponseEntity<Void> updateStudyAnnouncement( | ||
@PathVariable Long studyAnnouncementId, @Valid @RequestBody StudyAnnouncementCreateUpdateRequest request) { | ||
mentorStudyService.updateStudyAnnouncement(studyAnnouncementId, request); | ||
return ResponseEntity.ok().build(); | ||
} | ||
|
||
@Operation(summary = "스터디 공지 삭제", description = "스터디의 공지사항을 삭제합니다.") | ||
@DeleteMapping("/announcements/{studyAnnouncementId}") | ||
public ResponseEntity<Void> deleteStudyAnnouncement(@PathVariable Long studyAnnouncementId) { | ||
mentorStudyService.deleteStudyAnnouncement(studyAnnouncementId); | ||
return ResponseEntity.ok().build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.gdschongik.gdsc.domain.study.api; | ||
|
||
import com.gdschongik.gdsc.domain.study.application.StudentStudyService; | ||
import com.gdschongik.gdsc.domain.study.dto.request.StudyAttendCreateRequest; | ||
import com.gdschongik.gdsc.domain.study.dto.response.StudentMyCurrentStudyResponse; | ||
import com.gdschongik.gdsc.domain.study.dto.response.StudyApplicableResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "Student Study", description = "사용자 스터디 API입니다.") | ||
@RestController | ||
@RequestMapping("/studies") | ||
@RequiredArgsConstructor | ||
public class StudentStudyController { | ||
|
||
private final StudentStudyService studentStudyService; | ||
|
||
@Operation(summary = "신청 가능한 스터디 조회", description = "모집 기간 중에 있는 스터디를 조회합니다.") | ||
@GetMapping("/apply") | ||
public ResponseEntity<StudyApplicableResponse> getAllApplicableStudies() { | ||
StudyApplicableResponse response = studentStudyService.getAllApplicableStudies(); | ||
return ResponseEntity.ok().body(response); | ||
} | ||
|
||
@Operation(summary = "스터디 수강신청", description = "스터디에 수강신청 합니다. 모집 기간 중이어야 하고, 이미 수강 중인 스터디가 없어야 합니다.") | ||
@PostMapping("/apply/{studyId}") | ||
public ResponseEntity<Void> applyStudy(@PathVariable Long studyId) { | ||
studentStudyService.applyStudy(studyId); | ||
return ResponseEntity.ok().build(); | ||
} | ||
|
||
@Operation(summary = "스터디 수강신청 취소", description = "수강신청을 취소합니다. 스터디 수강신청 기간 중에만 취소할 수 있습니다.") | ||
@DeleteMapping("/apply/{studyId}") | ||
public ResponseEntity<Void> cancelStudyApply(@PathVariable Long studyId) { | ||
studentStudyService.cancelStudyApply(studyId); | ||
return ResponseEntity.noContent().build(); | ||
} | ||
|
||
@Operation(summary = "스터디 출석체크", description = "스터디에 출석체크합니다. 현재 진행중인 스터디 회차에 출석체크해야 하며, 중복출석체크할 수 없습니다.") | ||
@PostMapping("/study-details/{studyDetailId}/attend") | ||
public ResponseEntity<Void> attend( | ||
@PathVariable Long studyDetailId, @Valid @RequestBody StudyAttendCreateRequest request) { | ||
studentStudyService.attend(studyDetailId, request); | ||
return ResponseEntity.ok().build(); | ||
} | ||
|
||
@Operation(summary = "내 수강중인 스터디 조회", description = "나의 수강 중인 스터디를 조회합니다.") | ||
@GetMapping("/me/ongoing") | ||
public ResponseEntity<StudentMyCurrentStudyResponse> getMyCurrentStudy() { | ||
StudentMyCurrentStudyResponse response = studentStudyService.getMyCurrentStudy(); | ||
return ResponseEntity.ok(response); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/com/gdschongik/gdsc/domain/study/api/StudentStudyDetailController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.gdschongik.gdsc.domain.study.api; | ||
|
||
import com.gdschongik.gdsc.domain.study.application.StudentStudyDetailService; | ||
import com.gdschongik.gdsc.domain.study.dto.response.AssignmentDashboardResponse; | ||
import com.gdschongik.gdsc.domain.study.dto.response.AssignmentHistoryStatusResponse; | ||
import com.gdschongik.gdsc.domain.study.dto.response.StudyStudentSessionResponse; | ||
import com.gdschongik.gdsc.domain.study.dto.response.StudyTodoResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "Student Study Detail", description = "수강자 스터디 상세 API입니다.") | ||
@RestController | ||
@RequestMapping("/study-details") | ||
@RequiredArgsConstructor | ||
public class StudentStudyDetailController { | ||
|
||
private final StudentStudyDetailService studentStudyDetailService; | ||
|
||
@Operation(summary = "내 제출 가능한 과제 조회", description = "나의 제출 가능한 과제를 조회합니다.") | ||
@GetMapping("/assignments/dashboard") | ||
public ResponseEntity<AssignmentDashboardResponse> getSubmittableAssignments( | ||
@RequestParam(name = "studyId") Long studyId) { | ||
AssignmentDashboardResponse response = studentStudyDetailService.getSubmittableAssignments(studyId); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
@Operation(summary = "내 할일 리스트 조회", description = "해당 스터디의 내 할일 리스트를 조회합니다") | ||
@GetMapping("/todo") | ||
public ResponseEntity<List<StudyTodoResponse>> getStudyTodoList(@RequestParam(name = "studyId") Long studyId) { | ||
List<StudyTodoResponse> response = studentStudyDetailService.getStudyTodoList(studyId); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
// TODO 스터디 세션 워딩을 커리큘럼으로 변경해야함 | ||
@Operation(summary = "스터디 커리큘럼 조회", description = "해당 스터디의 커리큘럼들을 조회합니다.") | ||
@GetMapping("/sessions") | ||
public ResponseEntity<List<StudyStudentSessionResponse>> getStudySessions( | ||
@RequestParam(name = "studyId") Long studyId) { | ||
List<StudyStudentSessionResponse> response = studentStudyDetailService.getStudySessions(studyId); | ||
return ResponseEntity.ok(response); | ||
} | ||
|
||
@Operation(summary = "이번주 제출해야 할 과제 조회", description = "마감 기한이 이번주까지인 과제를 조회합니다.") | ||
@GetMapping("/assignments/upcoming") | ||
public ResponseEntity<List<AssignmentHistoryStatusResponse>> getUpcomingAssignments( | ||
@RequestParam(name = "studyId") Long studyId) { | ||
List<AssignmentHistoryStatusResponse> response = studentStudyDetailService.getUpcomingAssignments(studyId); | ||
return ResponseEntity.ok(response); | ||
} | ||
} |
Oops, something went wrong.