Skip to content

Commit

Permalink
Merge pull request #55 from rosieisor/chore
Browse files Browse the repository at this point in the history
chore: 스프링 부트 버전 3.3.4 변경
  • Loading branch information
rosieisor authored Oct 4, 2024
2 parents c58389f + 93a9c89 commit 56dba6a
Show file tree
Hide file tree
Showing 45 changed files with 138 additions and 164 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.13'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'org.springframework.boot' version '3.3.4'
id 'io.spring.dependency-management' version '1.1.6'
}

group = 'com.web'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '11'
sourceCompatibility = '17'
}

configurations {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;

import javax.transaction.Transactional;
import jakarta.transaction.Transactional;

@Transactional
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;

import javax.transaction.Transactional;
import jakarta.transaction.Transactional;
import java.util.Optional;

@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;

import javax.transaction.Transactional;
import jakarta.transaction.Transactional;

@Transactional
@Getter @Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityNotFoundException;
import jakarta.persistence.EntityNotFoundException;
import java.util.List;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityNotFoundException;
import jakarta.persistence.EntityNotFoundException;
import java.util.*;

@Transactional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.web.stard.domain.board.global.domain;

import com.sun.istack.NotNull;
import com.web.stard.domain.board.global.domain.enums.PostType;
import com.web.stard.domain.member.domain.Member;
import com.web.stard.global.domain.BaseEntity;
import jakarta.validation.constraints.NotNull;
import lombok.*;

import javax.persistence.*;
import jakarta.persistence.*;

@Entity
@Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.web.stard.global.domain.BaseEntity;
import lombok.*;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;

@Entity
@Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import com.web.stard.domain.member.domain.Member;
import lombok.*;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;

@Entity
@Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.web.stard.global.domain.BaseEntity;
import lombok.*;

import javax.persistence.*;
import jakarta.persistence.*;

@Entity
@Table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.web.stard.domain.board.global.domain;

import com.sun.istack.NotNull;
import jakarta.validation.constraints.NotNull;
import com.web.stard.domain.board.global.domain.enums.ActType;
import com.web.stard.domain.board.global.domain.enums.PostType;
import com.web.stard.domain.board.study.domain.Study;
import com.web.stard.domain.board.study.domain.StudyPost;
import com.web.stard.domain.member.domain.Member;
import lombok.*;

import javax.persistence.*;
import jakarta.persistence.*;

@Entity
@Table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.web.stard.domain.board.study.domain;

import com.web.stard.domain.board.study.domain.Study;
import com.web.stard.domain.member.domain.Member;
import lombok.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.web.stard.domain.member.domain.Member;
import lombok.*;

import javax.persistence.*;
import jakarta.persistence.*;

@Entity
@Table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.web.stard.domain.board.study.domain;

import com.sun.istack.NotNull;
import jakarta.validation.constraints.NotNull;
import com.web.stard.domain.member.domain.Member;
import com.web.stard.domain.board.study.domain.Study;
import lombok.*;

import javax.persistence.*;
import jakarta.persistence.*;

@Entity
@Table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.web.stard.domain.board.study.domain;

import com.sun.istack.NotNull;
import com.web.stard.domain.board.study.domain.Study;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import jakarta.persistence.*;
import java.time.LocalDateTime;

@Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.web.stard.domain.board.study.domain;

import com.sun.istack.NotNull;
import jakarta.validation.constraints.NotNull;
import com.web.stard.domain.board.global.domain.enums.PostType;
import com.web.stard.domain.board.study.domain.enums.ProgressStatus;
import com.web.stard.domain.board.study.domain.enums.RecruitStatus;
Expand All @@ -10,7 +10,7 @@
import org.springframework.data.annotation.CreatedDate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import jakarta.persistence.*;
import java.time.LocalDate;

@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.web.stard.domain.member.domain.Member;
import lombok.*;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;

@Entity
@Builder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.web.stard.domain.board.study.domain;

import com.sun.istack.NotNull;
import jakarta.validation.constraints.NotNull;
import com.web.stard.domain.board.global.domain.enums.PostType;
import com.web.stard.domain.member.domain.Member;
import com.web.stard.global.domain.BaseEntity;
import lombok.*;

import javax.persistence.*;
import jakarta.persistence.*;

@Entity
@Table
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.web.stard.domain.board.study.domain;

import com.sun.istack.NotNull;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import jakarta.persistence.*;
import java.time.LocalDateTime;

@Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.web.stard.domain.board.study.dto;

import com.sun.istack.NotNull;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import com.web.stard.domain.chat_stomp.domain.ChatRoom;
import com.web.stard.domain.chat_stomp.repository.ChatRoomRepository;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.*;

@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;

@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import lombok.*;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.UUID;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;

@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

import com.web.stard.domain.member.dto.EmailDto;
import com.web.stard.domain.member.application.EmailService;
import com.web.stard.domain.member.dto.PasswordUpdateDto;
import com.web.stard.domain.member.dto.ResetPasswordResponse;
import com.web.stard.domain.member.application.MemberService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

import javax.mail.MessagingException;
import jakarta.mail.MessagingException;

@RestController
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid;

@Slf4j
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.web.stard.domain.member.dto.EmailDto;

import javax.mail.MessagingException;
import jakarta.mail.MessagingException;

public interface EmailService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.web.stard.domain.member.domain.Member;
import com.web.stard.domain.member.dto.EmailDto;
import com.web.stard.domain.member.repository.MemberRepository;
import com.web.stard.global.util.RedisUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -12,9 +13,9 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import jakarta.mail.MessagingException;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeMessage;
import java.time.Duration;
import java.util.Random;
import java.util.UUID;
Expand All @@ -34,7 +35,7 @@ public class EmailServiceImpl implements EmailService {

private static final String RESET_PW_PREFIX = "ResetPwToken ";

private final RedisTemplate redisTemplate;
private final RedisUtil redisUtil;

@Value("${spring.mail.auth-code-expiration-millis}")
private long authCodeExpirationMillis;
Expand Down Expand Up @@ -106,7 +107,7 @@ public void sendCodeToEmail(String toEmail) throws Exception {
sendEmail(toEmail, authCode);

// 이메일 인증 요청 시 인증 번호 Redis에 저장 ( key = "AuthCode " + Email / value = AuthCode )
redisTemplate.opsForValue().set(AUTH_CODE_PREFIX + toEmail, authCode, Duration.ofMillis(authCodeExpirationMillis));
redisUtil.setData(AUTH_CODE_PREFIX + toEmail, authCode, authCodeExpirationMillis);

}

Expand All @@ -117,7 +118,7 @@ public void sendCodeToEmail(String toEmail) throws Exception {
*/
@Override
public boolean verifiedCode(String email, String authCode) throws Exception{
String redisAuthCode = (String) redisTemplate.opsForValue().get(AUTH_CODE_PREFIX + email);
String redisAuthCode = redisUtil.getData(AUTH_CODE_PREFIX + email);

if (redisAuthCode == null)
throw new Exception("시간 초과");
Expand All @@ -144,7 +145,7 @@ public void sendEmailResetPw(EmailDto emailDto) throws MessagingException {

while(isExist){

String existEmail = (String) redisTemplate.opsForValue().get(RESET_PW_PREFIX + pwResetToken);
String existEmail = redisUtil.getData(RESET_PW_PREFIX + pwResetToken);
if (existEmail == null)
break;
else
Expand All @@ -171,7 +172,7 @@ public void sendEmailResetPw(EmailDto emailDto) throws MessagingException {
// TODO 로그 삭제
log.info("비밀번호 재설정 Url 생성: " + pwResetUrl);
emailSender.send(message);
redisTemplate.opsForValue().set(RESET_PW_PREFIX + pwResetToken, emailDto.getEmail(), Duration.ofMillis(RESET_PW_TOKEN_EXPIRE_TIME));
redisUtil.setData(RESET_PW_PREFIX + pwResetToken, emailDto.getEmail(), RESET_PW_TOKEN_EXPIRE_TIME);
} catch (MailException e) {
e.printStackTrace();
log.debug("MailService.sendEmail exception occur toEmail: {}", emailDto.getEmail());
Expand Down
Loading

0 comments on commit 56dba6a

Please sign in to comment.