-
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.
* feat: 스터디 공지 생성,수정,삭제 API 추가 * refactor: spotless적용 * style: 스터디 명단조회 API와 스터디 공지 생성 API 코드 순서 변경 * refactor: 스터디 공지 테이블명 StudyNotification에서 StudyAnnouncement로 수정 * refactor: 스터디 공지 수정 PUT메소드로 변경 * refactor: 스터디 공지 생성 수정 리퀘스트명 변경
- Loading branch information
Showing
10 changed files
with
132 additions
and
7 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
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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/gdschongik/gdsc/domain/study/dao/StudyAnnouncementRepository.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,14 @@ | ||
package com.gdschongik.gdsc.domain.study.dao; | ||
|
||
import static com.gdschongik.gdsc.global.exception.ErrorCode.STUDY_ANNOUNCEMENT_NOT_FOUND; | ||
|
||
import com.gdschongik.gdsc.domain.study.domain.StudyAnnouncement; | ||
import com.gdschongik.gdsc.global.exception.CustomException; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface StudyAnnouncementRepository extends JpaRepository<StudyAnnouncement, Long> { | ||
|
||
default StudyAnnouncement getById(Long id) { | ||
return findById(id).orElseThrow(() -> new CustomException(STUDY_ANNOUNCEMENT_NOT_FOUND)); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/gdschongik/gdsc/domain/study/dao/StudyRepository.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 |
---|---|---|
@@ -1,11 +1,18 @@ | ||
package com.gdschongik.gdsc.domain.study.dao; | ||
|
||
import static com.gdschongik.gdsc.global.exception.ErrorCode.STUDY_NOT_FOUND; | ||
|
||
import com.gdschongik.gdsc.domain.member.domain.Member; | ||
import com.gdschongik.gdsc.domain.study.domain.Study; | ||
import com.gdschongik.gdsc.global.exception.CustomException; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface StudyRepository extends JpaRepository<Study, Long> { | ||
|
||
default Study getById(Long id) { | ||
return findById(id).orElseThrow(() -> new CustomException(STUDY_NOT_FOUND)); | ||
} | ||
|
||
List<Study> findAllByMentor(Member mentor); | ||
} |
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
8 changes: 8 additions & 0 deletions
8
...va/com/gdschongik/gdsc/domain/study/dto/request/StudyAnnouncementCreateUpdateRequest.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,8 @@ | ||
package com.gdschongik.gdsc.domain.study.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record StudyAnnouncementCreateUpdateRequest( | ||
@NotBlank(message = "공지제목이 비었습니다.") @Schema(description = "공지제목") String title, | ||
@Schema(description = "공지링크") String link) {} |
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