Skip to content

Commit

Permalink
Merge pull request #44 from Central-MakeUs/refactor/37
Browse files Browse the repository at this point in the history
Hotfix: ์„ค๋ฌธ์ง€ ์กฐํšŒ์‹œ ์‘๋‹ต DTO ์ˆ˜์ •
  • Loading branch information
yxhwxn authored Aug 18, 2024
2 parents 7e1c795 + 07d2ec6 commit 3b54b7b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.PageLoadStrategy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
Expand Down Expand Up @@ -98,6 +99,8 @@ public CrawlResponseDTO.CrawlResultDTO crawlYoutubeComments(String url, Long eve
options.addArguments("--disable-infobars");
options.addArguments("--disable-browser-side-navigation");
options.addArguments("--disable-software-rasterizer");
options.addArguments("--blink-settings=imagesEnabled=false"); // ์ด๋ฏธ์ง€ ๋กœ๋”ฉ ๋น„ํ™œ์„ฑํ™”
options.setPageLoadStrategy(PageLoadStrategy.NORMAL); // ํŽ˜์ด์ง€ ๋กœ๋“œ ์ „๋žต ์„ค์ •

WebDriver driver = new ChromeDriver(options);
driver.get(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,16 @@ public static class QuestionDTO {
private Long questionId;
private QuestionType questionType;
private String questionText;
private List<String> options;
private List<OptionDTO> options;

@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class OptionDTO {
private Long questionOptionId;
private String optionText;
}
}

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ public static SurveyResponseDTO.SurveyViewDTO toSurveyViewResultDTO(Survey surve
.questionType(question.getQuestionType())
.questionText(question.getQuestionText())
.options(question.getQuestionOptionList().stream()
.map(QuestionOption::getOptionText)
.map(option -> SurveyResponseDTO.SurveyViewDTO.QuestionDTO.OptionDTO.builder()
.questionOptionId(option.getId())
.optionText(option.getOptionText())
.build())
.collect(Collectors.toList()))
.build())
.collect(Collectors.toList());
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/cmc/suppin/global/config/MailConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public boolean sendMail(String toEmail, String code) {
// Format the current date and time
String formattedDateTime = ZonedDateTime.now(ZoneId.of("Asia/Seoul"))
.format(DateTimeFormatter.ofPattern("yyyy-MM-dd, HH:mm"));

// Use StringBuilder to construct the HTML email body
StringBuilder emailBody = new StringBuilder();
emailBody.append("<!DOCTYPE html>")
Expand All @@ -42,13 +42,13 @@ public boolean sendMail(String toEmail, String code) {
.append("<body style=\"font-family: Arial, sans-serif;\">")
.append("<div style=\"padding: 20px; border: 1px solid #eaeaea; max-width: 600px; margin: 0 auto;\">")
.append("<div style=\"padding: 20px; border-bottom: 1px solid #eaeaea; text-align: center;\">")
.append("<img src=\"cid:suppinLogo\" alt=\"Suppin Logo\" style=\"width: 100px;\">")
.append("<img src=\"cid:suppinLogo\" alt=\"Suppin Logo\" style=\"width: 100%; height: 120px; object-fit: cover;\">")
.append("<h2 style=\"color: #333;\"><span style=\"color: #1a73e8;\">[Suppin]</span> ์ธ์ฆ๋ฒˆํ˜ธ๋ฅผ ์•ˆ๋‚ดํ•ด ๋“œ๋ฆฝ๋‹ˆ๋‹ค.</h2>")
.append("</div>")
.append("<div style=\"padding: 20px;\">")
.append("<p>์•ˆ๋…•ํ•˜์„ธ์š”, Suppin์„ ์ด์šฉํ•ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค :)</p>")
.append("<p>Suppin ํšŒ์›๊ฐ€์ž…์„ ์œ„ํ•ด ์ธ์ฆ๋ฒˆํ˜ธ๋ฅผ ์•ˆ๋‚ดํ•ด ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ์•„๋ž˜ ์ธ์ฆ๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ์ด๋ฉ”์ผ ์ธ์ฆ์„ ์™„๋ฃŒํ•ด ์ฃผ์„ธ์š”.</p>")
.append("<div style=\"font-size: 24px; font-weight: bold; margin: 20px 0; color: #333; text-align: center;\">")
.append("<p style=\"color: #000000;\">์•ˆ๋…•ํ•˜์„ธ์š”, Suppin์„ ์ด์šฉํ•ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค :)</p>")
.append("<p style=\"color: #000000;\">Suppin ํšŒ์›๊ฐ€์ž…์„ ์œ„ํ•ด ์ธ์ฆ๋ฒˆํ˜ธ ์•ˆ๋‚ด ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ์•„๋ž˜ ์ธ์ฆ๋ฒˆํ˜ธ๋ฅผ 5๋ถ„ ์ด๋‚ด๋กœ ์ž…๋ ฅํ•˜์—ฌ ์ด๋ฉ”์ผ ์ธ์ฆ์„ ์™„๋ฃŒํ•ด ์ฃผ์„ธ์š”.</p>")
.append("<div style=\"font-size: 24px; font-weight: bold; margin: 20px 0; color: #1a73e8; text-align: center;\">") // ์ธ์ฆ๋ฒˆํ˜ธ ์ƒ‰์ƒ
.append(code)
.append("</div>")
.append("<table style=\"width: 100%; border-collapse: collapse;\">")
Expand All @@ -73,7 +73,7 @@ public boolean sendMail(String toEmail, String code) {
helper.setText(emailBody.toString(), true);

// Add inline image
ClassPathResource logoImage = new ClassPathResource("static/images/suppin-logo.png");
ClassPathResource logoImage = new ClassPathResource("static/images/suppin-logo2.png");
helper.addInline("suppinLogo", logoImage);

javaMailSender.send(message);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3b54b7b

Please sign in to comment.