-
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.
- Loading branch information
Showing
9 changed files
with
39 additions
and
81 deletions.
There are no files selected for viewing
15 changes: 13 additions & 2 deletions
15
...cation/notice/impl/EditNoticeService.java → ...tion/notice/impl/ChangeNoticeService.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
3 changes: 2 additions & 1 deletion
3
...ion/notice/usecase/EditNoticeUseCase.java → ...n/notice/usecase/ChangeNoticeUseCase.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,5 +1,6 @@ | ||
package com.repo.whopper.application.notice.usecase; | ||
|
||
public interface EditNoticeUseCase { | ||
public interface ChangeNoticeUseCase { | ||
void checkNotice(String noticeId); | ||
void editNotice(String noticeId, String title, String content); | ||
} |
2 changes: 0 additions & 2 deletions
2
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
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(); | ||
} |
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
16 changes: 11 additions & 5 deletions
16
...terfaces/notice/EditNoticeController.java → ...rfaces/notice/ChangeNoticeController.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,25 +1,31 @@ | ||
package com.repo.whopper.interfaces.notice; | ||
|
||
import com.repo.whopper.application.notice.usecase.EditNoticeUseCase; | ||
import com.repo.whopper.application.notice.usecase.ChangeNoticeUseCase; | ||
import com.repo.whopper.common.annotation.OnlyTeacher; | ||
import com.repo.whopper.common.swagger.notice.EditNoticeApiDocumentation; | ||
import com.repo.whopper.common.swagger.notice.ChangeNoticeApiDocumentation; | ||
import com.repo.whopper.interfaces.notice.dto.request.NoticeRequest; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
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; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/notice") | ||
public class EditNoticeController implements EditNoticeApiDocumentation { | ||
private final EditNoticeUseCase editNoticeUseCase; | ||
public class ChangeNoticeController implements ChangeNoticeApiDocumentation { | ||
private final ChangeNoticeUseCase changeNoticeUseCase; | ||
|
||
@PostMapping("/{noticeId}") | ||
public void checkNotice(@PathVariable String noticeId) { | ||
changeNoticeUseCase.checkNotice(noticeId); | ||
} | ||
|
||
@OnlyTeacher | ||
@PatchMapping("/{noticeId}") | ||
public void editNotice(@PathVariable String noticeId, @RequestBody NoticeRequest request) { | ||
editNoticeUseCase.editNotice(noticeId, request.title(), request.content()); | ||
changeNoticeUseCase.editNotice(noticeId, request.title(), request.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
18 changes: 0 additions & 18 deletions
18
src/main/java/com/repo/whopper/interfaces/notice/dto/response/NoticeDetailResponse.java
This file was deleted.
Oops, something went wrong.