f-lab-edu / MSG-lab

8 stars 1 forks source link

메세지 도메인에 시간, 문구 정책을 추가 #111

Closed Bue-von-hon closed 1 year ago

Bue-von-hon commented 1 year ago

배경

110 이슈를 해결하기 위한 첫번째 PR입니다.

메시지 정책과 문구에 대한 정책을 추가했습니다.

작업 내용

추가(lombok.config): 롬복이 생성해준 소스 코드는 테스트에서 제외 수정(build.gradle): jupiter api와 테스트 엔진을 추가, @NotEmpty 어노테이션을 위한 vallidation 의존성 추가 추가(MessageType): 메시지가 광고/정보성인지 타입에 대한 enum 클래스 생성 추가(Notification): 메시지 본문과 타이틀을 담고있는 클래스 생성, 만약 접두어가 없으면 접두어를 추가하는 메소드 생성 추가(Message): 파라미터가 추가되는 상황을 고려하여 Builder 패턴 구현, 광고성 메시지라면 접두어가 있는지 확인하고 없으면 넣어주게 구현, 광고성 메시지라면 21:00:00 ~ 08:00:59 사이에는 전송하지 못하게 구현 추가(NotificationTest): 접두어가 없으면 넣어주는 테스트 구현 추가(MessageTest): 전송 가능한 시간에 대한 테스트 추가, 정보성 메시지면 항상 전송 가능한지 테스트 추가, 광고성 메시지면 접두어를 추가해주는지 테스트 추가

결과

앞으로 전송 정책에 맞게 메시지를 전송할 수 있습니다.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 96.77% and project coverage change: +13.79 :tada:

Comparison is base (321d030) 69.74% compared to head (4504d4f) 83.54%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #111 +/- ## ============================================= + Coverage 69.74% 83.54% +13.79% - Complexity 33 66 +33 ============================================= Files 24 31 +7 Lines 119 237 +118 Branches 0 1 +1 ============================================= + Hits 83 198 +115 - Misses 36 38 +2 - Partials 0 1 +1 ``` | [Impacted Files](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu) | Coverage Δ | | |---|---|---| | [...m/example/common/domain/CommercialPushMessage.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL21haW4vamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL0NvbW1lcmNpYWxQdXNoTWVzc2FnZS5qYXZh) | `71.42% <71.42%> (ø)` | | | [...com/example/common/domain/SendPolicyValidator.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL21haW4vamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL1NlbmRQb2xpY3lWYWxpZGF0b3IuamF2YQ==) | `83.33% <83.33%> (ø)` | | | [...xample/common/domain/InformationalPushMessage.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL21haW4vamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL0luZm9ybWF0aW9uYWxQdXNoTWVzc2FnZS5qYXZh) | `100.00% <100.00%> (ø)` | | | [...n/java/com/example/common/domain/Notification.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL21haW4vamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL05vdGlmaWNhdGlvbi5qYXZh) | `100.00% <100.00%> (ø)` | | | [...ava/com/example/common/domain/PushMessageInfo.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL21haW4vamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL1B1c2hNZXNzYWdlSW5mby5qYXZh) | `100.00% <100.00%> (ø)` | | | [...com/example/common/domain/PushMessageResource.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL21haW4vamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL1B1c2hNZXNzYWdlUmVzb3VyY2UuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [...st/java/com/example/common/domain/MessageTest.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL3Rlc3QvamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL01lc3NhZ2VUZXN0LmphdmE=) | `100.00% <100.00%> (ø)` | | | [...va/com/example/common/domain/NotificationTest.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL3Rlc3QvamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL05vdGlmaWNhdGlvblRlc3QuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [...example/common/domain/SendPolicyValidatorTest.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1jb21tb24vc3JjL3Rlc3QvamF2YS9jb20vZXhhbXBsZS9jb21tb24vZG9tYWluL1NlbmRQb2xpY3lWYWxpZGF0b3JUZXN0LmphdmE=) | `100.00% <100.00%> (ø)` | | | [...e/msglabapi/adapter/inbound/MessageController.java](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu#diff-TVNHLWxhYi1hcGkvc3JjL21haW4vamF2YS9jb20vZXhhbXBsZS9tc2dsYWJhcGkvYWRhcHRlci9pbmJvdW5kL01lc3NhZ2VDb250cm9sbGVyLmphdmE=) | `100.00% <0.00%> (ø)` | | | ... and [4 more](https://codecov.io/gh/f-lab-edu/MSG-lab/pull/111?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=f-lab-edu)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Bue-von-hon commented 1 year ago

@f-lab-Carrey 웹서칭 중 알게된 푸시 메시지 전송 정책을 추가하고, 국제화 기능을 추가했습니다...!

참고 메이크샵의 푸시 메시지 전송 정책