Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: 설문지 조회시 응답 DTO 수정 #44

Merged
merged 3 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
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 @@ -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.
Loading