-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat : 호스트 관련 슬랙 알림과 이벤트 추가 #329
Conversation
… feature/324-host-alarm
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.
엘쥐티엠
|
||
@Async | ||
@TransactionalEventListener( | ||
classes = HostRegisterSlackEvent.class, |
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.
HostRegisterSlackEvent 네이밍이
음 호스트 도메인 입장에서는 슬랙이 있는지없는지 모른다고 판단하면될듯해요!
HostRegisterEvent 가 적절할듯 싶습니다!
받아서 처리하는 쪽 문제니깜!
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.
HostRegisterSlackEvent 네이밍이 음 호스트 도메인 입장에서는 슬랙이 있는지없는지 모른다고 판단하면될듯해요! HostRegisterEvent 가 적절할듯 싶습니다!
받아서 처리하는 쪽 문제니깜!
호스트를 생성했을 때 메일 날리던가 그런 이벤트도 생길 거 같은데 구분할 필요가 있지 않을까요?
final Host host = hostAdaptor.findById(hostRegisterSlackEvent.getHostId()); | ||
final String message = HostSlackAlarm.slackRegistrationOf(host); | ||
|
||
slackMessageProvider.sendMessage(host.getSlackUrl(), message); |
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 없을 때도 있으니
인자로 host 넘겨주고
sendMessage 내부에서
처리해도될것같기도해염
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 없을 때도 있으니 인자로 host 넘겨주고
sendMessage 내부에서 처리해도될것같기도해염
인프라에서 호스트를 가지고 있으면 별로인거 같은데 이대로 하고 내부에서 NULL 체크 하는게 더 나을 거 같아요
|
||
@Getter | ||
@AllArgsConstructor | ||
public class HostSlackAlarm { | ||
|
||
public static String joinOf(Host host, User user) { | ||
return user.toUserProfileVo().getUserName() | ||
+ "님이 " | ||
+ host.toHostProfileVo().getName() | ||
+ "에 가입했습니다!"; | ||
} | ||
|
||
public static String slackRegistrationOf(Host host) { | ||
return host.toHostProfileVo().getName() + "에 슬랙 알림이 등록되었습니다!"; | ||
} | ||
|
||
public static String changeMasterOf(Host host, User user) { | ||
return host.toHostProfileVo().getName() | ||
+ "의 마스터 유저가 " | ||
+ user.toUserProfileVo().getUserName() | ||
+ "으로 변경되었습니다."; | ||
} | ||
|
||
public static String disabledOf(User user) { | ||
return user.toUserProfileVo().getUserName() + "님이 호스트에서 추방당했습니다."; | ||
} | ||
} |
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.
인프라 레이어로 옮기면 좋겠지만.. 도메인 로직이있으시 아쉽긴하네요 까뷔
인자로 String 받아서 인프라에 옮길까요?
DuDoong-Infrastructure/build.gradle
Outdated
@@ -3,6 +3,7 @@ jar { enabled = true } | |||
|
|||
dependencies { | |||
api("com.slack.api:slack-api-client:1.27.2") | |||
api("net.gpedro.integrations.slack:slack-webhook:1.4.0") |
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.
저희 기존에 있는 슬랙 공식 sdk에도
웹훅을 지원하지 않나염..?
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.
저희 기존에 있는 슬랙 공식 sdk에도 웹훅을 지원하지 않나염..?
@Deprecated
표시 되어 있어서 안되는줄 알았는데 잘 되네요 바꿨씁니다
|
||
@Bean | ||
public Feign.Builder feignBuilder() { | ||
return Feign.builder(); | ||
} | ||
|
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.
슬랙 좋아용 나중에 형 코드 보고 참고해야겠어요 ㅎㅎ LGTM
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
개요
작업사항
변경로직