Skip to content

Commit

Permalink
Deploy | CAKK-61 | v.2.0.4 ๋ฐฐํฌ
Browse files Browse the repository at this point in the history
* Refactor | CAKK-58 | User ๋น„์ฆˆ๋‹ˆ์Šค์— Facade ํŒจํ„ด ์ ์šฉ

* Feature | CAKK-58 | User Command ๊ด€๋ จ Facade ๊ตฌํ˜„

* Refactor | CAKK-58 | ๋ฏธ์‚ฌ์šฉ Writer ์‚ญ์ œ

* Refactor | CAKK-58 | Service ๋ ˆ์ด์–ด์— Facade ํŒจํ„ด ์ ์šฉ

* Test | CAKK-58 | Facade ํ…Œ์ŠคํŠธ ์ถ”์ƒ ํด๋ž˜์Šค ๊ตฌ์ถ• ๋ฐ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ

* Refactor | CAKK-59 | External ๋ชจ๋“ˆ ๋ฆฌํŒฉํ† ๋ง ๋ฐ Send ๊ด€๋ จ ์ถ”์ƒํ™”

* Chore | CAKK-58 | kt dsl ์ ์šฉ ๋ฐ kotlin ์˜์กด์„ฑ ์ฃผ์ž…

* Rename .java to .kt

* Refactor | CAKK-58 | send ๊ด€๋ จ ์ฝ”ํ‹€๋ฆฐ ์ ์šฉ ๋ฐ ์ถ”์ƒํ™”

* Refactor | CAKK-58 | ์‚ฌ์—…์ž ์ธ์ฆ ๊ด€๋ จ ๋ฆฌํŒฉํ† ๋ง

* Refactor | CAKK-58 | ์ด๋ฉ”์ผ ์ธ์ฆ ๊ด€๋ จ ๋ฆฌํŒฉํ† ๋ง

* Refactor | CAKK-58 | ํ•จ์ˆ˜ํ˜• ์ธํ„ฐํŽ˜์ด์Šค๋กœ ์ˆ˜์ •

* Refactor | CAKK-58 | ํŒŒ๋ผ๋ฏธํ„ฐ ์ˆ˜์ •

* Refactor | CAKK-58 | ํ…œํ”Œ๋ฆฟ ์ฝœ๋ฐฑ ํŒจํ„ด ์ 

* Refactor | CAKK-58 | ํ…œํ”Œ๋ฆฟ ์ฝœ๋ฐฑ ํŒจํ„ด ์ ์šฉ

* Refactor | CAKK-59 | Message Extractor, Sender ๊ด€๋ จ ๋ฆฌํŒฉํ† ๋ง

* Refactor | CAKK-59 | MessageExtractor ์ธํ„ฐํŽ˜์ด์Šค ์ถ”์ƒํ™”

* Refactor | CAKK-59 | as-is ํด๋ž˜์Šค ๋ฐ ์ธํ„ฐํŽ˜์ด์Šค ์ œ๊ฑฐ

* Refactor | CAKK-59 | as-is ํด๋ž˜์Šค ๋ฐ ์ธํ„ฐํŽ˜์ด์Šค ์ œ๊ฑฐ

* Refactor | CAKK-59 | ๋ฉ”์‹œ์ง€ extractor, template ์ถ”์ƒํ™”

* Refactor | CAKK-59 | ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ๋ฆฌ์Šค๋„ˆ ๊ตฌํ˜„

* Refactor | CAKK-59 | api ๋ชจ๋“ˆ slack ์˜์กด์„ฑ ์ œ๊ฑฐ

* Refactor | CAKK-59 | ๋ฉ”์‹œ์ง€ ๊ด€๋ จ ๋น„์ฆˆ๋‹ˆ์Šค ๋ฆฌํŒฉํ† ๋ง

* Test | CAKK-59 | ๋ฉ”์‹œ์ง€ ์ „์†ก ๊ด€๋ จ ํ…Œ์ŠคํŠธ ์ˆ˜์ •

* Chore | CAKK-59 | jacoco exclude์— ๋ฆฌ์Šค๋„ˆ ๋“ฑ๋ก

* Refactor | CAKK-59 | email ๊ด€๋ จ sender ๋„ค์ด๋ฐ ์ˆ˜์ •

* Refactor | CAKK-59 | ์ œ๋„ค๋ฆญ ๋ฒ”์œ„ ์ˆ˜์ •

* Test | CAKK-59 | Error ๊ด€๋ จ ๋ฆฌ์Šค๋„ˆ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ

* Refactor | CAKK-61 | DIP ์œ„๋ฐ˜ ๋ฌธ์ œ ํ•ด๊ฒฐ

* Chore | CAKK-61 | mail ๋ฐ slack ์˜์กด์„ฑ ์ถ”๊ฐ€

* Refactor | CAKK-61 | Dip ์œ„๋ฐ˜ ๋ฌธ์ œ ํ•ด๊ฒฐ
  • Loading branch information
lcomment authored Aug 31, 2024
1 parent aa21b60 commit 1a81a66
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
6 changes: 6 additions & 0 deletions cakk-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ dependencies {

// Point
implementation("org.locationtech.jts:jts-core:1.18.2")

// Mail
implementation("org.springframework.boot:spring-boot-starter-mail")

// Slack
implementation("net.gpedro.integrations.slack:slack-webhook:1.4.0")
}

tasks.bootJar {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
package com.cakk.api.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSender;

import net.gpedro.integrations.slack.SlackApi;

import com.cakk.external.extractor.CertificationSlackMessageExtractor;
import com.cakk.external.extractor.ErrorAlertSlackMessageExtractor;
import com.cakk.external.extractor.MessageExtractor;
import com.cakk.external.extractor.VerificationCodeMimeMessageExtractor;
import com.cakk.external.sender.EmailMessageSender;
import com.cakk.external.sender.MessageSender;
import com.cakk.external.sender.SlackMessageSender;
import com.cakk.external.template.MessageTemplate;

@Configuration
public class MessageTemplateConfig {

private final JavaMailSender javaMailSender;
private final SlackApi slackApi;

private final String senderEmail;
private final Boolean isEnable;

public MessageTemplateConfig(
JavaMailSender javaMailSender,
SlackApi slackApi,
@Value("${spring.mail.username}")
String senderEmail,
@Value("${slack.webhook.is-enable}")
Boolean isEnable
) {
this.javaMailSender = javaMailSender;
this.senderEmail = senderEmail;
this.isEnable = isEnable;
this.slackApi = slackApi;
}

@Bean
public MessageTemplate certificationTemplate() {
return new MessageTemplate();
Expand All @@ -25,4 +53,19 @@ public MessageExtractor certificationMessageExtractor() {
public MessageExtractor errorAlertMessageExtractor() {
return new ErrorAlertSlackMessageExtractor();
}

@Bean
public MessageExtractor verificationCodeMimeMessageExtractor() {
return new VerificationCodeMimeMessageExtractor(javaMailSender, senderEmail);
}

@Bean
public MessageSender emailMessageSender() {
return new EmailMessageSender(javaMailSender);
}

@Bean
public MessageSender slackMessageSender() {
return new SlackMessageSender(slackApi, isEnable);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import jakarta.mail.internet.MimeMessage
import org.springframework.beans.factory.annotation.Value
import org.springframework.mail.javamail.JavaMailSender
import org.springframework.mail.javamail.MimeMessageHelper
import org.springframework.stereotype.Component

import com.cakk.common.enums.ReturnCode
import com.cakk.common.exception.CakkException
import com.cakk.external.vo.VerificationMessage

@Component
class VerificationCodeMimeMessageExtractor(
private val mailSender: JavaMailSender,
@Value("\${spring.mail.username}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package com.cakk.external.sender
import jakarta.mail.internet.MimeMessage

import org.springframework.mail.javamail.JavaMailSender
import org.springframework.stereotype.Component

import com.cakk.common.enums.ReturnCode
import com.cakk.common.exception.CakkException

@Component
class EmailMessageSender(
private val mailSender: JavaMailSender
) : MessageSender<MimeMessage> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import net.gpedro.integrations.slack.SlackApi
import net.gpedro.integrations.slack.SlackMessage

import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Component

@Component
class SlackMessageSender(
private val slackApi: SlackApi,
@Value("\${slack.webhook.is-enable}")
Expand Down

0 comments on commit 1a81a66

Please sign in to comment.