Skip to content

Commit

Permalink
feat: 디스코드 훅 전송 응답 로그 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Jul 4, 2024
1 parent 79e63ac commit 28adc89
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.few.api.client.subscription
import com.few.api.client.config.properties.DiscordBodyProperty
import com.few.api.client.config.properties.Embed
import com.few.api.client.subscription.dto.WorkbookSubscriptionArgs
import org.apache.juli.logging.LogFactory
import org.springframework.beans.factory.annotation.Value
import org.springframework.http.HttpEntity
import org.springframework.http.HttpMethod
Expand All @@ -14,6 +15,8 @@ class SubscriptionClient(
private val restTemplate: RestTemplate,
@Value("\${webhook.discord}") private val discordWebhook: String
) {
private val log = LogFactory.getLog(SubscriptionClient::class.java)

fun announceWorkbookSubscription(args: WorkbookSubscriptionArgs) {
args.let {
DiscordBodyProperty(
Expand All @@ -39,7 +42,9 @@ class SubscriptionClient(
HttpMethod.POST,
HttpEntity(body),
String::class.java
)
).let { res ->
log.info("Discord webhook response: ${res.statusCode}")
}
}
}
}

0 comments on commit 28adc89

Please sign in to comment.