|
@@ -0,0 +1,21 @@
|
|
1
|
+package kr.co.swh.lecture.java.example;
|
|
2
|
+
|
|
3
|
+import com.github.tobby48.testtest.SlackApi;
|
|
4
|
+import com.github.tobby48.testtest.SlackAttachment;
|
|
5
|
+import com.github.tobby48.testtest.SlackMessage;
|
|
6
|
+
|
|
7
|
+public class SlackTest {
|
|
8
|
+ public static void main(String[] args) {
|
|
9
|
+ // TODO Auto-generated method stub
|
|
10
|
+
|
|
11
|
+ SlackApi api = new SlackApi("https://hooks.slack.com/services/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");
|
|
12
|
+ SlackAttachment attach = new SlackAttachment();
|
|
13
|
+ attach.setTitle(" ");
|
|
14
|
+ attach.setColor("#CC3D3D");
|
|
15
|
+ attach.setFallback("점검이 필요합니다.");
|
|
16
|
+ attach.setTimestamp(new java.util.Date());
|
|
17
|
+ attach.setText("하위타이틀");
|
|
18
|
+// attach.setImageUrl("이미지경로");
|
|
19
|
+ api.call(new SlackMessage("아이이", "메세지 타이틀").addAttachments(attach));
|
|
20
|
+ }
|
|
21
|
+}
|