Skip to content

Commit

Permalink
[BE] FEAT: discord webhook messenger 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Ssuamje committed Sep 15, 2023
1 parent 0d23600 commit f94deae
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.ftclub.cabinet.alarm.DiscordAlarmMessage;
import org.ftclub.cabinet.alarm.DiscordWebHookMessenger;
import org.ftclub.cabinet.auth.domain.AuthGuard;
import org.ftclub.cabinet.auth.domain.AuthLevel;
import org.ftclub.cabinet.auth.domain.CookieManager;
Expand Down Expand Up @@ -40,6 +42,7 @@ public class AdminApiLogAspect {
private final TokenValidator tokenValidator;
private final JwtProperties jwtProperties;
private final LogParser logParser;
private final DiscordWebHookMessenger discordWebHookMessenger;

@AfterReturning(
pointcut = ADMIN_CUD_POINTCUT,
Expand Down Expand Up @@ -103,7 +106,8 @@ private void sendLogMessage(JoinPoint joinPoint, String responseString)
// 결과
String message = sb.append(responseString).toString();

logParser.parseToDiscordAlarmMessage(message);
DiscordAlarmMessage discordAlarmMessage = logParser.parseToDiscordAlarmMessage(message);
discordWebHookMessenger.sendMessage(discordAlarmMessage);
log.info(message);
}
}

0 comments on commit f94deae

Please sign in to comment.