-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from Make-A-Wish-Sopt/jiyoung_#157-slack-alarm
[ADD] 소원 생성 시 슬랙 연동
- Loading branch information
Showing
6 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/main/java/com/sopterm/makeawish/common/message/slack/SlackErrorMessage.java
This file contains 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,12 @@ | ||
package com.sopterm.makeawish.common.message.slack; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum SlackErrorMessage { | ||
POST_REQUEST_ERROR("슬랙 요청이 실패했습니다 :"); | ||
|
||
private final String message; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/sopterm/makeawish/common/message/slack/SlackField.java
This file contains 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,12 @@ | ||
package com.sopterm.makeawish.common.message.slack; | ||
|
||
public class SlackField { | ||
public static String TYPE = "type"; | ||
public static String TEXT = "text"; | ||
public static String SECTION = "section"; | ||
public static String FIELDS = "fields"; | ||
public static String BLOCKS = "blocks"; | ||
public static String MARKDOWN = "mrkdwn"; | ||
public static String USER_NAME = "*이름:*"; | ||
public static String USER_WISH_PERIOD = "*생일 주간:*"; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/sopterm/makeawish/common/message/slack/SlackSuccessMessage.java
This file contains 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.sopterm.makeawish.common.message.slack; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum SlackSuccessMessage { | ||
SUCCESS_CREATE_WISH("새로운 소원이 생성되었어요!") | ||
, SUCCESS_CREAT_USER("새로운 유저가 가입했어요!"); | ||
|
||
private final String message; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/sopterm/makeawish/external/SlackWishClient.java
This file contains 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,12 @@ | ||
package com.sopterm.makeawish.external; | ||
|
||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
|
||
@FeignClient(value = "slackWishClient", url = "${slack.wish-url}") | ||
public interface SlackWishClient { | ||
@PostMapping(value = "", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) | ||
void postWishMessage(@RequestBody String request); | ||
} |
This file contains 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 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