Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@Slf4j
public class DiscordNotifier {

private static final String ADMIN_PAGE_URL = "https://admins.solid-connection.com";
private static final String ADMIN_PAGE_URL = "https://www.admins.solid-connection.com";

private final RestTemplate restTemplate;

Expand All @@ -30,7 +30,7 @@ public class DiscordNotifier {

@Async
public void notify(DiscordNotificationType type, String applicantInfo) {
if (webhookUrl.isBlank()) {
if (webhookUrl.isBlank() || "local".equalsIgnoreCase(environment)) {
return;
}
try {
Expand All @@ -44,7 +44,12 @@ public void notify(DiscordNotificationType type, String applicantInfo) {
}

private String buildMessage(DiscordNotificationType type, String applicantInfo) {
return "[%s] %s 검수 요청이 등록되었습니다.\n신청자: %s\n관리자 페이지: %s"
.formatted(environment.toUpperCase(), type.getDisplayName(), applicantInfo, ADMIN_PAGE_URL);
String body = "%s 검수 요청이 등록되었습니다.\n신청자: %s\n관리자 페이지: %s"
.formatted(type.getDisplayName(), applicantInfo, ADMIN_PAGE_URL);
return switch (environment.toLowerCase()) {
case "prod" -> body;
case "dev" -> "[개발 서버 알림입니다]\n" + body;
default -> "[%s]\n%s".formatted(environment.toUpperCase(), body);
};
Comment thread
whqtker marked this conversation as resolved.
}
}
Loading