-
Notifications
You must be signed in to change notification settings - Fork 1
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
✨ Add Report to Discord Channel #393
Conversation
yunyoung1819
commented
Oct 29, 2023
- Resolve: Add Report to Discord Channel #386
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추가 테스트 코드에서 외부 API 테스트 할때 MockServer
를 활용해보는 것도 좋을 것 같습니다.
backend/streetdrop-api/src/main/java/com/depromeet/domains/item/service/ItemClaimService.java
Outdated
Show resolved
Hide resolved
backend/streetdrop-api/src/test/java/unit/domains/item/service/ItemClaimServiceTest.java
Outdated
Show resolved
Hide resolved
backend/streetdrop-api/src/main/java/com/depromeet/domains/item/service/ItemClaimService.java
Outdated
Show resolved
Hide resolved
backend/streetdrop-api/src/main/java/com/depromeet/domains/user/service/UserBlockService.java
Show resolved
Hide resolved
backend/streetdrop-api/src/main/java/com/depromeet/external/discord/DiscordService.java
Outdated
Show resolved
Hide resolved
@RequiredArgsConstructor | ||
public class DiscordService { | ||
|
||
public void sendMessages(String webhookUrl, String content, String discordReportingChannel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webhookUrl 부분은 설정으로 빼도 좋을 것 같습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 혹시 설정으로 빼는 것이 프로퍼티로 뺴는거 인걸까요~?
아이템 신고하기와 사용자 차단이 webhook url 이 달라서 DiscordService에서 채널에 따라 url을 분기시키기보다 각각의 Report 서비스에서 webhookUrl을 프로퍼티에서 읽어와 DiscordService로 전달하도록 구현했습니당!
DiscordService에서 설정으로 빼면 채널별로 url 분기가 필요하지 않나여~?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
채널별로 url이 달라지는 군요
그럼 String discordReportingChannel 이 부분이 필요없어지겠군요
backend/streetdrop-api/src/main/java/com/depromeet/external/discord/DiscordService.java
Show resolved
Hide resolved
backend/streetdrop-api/src/main/java/com/depromeet/external/discord/DiscordWebhookPayload.java
Outdated
Show resolved
Hide resolved
...drop-api/src/main/java/com/depromeet/report/block/service/DiscordUserBlockReportService.java
Show resolved
Hide resolved
|
||
import com.depromeet.report.block.dto.UserBlockReportDto; | ||
|
||
public interface UserBlockReportService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
상위에서 인터페이스 사용이 안되는 것 같습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 DiscordUserBlockReportService implements UserBlockReportService
로 사용하고 있는데 혹시 상위에서 인터페이스 사용이 안된다는건 어떤 부분 말씀이실까여~?
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## dev #393 +/- ##
============================================
+ Coverage 28.84% 29.36% +0.51%
- Complexity 87 91 +4
============================================
Files 52 57 +5
Lines 676 722 +46
Branches 21 22 +1
============================================
+ Hits 195 212 +17
- Misses 479 508 +29
Partials 2 2
|