-
Notifications
You must be signed in to change notification settings - Fork 0
[Release] 사장/알바생 FAQ 조회 API 개발, 로그아웃 기능 개발, 지각 시 사장에게 알림 기능 추가 #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
02d5b8b
feat: 사장/알바생 FAQ 조회 API 개발 (#110)
Simzard10 0559162
refactor: 사장 구독 현황, 결제 수단 없을 때 null DTO 반환 (#122)
Simzard10 9bdc490
fix: cd-dev.yml sentry 환경변수 추가
hyunzzii 4bf7191
fix: cd-dev.yml sentry 환경변수 추가
hyunzzii 54af413
feat: 로그아웃 기능 개발 (#128)
Simzard10 bebd1ba
feat: notificationEntity에 metaId 필드 추가
hyunzzii d80c066
feat: 지각 시 사장에게 알림 기능 추가
hyunzzii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/mangoboss/app/api/controller/faq/BossFaqController.java
This file contains hidden or 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,23 @@ | ||
| package com.mangoboss.app.api.controller.faq; | ||
|
|
||
| import com.mangoboss.app.api.facade.faq.BossFaqFacade; | ||
| import com.mangoboss.app.dto.ListWrapperResponse; | ||
| import com.mangoboss.app.dto.faq.FaqResponse; | ||
| import com.mangoboss.storage.faq.FaqCategory; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.security.access.prepost.PreAuthorize; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/boss/faq") | ||
| @RequiredArgsConstructor | ||
| @PreAuthorize("hasRole('BOSS')") | ||
| public class BossFaqController { | ||
|
|
||
| private final BossFaqFacade bossFaqFacade; | ||
|
|
||
| @GetMapping | ||
| public ListWrapperResponse<FaqResponse> getFaqs(@RequestParam(value = "category", defaultValue = "ALL") FaqCategory category) { | ||
| return ListWrapperResponse.of(bossFaqFacade.getFaqs(category)); | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/mangoboss/app/api/controller/faq/StaffFaqController.java
This file contains hidden or 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,23 @@ | ||
| package com.mangoboss.app.api.controller.faq; | ||
|
|
||
| import com.mangoboss.app.api.facade.faq.StaffFaqFacade; | ||
| import com.mangoboss.app.dto.ListWrapperResponse; | ||
| import com.mangoboss.app.dto.faq.FaqResponse; | ||
| import com.mangoboss.storage.faq.FaqCategory; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.security.access.prepost.PreAuthorize; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/staff/faq") | ||
| @RequiredArgsConstructor | ||
| @PreAuthorize("hasRole('STAFF')") | ||
| public class StaffFaqController { | ||
|
|
||
| private final StaffFaqFacade staffFaqFacade; | ||
|
|
||
| @GetMapping | ||
| public ListWrapperResponse<FaqResponse> getFaqs(@RequestParam(value = "category", defaultValue = "ALL") FaqCategory category) { | ||
| return ListWrapperResponse.of(staffFaqFacade.getFaqs(category)); | ||
| } | ||
| } |
This file contains hidden or 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
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/mangoboss/app/api/facade/faq/BossFaqFacade.java
This file contains hidden or 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,23 @@ | ||
| package com.mangoboss.app.api.facade.faq; | ||
|
|
||
| import com.mangoboss.app.domain.service.faq.FaqService; | ||
| import com.mangoboss.app.dto.faq.FaqResponse; | ||
| import com.mangoboss.storage.faq.FaqCategory; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| import java.util.List; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class BossFaqFacade { | ||
|
|
||
| private final FaqService faqService; | ||
|
|
||
| public List<FaqResponse> getFaqs(final FaqCategory category) { | ||
| return faqService.getFaqs(category).stream() | ||
| .map(FaqResponse::fromEntity) | ||
| .collect(Collectors.toList()); | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/mangoboss/app/api/facade/faq/StaffFaqFacade.java
This file contains hidden or 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,23 @@ | ||
| package com.mangoboss.app.api.facade.faq; | ||
|
|
||
| import com.mangoboss.app.domain.service.faq.FaqService; | ||
| import com.mangoboss.app.dto.faq.FaqResponse; | ||
| import com.mangoboss.storage.faq.FaqCategory; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| import java.util.List; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class StaffFaqFacade { | ||
|
|
||
| private final FaqService faqService; | ||
|
|
||
| public List<FaqResponse> getFaqs(final FaqCategory category) { | ||
Simzard10 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return faqService.getFaqs(category).stream() | ||
| .map(FaqResponse::fromEntity) | ||
| .collect(Collectors.toList()); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/mangoboss/app/domain/repository/FaqRepository.java
This file contains hidden or 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,13 @@ | ||
| package com.mangoboss.app.domain.repository; | ||
|
|
||
|
|
||
| import com.mangoboss.storage.faq.FaqEntity; | ||
| import com.mangoboss.storage.faq.FaqCategory; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public interface FaqRepository { | ||
| List<FaqEntity> findAll(); | ||
|
|
||
| List<FaqEntity> findByCategory(FaqCategory category); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
25 changes: 25 additions & 0 deletions
25
app/src/main/java/com/mangoboss/app/domain/service/faq/FaqService.java
This file contains hidden or 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,25 @@ | ||
| package com.mangoboss.app.domain.service.faq; | ||
|
|
||
| import com.mangoboss.app.domain.repository.FaqRepository; | ||
| import com.mangoboss.storage.faq.FaqEntity; | ||
| import com.mangoboss.storage.faq.FaqCategory; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Service | ||
| @RequiredArgsConstructor | ||
| @Transactional(readOnly = true) | ||
| public class FaqService { | ||
|
|
||
| private final FaqRepository faqRepository; | ||
|
|
||
| public List<FaqEntity> getFaqs(final FaqCategory category) { | ||
| if (category == FaqCategory.ALL) { | ||
| return faqRepository.findAll(); | ||
| } | ||
| return faqRepository.findByCategory(category); | ||
| } | ||
| } |
This file contains hidden or 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: 22 additions & 0 deletions
22
app/src/main/java/com/mangoboss/app/dto/faq/FaqResponse.java
This file contains hidden or 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.mangoboss.app.dto.faq; | ||
|
|
||
| import com.mangoboss.storage.faq.FaqCategory; | ||
| import com.mangoboss.storage.faq.FaqEntity; | ||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record FaqResponse( | ||
| Long id, | ||
| FaqCategory category, | ||
| String question, | ||
| String answer | ||
| ) { | ||
| public static FaqResponse fromEntity(final FaqEntity entity) { | ||
| return FaqResponse.builder() | ||
| .id(entity.getId()) | ||
| .category(entity.getCategory()) | ||
| .question(entity.getQuestion()) | ||
| .answer(entity.getAnswer()) | ||
| .build(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.