-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from DSM-Repo/notice
공지 조회 api 추가 및 스웨거 설정 변경
- Loading branch information
Showing
70 changed files
with
795 additions
and
205 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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/repo/whopper/application/feedback/usecase/FindFeedbackUseCase.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
2 changes: 1 addition & 1 deletion
2
...lication/file/impl/FileDeleteService.java → ...ation/file/service/FileDeleteService.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
2 changes: 1 addition & 1 deletion
2
...lication/file/impl/FileUploadService.java → ...ation/file/service/FileUploadService.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
2 changes: 1 addition & 1 deletion
2
...r/application/file/impl/ImageService.java → ...pplication/file/service/ImageService.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
2 changes: 1 addition & 1 deletion
2
...per/application/file/impl/PdfService.java → .../application/file/service/PdfService.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
2 changes: 1 addition & 1 deletion
2
...on/history/impl/CreateHistoryService.java → ...history/service/CreateHistoryService.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
2 changes: 1 addition & 1 deletion
2
...on/history/impl/DeleteHistoryService.java → ...history/service/DeleteHistoryService.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
2 changes: 1 addition & 1 deletion
2
...tion/history/impl/ViewHistoryService.java → ...n/history/service/ViewHistoryService.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
2 changes: 1 addition & 1 deletion
2
...impl/ChangeLibraryAccessRightService.java → ...vice/ChangeLibraryAccessRightService.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
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
8 changes: 0 additions & 8 deletions
8
src/main/java/com/repo/whopper/application/library/usecase/CreateLibraryUseCase.java
This file was deleted.
Oops, something went wrong.
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
src/main/java/com/repo/whopper/application/library/usecase/SaveLibraryUseCase.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.repo.whopper.application.library.usecase; | ||
|
||
import com.repo.whopper.common.http.dto.DataResponseInfo; | ||
import com.repo.whopper.interfaces.library.dto.LibraryElementDto; | ||
|
||
public interface SaveLibraryUseCase { | ||
void saveLibrary(Integer grade, String filePath, DataResponseInfo<LibraryElementDto.ResumeIndex> index); | ||
} |
2 changes: 1 addition & 1 deletion
2
...plication/major/impl/AddMajorService.java → ...cation/major/service/AddMajorService.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
2 changes: 1 addition & 1 deletion
2
...cation/major/impl/DeleteMajorService.java → ...ion/major/service/DeleteMajorService.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
4 changes: 2 additions & 2 deletions
4
...lication/major/impl/FindMajorService.java → ...ation/major/service/FindMajorService.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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/repo/whopper/application/major/usecase/FindMajorUseCase.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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/repo/whopper/application/notice/impl/FetchNoticeService.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,40 @@ | ||
package com.repo.whopper.application.notice.impl; | ||
|
||
import com.repo.whopper.application.notice.usecase.FetchNoticeUseCase; | ||
import com.repo.whopper.common.exception.notice.NoticeNotFoundException; | ||
import com.repo.whopper.common.http.dto.DataResponseInfo; | ||
import com.repo.whopper.domain.notice.NoticeModel; | ||
import com.repo.whopper.domain.notice.NoticeRepository; | ||
import com.repo.whopper.interfaces.notice.dto.response.NoticeDetailResponse; | ||
import com.repo.whopper.interfaces.notice.dto.response.NoticeResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class FetchNoticeService implements FetchNoticeUseCase { | ||
private final NoticeRepository noticeRepository; | ||
|
||
@Override | ||
@Transactional(readOnly = true) | ||
public NoticeDetailResponse fetchNoticeDetailResponse(String noticeId){ | ||
NoticeModel notice = noticeRepository.findById(noticeId) | ||
.orElseThrow(() -> NoticeNotFoundException.EXCEPTION); | ||
|
||
var newNotice = notice.checkNotice(); | ||
noticeRepository.save(newNotice); | ||
|
||
return new NoticeDetailResponse(notice); | ||
} | ||
|
||
@Override | ||
@Transactional(readOnly = true) | ||
public DataResponseInfo<NoticeResponse> fetchNotice() { | ||
var notice = noticeRepository.findAll(); | ||
|
||
return DataResponseInfo.of(notice | ||
.map(NoticeResponse::fromModel) | ||
.toList()); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/repo/whopper/application/notice/usecase/FetchNoticeUseCase.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,10 @@ | ||
package com.repo.whopper.application.notice.usecase; | ||
|
||
import com.repo.whopper.common.http.dto.DataResponseInfo; | ||
import com.repo.whopper.interfaces.notice.dto.response.NoticeDetailResponse; | ||
import com.repo.whopper.interfaces.notice.dto.response.NoticeResponse; | ||
|
||
public interface FetchNoticeUseCase { | ||
NoticeDetailResponse fetchNoticeDetailResponse(String noticeId); | ||
DataResponseInfo<NoticeResponse> fetchNotice(); | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/repo/whopper/application/notice/usecase/WriteNoticeUseCase.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,5 @@ | ||
package com.repo.whopper.application.notice.usecase; | ||
|
||
public interface WriteNoticeUseCase { | ||
void writeNotice(String title, String content); | ||
} |
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
22 changes: 0 additions & 22 deletions
22
src/main/java/com/repo/whopper/application/student/impl/GetCurrentUserInfoService.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
...ain/java/com/repo/whopper/application/student/service/FetchCurrentStudentInfoService.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,22 @@ | ||
package com.repo.whopper.application.student.service; | ||
|
||
import com.repo.whopper.application.student.usecase.FetchCurrentStudentInfoUseCase; | ||
import com.repo.whopper.interfaces.student.dto.CurrentStudentInfoResponse; | ||
import com.repo.whopper.application.student.component.CurrentStudent; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class FetchCurrentStudentInfoService implements FetchCurrentStudentInfoUseCase { | ||
private final CurrentStudent currentStudent; | ||
|
||
@Override | ||
public CurrentStudentInfoResponse fetch() { | ||
final var currentStudent = this.currentStudent.getStudent(); | ||
|
||
return CurrentStudentInfoResponse.fromStudentModel( | ||
currentStudent | ||
); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ain/java/com/repo/whopper/application/student/usecase/FetchCurrentStudentInfoUseCase.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,7 @@ | ||
package com.repo.whopper.application.student.usecase; | ||
|
||
import com.repo.whopper.interfaces.student.dto.CurrentStudentInfoResponse; | ||
|
||
public interface FetchCurrentStudentInfoUseCase { | ||
CurrentStudentInfoResponse fetch(); | ||
} |
8 changes: 0 additions & 8 deletions
8
src/main/java/com/repo/whopper/application/student/usecase/GetCurrentUserInfoUseCase.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...er/impl/GetCurrentTeacherInfoService.java → ...service/GetCurrentTeacherInfoService.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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/repo/whopper/common/exception/notice/NoticeNotFoundException.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,12 @@ | ||
package com.repo.whopper.common.exception.notice; | ||
|
||
import com.repo.whopper.common.error.exception.ErrorCode; | ||
import com.repo.whopper.common.error.exception.WhopperException; | ||
|
||
public class NoticeNotFoundException extends WhopperException { | ||
public static final WhopperException EXCEPTION = new NoticeNotFoundException(); | ||
|
||
private NoticeNotFoundException() { | ||
super(ErrorCode.NOTICE_NOT_FOUND); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ommon/http/response/DataResponseInfo.java → ...per/common/http/dto/DataResponseInfo.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,4 +1,4 @@ | ||
package com.repo.whopper.common.http.response; | ||
package com.repo.whopper.common.http.dto; | ||
|
||
import java.util.List; | ||
|
||
|
File renamed without changes.
Oops, something went wrong.