Skip to content

Commit

Permalink
[BE] 정산 반환값 수정 merge
Browse files Browse the repository at this point in the history
[BE] 정산 반환값 수정 #494
  • Loading branch information
hobeen-kim authored Sep 28, 2023
2 parents 10be853 + 1b536c2 commit a833124
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void addCurrentMonthData(List<MonthAdjustmentResponse> monthAdjustmentRe

//이번달 데이터 세팅
int amount = adjustmentRepository.calculateAmount(1L, month, year);
monthAdjustmentResponses.add(MonthAdjustmentResponse.of(month, year, amount));
monthAdjustmentResponses.add(MonthAdjustmentResponse.of(year, month, amount));

//지난달 데이터가 있는지 확인
if (month == 1) {
Expand All @@ -89,7 +89,7 @@ private void addCurrentMonthData(List<MonthAdjustmentResponse> monthAdjustmentRe
boolean hasLastMonth = false;

for(MonthAdjustmentResponse monthAdjustmentResponse : monthAdjustmentResponses) {
if (monthAdjustmentResponse.isSameMonthAndYear(month, year)) {
if (monthAdjustmentResponse.isSameMonthAndYear(year, month)) {
hasLastMonth = true;
break;
}
Expand All @@ -98,7 +98,7 @@ private void addCurrentMonthData(List<MonthAdjustmentResponse> monthAdjustmentRe
//지난달 데이터가 없다면 세팅
if (!hasLastMonth) {
amount = adjustmentRepository.calculateAmount(1L, month, year);
monthAdjustmentResponses.add(MonthAdjustmentResponse.of(month, year, amount));
monthAdjustmentResponses.add(MonthAdjustmentResponse.of(year, month, amount));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ public class MailConfig {
private String host;
@Value("${spring.mail.port}")
private int port;
@Value("${spring.mail.properties.mail.smtp.auth}")
private boolean auth;

@Value("${spring.mail.properties.mail.smtp.starttls.enable}")
private boolean starttlsEnable;

@Value("${spring.mail.properties.mail.smtp.starttls.required}")
private boolean starttlsRequired;

@Value("${spring.mail.properties.mail.smtp.connectiontimeout}")
private int connectionTimeout;

@Value("${spring.mail.properties.mail.smtp.timeout}")
private int timeout;

@Value("${spring.mail.properties.mail.smtp.writetimeout}")
private int writeTimeout;

@Bean
public JavaMailSender javaMailService() {
Expand All @@ -36,13 +53,12 @@ public JavaMailSender javaMailService() {

private Properties getMailProperties() {
Properties properties = new Properties();

properties.setProperty("mail.transport.protocol", "smtp");
properties.setProperty("mail.smtp.auth", "true");
properties.setProperty("mail.smtp.starttls.enable", "true");
properties.setProperty("mail.debug", "true");
properties.setProperty("mail.smtp.ssl.trust","smtp.naver.com");
properties.setProperty("mail.smtp.ssl.enable","true");
properties.put("mail.smtp.auth", auth);
properties.put("mail.smtp.starttls.enable", starttlsEnable);
properties.put("mail.smtp.starttls.required", starttlsRequired);
properties.put("mail.smtp.connectiontimeout", connectionTimeout);
properties.put("mail.smtp.timeout", timeout);
properties.put("mail.smtp.writetimeout", writeTimeout);

return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public MimeMessage createMessage(String email, String subject, String text) thro
message.setText(
text,"utf-8", "html"
);
message.setFrom(new InternetAddress("yj171151@naver.com", "prometheus"));
message.setFrom(new InternetAddress("sksjsksh32@google.com", "prometheus"));

return message;
}
Expand Down
13 changes: 7 additions & 6 deletions Server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ spring:
hibernate:
default_batch_fetch_size: 100
mail:
host: smtp.naver.com
port: 465
host: smtp.gmail.com
port: 587
username: [email protected]
properties:
debug: true
mail:
smtp:
auth: true
ssl:
enable: true
trust: smtp.naver.com
starttls:
enable: true
required: true
connectiontimeout: 5000
timeout: 5000
writetimeout: 5000
security:
oauth2:
client:
Expand Down

0 comments on commit a833124

Please sign in to comment.