diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/checksums.lock b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/checksums.lock
index 797f52f..2893066 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/checksums.lock and b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/checksums.lock differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/md5-checksums.bin b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/md5-checksums.bin
new file mode 100644
index 0000000..8f25b06
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/md5-checksums.bin differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/sha1-checksums.bin b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/sha1-checksums.bin
new file mode 100644
index 0000000..22a5d3b
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/checksums/sha1-checksums.bin differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/executionHistory/executionHistory.bin b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/executionHistory/executionHistory.bin
index c997f86..460adb8 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/executionHistory/executionHistory.bin and b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/executionHistory/executionHistory.bin differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/executionHistory/executionHistory.lock b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/executionHistory/executionHistory.lock
index a07e081..d9542fc 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/executionHistory/executionHistory.lock and b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/executionHistory/executionHistory.lock differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/fileHashes.bin b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/fileHashes.bin
index 8615f2d..aca9eae 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/fileHashes.bin and b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/fileHashes.bin differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/fileHashes.lock b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/fileHashes.lock
index 9986fff..b8ebe33 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/fileHashes.lock and b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/fileHashes.lock differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/resourceHashesCache.bin b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/resourceHashesCache.bin
new file mode 100644
index 0000000..542b532
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/.gradle/8.4/fileHashes/resourceHashesCache.bin differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/buildOutputCleanup.lock
index 5e7e887..077bd20 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/cache.properties b/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/cache.properties
index 1bef4dd..a90361e 100644
--- a/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/cache.properties
+++ b/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/cache.properties
@@ -1,2 +1,2 @@
-#Mon May 20 18:55:02 KST 2024
+#Mon May 27 04:36:59 KST 2024
gradle.version=8.4
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/outputFiles.bin b/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/outputFiles.bin
index 64826c2..c3b70c6 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/outputFiles.bin and b/contents/todoListAPI/hyeonseung/todolist/.gradle/buildOutputCleanup/outputFiles.bin differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.gradle/file-system.probe b/contents/todoListAPI/hyeonseung/todolist/.gradle/file-system.probe
index 98d3d0a..e9b6621 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/.gradle/file-system.probe and b/contents/todoListAPI/hyeonseung/todolist/.gradle/file-system.probe differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/.idea/gradle.xml b/contents/todoListAPI/hyeonseung/todolist/.idea/gradle.xml
index ce1c62c..3a0665a 100644
--- a/contents/todoListAPI/hyeonseung/todolist/.idea/gradle.xml
+++ b/contents/todoListAPI/hyeonseung/todolist/.idea/gradle.xml
@@ -12,5 +12,6 @@
+
\ No newline at end of file
diff --git a/contents/todoListAPI/hyeonseung/todolist/build.gradle b/contents/todoListAPI/hyeonseung/todolist/build.gradle
index 255fa17..add42dc 100644
--- a/contents/todoListAPI/hyeonseung/todolist/build.gradle
+++ b/contents/todoListAPI/hyeonseung/todolist/build.gradle
@@ -37,9 +37,16 @@ dependencies {
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
- // implementation 'com.google.code.gson:gson:2.8.8'
-}
+ // implementation 'com.google.code.gson:gson:2.8.8'
+
+ // security
+ implementation 'org.springframework.boot:spring-boot-starter-security'
+ // jwt
+ implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
+ implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
+ implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'
+}
tasks.named('test') {
useJUnitPlatform()
}
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/config/JwtTokenFilter.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/config/JwtTokenFilter.class
new file mode 100644
index 0000000..d58ff45
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/config/JwtTokenFilter.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/config/SecurityConfig.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/config/SecurityConfig.class
new file mode 100644
index 0000000..8e74cce
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/config/SecurityConfig.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/controller/MemberController.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/controller/MemberController.class
index ad1abd7..f7e8bb8 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/controller/MemberController.class and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/controller/MemberController.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Member$MemberBuilder.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Member$MemberBuilder.class
index 44f3d29..f1e871a 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Member$MemberBuilder.class and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Member$MemberBuilder.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Member.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Member.class
index d696587..5c0689d 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Member.class and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Member.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Role.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Role.class
new file mode 100644
index 0000000..0b31f25
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/domain/Role.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/CustomUserDetailService.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/CustomUserDetailService.class
new file mode 100644
index 0000000..631c339
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/CustomUserDetailService.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/JwtTokenProvider.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/JwtTokenProvider.class
new file mode 100644
index 0000000..15518a5
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/JwtTokenProvider.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/PasswordConfig.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/PasswordConfig.class
new file mode 100644
index 0000000..2b28308
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/security/PasswordConfig.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/service/MemberService.class b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/service/MemberService.class
index 38dcd48..1f313ee 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/service/MemberService.class and b/contents/todoListAPI/hyeonseung/todolist/build/classes/java/main/com/todolist/todolist/service/MemberService.class differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/generated/sources/annotationProcessor/java/main/com/todolist/todolist/dto/member/MemberMapperImpl.java b/contents/todoListAPI/hyeonseung/todolist/build/generated/sources/annotationProcessor/java/main/com/todolist/todolist/dto/member/MemberMapperImpl.java
index 1a82259..4f6396c 100644
--- a/contents/todoListAPI/hyeonseung/todolist/build/generated/sources/annotationProcessor/java/main/com/todolist/todolist/dto/member/MemberMapperImpl.java
+++ b/contents/todoListAPI/hyeonseung/todolist/build/generated/sources/annotationProcessor/java/main/com/todolist/todolist/dto/member/MemberMapperImpl.java
@@ -5,8 +5,8 @@
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
- date = "2024-05-20T17:24:02+0900",
- comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-8.7.jar, environment: Java 17.0.10 (Oracle Corporation)"
+ date = "2024-05-27T17:08:26+0900",
+ comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-8.4.jar, environment: Java 17.0.10 (Oracle Corporation)"
)
public class MemberMapperImpl implements MemberMapper {
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/generated/sources/annotationProcessor/java/main/com/todolist/todolist/dto/todo/TodoMapperImpl.java b/contents/todoListAPI/hyeonseung/todolist/build/generated/sources/annotationProcessor/java/main/com/todolist/todolist/dto/todo/TodoMapperImpl.java
index 6fe631b..2a9feef 100644
--- a/contents/todoListAPI/hyeonseung/todolist/build/generated/sources/annotationProcessor/java/main/com/todolist/todolist/dto/todo/TodoMapperImpl.java
+++ b/contents/todoListAPI/hyeonseung/todolist/build/generated/sources/annotationProcessor/java/main/com/todolist/todolist/dto/todo/TodoMapperImpl.java
@@ -6,8 +6,8 @@
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
- date = "2024-05-20T17:24:02+0900",
- comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-8.7.jar, environment: Java 17.0.10 (Oracle Corporation)"
+ date = "2024-05-27T17:08:26+0900",
+ comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-8.4.jar, environment: Java 17.0.10 (Oracle Corporation)"
)
public class TodoMapperImpl implements TodoMapper {
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/resources/main/application 2.properties b/contents/todoListAPI/hyeonseung/todolist/build/resources/main/application 2.properties
deleted file mode 100644
index 6aa9a21..0000000
--- a/contents/todoListAPI/hyeonseung/todolist/build/resources/main/application 2.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-spring.application.name=todolist
-
-## DB 설정
-
-# MySQL
-spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
-
-# DB Source URL
-spring.datasource.url=jdbc:mysql://localhost:3306/todolist?
-#characterEncoding=UTF-8&serverTimezone=UTC
-spring.datasource.username=root
-spring.datasource.password=qwer1234
-
-# DDL(create,alter,drop)
-spring.jpa.hibernate.ddl-auto=update
-
-#sql 보여주기
-spring.jpa.show-sql=true
-
-spring.jpa.properties.hibernate.format_sql=true
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/resources/main/application.properties b/contents/todoListAPI/hyeonseung/todolist/build/resources/main/application.properties
index 78ae2c4..4809efe 100644
--- a/contents/todoListAPI/hyeonseung/todolist/build/resources/main/application.properties
+++ b/contents/todoListAPI/hyeonseung/todolist/build/resources/main/application.properties
@@ -1,20 +1,20 @@
spring.application.name=todolist
-## DB 설정
+## DB ì¤ì
# MySQL
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# DB Source URL
-spring.datasource.url=jdbc:mysql://localhost:3306/todolist?
+spring.datasource.url=jdbc:mysql://localhost:3306/todolist
#characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=root
# DDL(create,alter,drop)
-spring.jpa.hibernate.ddl-auto=update
+spring.jpa.hibernate.ddl-auto=create
-#sql 보여주기
+#sql ë³´ì¬ì£¼ê¸°
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQLDialect
@@ -22,7 +22,8 @@ spring.jpa.properties.hibernate.format_sql=true
#DRIVER SETTING
-spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
+#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
-#SERVER PORT SETTING
-#server.port=UR_PORT
\ No newline at end of file
+# jwt
+jwt.secret=VlwEyVBsYt9V7zq57TejMnVUyzblYcfPQye08f7MGVA9XkHa
+jwt.token-validity-in-seconds=86400000
\ No newline at end of file
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/JwtTokenFilter.class.uniqueId3 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/JwtTokenFilter.class.uniqueId3
new file mode 100644
index 0000000..d58ff45
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/JwtTokenFilter.class.uniqueId3 differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/JwtTokenProvider.class.uniqueId1 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/JwtTokenProvider.class.uniqueId1
new file mode 100644
index 0000000..40ba89a
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/JwtTokenProvider.class.uniqueId1 differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Member$MemberBuilder.class.uniqueId6 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Member$MemberBuilder.class.uniqueId6
deleted file mode 100644
index 44f3d29..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Member$MemberBuilder.class.uniqueId6 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Member.class.uniqueId4 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Member.class.uniqueId4
deleted file mode 100644
index 20912bb..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Member.class.uniqueId4 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberController.class.uniqueId0 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberController.class.uniqueId0
new file mode 100644
index 0000000..20723db
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberController.class.uniqueId0 differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberController.class.uniqueId2 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberController.class.uniqueId2
deleted file mode 100644
index ad1abd7..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberController.class.uniqueId2 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapper.class.uniqueId11 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapper.class.uniqueId11
deleted file mode 100644
index 4da194e..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapper.class.uniqueId11 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapperImpl.class.uniqueId7 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapperImpl.class.uniqueId7
deleted file mode 100644
index 21964fe..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapperImpl.class.uniqueId7 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapperImpl.java.uniqueId5 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapperImpl.java.uniqueId5
deleted file mode 100644
index 9672736..0000000
--- a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberMapperImpl.java.uniqueId5
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.todolist.todolist.dto.member;
-
-import com.todolist.todolist.domain.Member;
-import javax.annotation.processing.Generated;
-
-@Generated(
- value = "org.mapstruct.ap.MappingProcessor",
- date = "2024-05-20T17:08:45+0900",
- comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-8.7.jar, environment: Java 17.0.10 (Oracle Corporation)"
-)
-public class MemberMapperImpl implements MemberMapper {
-
- @Override
- public Member toEntity(MemberRequestDto requestDto) {
- if ( requestDto == null ) {
- return null;
- }
-
- Member.MemberBuilder member = Member.builder();
-
- member.name( requestDto.getName() );
- member.loginId( requestDto.getLoginId() );
- member.password( requestDto.getPassword() );
-
- return member.build();
- }
-
- @Override
- public MemberResponseDto toDto(Member member) {
- if ( member == null ) {
- return null;
- }
-
- MemberResponseDto.MemberResponseDtoBuilder memberResponseDto = MemberResponseDto.builder();
-
- memberResponseDto.id( member.getId() );
- memberResponseDto.name( member.getName() );
- memberResponseDto.loginId( member.getLoginId() );
- memberResponseDto.createdAt( member.getCreatedAt() );
- memberResponseDto.modifiedAt( member.getModifiedAt() );
-
- return memberResponseDto.build();
- }
-}
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberRepository.class.uniqueId1 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberRepository.class.uniqueId1
deleted file mode 100644
index 5bcdfae..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberRepository.class.uniqueId1 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberService.class.uniqueId12 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberService.class.uniqueId12
deleted file mode 100644
index 38dcd48..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/MemberService.class.uniqueId12 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/SecurityConfig.class.uniqueId2 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/SecurityConfig.class.uniqueId2
new file mode 100644
index 0000000..8e74cce
Binary files /dev/null and b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/SecurityConfig.class.uniqueId2 differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Todo$TodoBuilder.class.uniqueId10 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Todo$TodoBuilder.class.uniqueId10
deleted file mode 100644
index d3b2091..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Todo$TodoBuilder.class.uniqueId10 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Todo.class.uniqueId15 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Todo.class.uniqueId15
deleted file mode 100644
index 3a8a368..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/Todo.class.uniqueId15 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoController.class.uniqueId3 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoController.class.uniqueId3
deleted file mode 100644
index 0326700..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoController.class.uniqueId3 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapper.class.uniqueId14 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapper.class.uniqueId14
deleted file mode 100644
index 14e955d..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapper.class.uniqueId14 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapperImpl.class.uniqueId0 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapperImpl.class.uniqueId0
deleted file mode 100644
index 0813757..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapperImpl.class.uniqueId0 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapperImpl.java.uniqueId9 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapperImpl.java.uniqueId9
deleted file mode 100644
index a18ff8b..0000000
--- a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoMapperImpl.java.uniqueId9
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.todolist.todolist.dto.todo;
-
-import com.todolist.todolist.domain.Member;
-import com.todolist.todolist.domain.Todo;
-import javax.annotation.processing.Generated;
-
-@Generated(
- value = "org.mapstruct.ap.MappingProcessor",
- date = "2024-05-20T17:08:45+0900",
- comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-8.7.jar, environment: Java 17.0.10 (Oracle Corporation)"
-)
-public class TodoMapperImpl implements TodoMapper {
-
- @Override
- public Todo toEntity(TodoRequestDto todoRequestDto) {
- if ( todoRequestDto == null ) {
- return null;
- }
-
- Todo.TodoBuilder todo = Todo.builder();
-
- todo.title( todoRequestDto.getTitle() );
- todo.contents( todoRequestDto.getContents() );
- todo.isCompleted( todoRequestDto.getIsCompleted() );
- todo.dueAt( todoRequestDto.getDueAt() );
-
- return todo.build();
- }
-
- @Override
- public TodoResponseDto toDto(Todo todo) {
- if ( todo == null ) {
- return null;
- }
-
- TodoResponseDto.TodoResponseDtoBuilder todoResponseDto = TodoResponseDto.builder();
-
- todoResponseDto.memberId( todoMemberId( todo ) );
- todoResponseDto.id( todo.getId() );
- todoResponseDto.title( todo.getTitle() );
- todoResponseDto.contents( todo.getContents() );
- if ( todo.getIsCompleted() != null ) {
- todoResponseDto.isCompleted( todo.getIsCompleted() );
- }
- todoResponseDto.dueAt( todo.getDueAt() );
-
- return todoResponseDto.build();
- }
-
- private Long todoMemberId(Todo todo) {
- if ( todo == null ) {
- return null;
- }
- Member member = todo.getMember();
- if ( member == null ) {
- return null;
- }
- Long id = member.getId();
- if ( id == null ) {
- return null;
- }
- return id;
- }
-}
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoRepository.class.uniqueId8 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoRepository.class.uniqueId8
deleted file mode 100644
index a56ca57..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoRepository.class.uniqueId8 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoService.class.uniqueId13 b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoService.class.uniqueId13
deleted file mode 100644
index 6ea0043..0000000
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/compileTransaction/stash-dir/TodoService.class.uniqueId13 and /dev/null differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/previous-compilation-data.bin b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/previous-compilation-data.bin
index 4f803dd..93363dc 100644
Binary files a/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/previous-compilation-data.bin and b/contents/todoListAPI/hyeonseung/todolist/build/tmp/compileJava/previous-compilation-data.bin differ
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/config/JwtTokenFilter.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/config/JwtTokenFilter.java
new file mode 100644
index 0000000..8e7fe10
--- /dev/null
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/config/JwtTokenFilter.java
@@ -0,0 +1,70 @@
+package com.todolist.todolist.config;
+
+import com.todolist.todolist.domain.Member;
+import com.todolist.todolist.security.JwtTokenProvider;
+import com.todolist.todolist.service.MemberService;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
+import org.springframework.stereotype.Component;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+import java.io.IOException;
+import java.util.List;
+
+@Component
+@RequiredArgsConstructor
+public class JwtTokenFilter extends OncePerRequestFilter {
+
+ private final MemberService memberService;
+
+ private final JwtTokenProvider jwtTokenProvider;
+ @Override
+ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
+ String authorizationHeader = request.getHeader(HttpHeaders.AUTHORIZATION);
+
+ // 토큰 전송 x -> 로그인 x
+ if(authorizationHeader == null){
+ filterChain.doFilter(request, response);
+ return;
+ }
+
+ // "Bearer"로 시작 x -> 잘못된 토큰
+ if(!authorizationHeader.startsWith("Bearer")){
+ filterChain.doFilter(request, response);
+ return;
+ }
+
+ String token = authorizationHeader.split(" ")[1];
+
+ if(jwtTokenProvider.isExpired(token)){
+ filterChain.doFilter(request, response);
+ return;
+ }
+
+ String loginId = jwtTokenProvider.getLoginIdFromToken(token);
+
+ if ( loginId != null && SecurityContextHolder.getContext().getAuthentication() == null) {
+
+ if (jwtTokenProvider.validateToken(token,loginId)) {
+ Member loginMember = memberService.throwFindbyLoginId(loginId);
+
+ UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(
+ loginMember.getLoginId(), null, List.of(new SimpleGrantedAuthority(loginMember.getRole().name())));
+
+ authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
+
+ SecurityContextHolder.getContext().setAuthentication(authenticationToken);
+ }
+ }
+ filterChain.doFilter(request, response);
+ }
+}
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/config/SecurityConfig.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/config/SecurityConfig.java
new file mode 100644
index 0000000..88ba70a
--- /dev/null
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/config/SecurityConfig.java
@@ -0,0 +1,42 @@
+package com.todolist.todolist.config;
+
+import com.todolist.todolist.security.JwtTokenProvider;
+import com.todolist.todolist.service.MemberService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.http.SessionCreationPolicy;
+import org.springframework.security.web.SecurityFilterChain;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
+
+@Configuration
+@EnableWebSecurity
+public class SecurityConfig {
+
+ @Autowired
+ private JwtTokenFilter jwtTokenFilter;
+
+ @Bean
+ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
+ http
+ // CSRF 토큰 없이 요청 처리
+ .csrf((csrfConfig) ->
+ csrfConfig.disable())
+ .cors((corsConfig) ->
+ corsConfig.disable())
+ .sessionManagement((sessionManagement) ->
+ sessionManagement.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
+ .authorizeHttpRequests((authorizeRequests) ->
+ authorizeRequests
+ .requestMatchers("/","/swagger-ui/**","/v3/api-docs/**").permitAll()
+ .requestMatchers("/api/members","api/members/login").permitAll()
+ .anyRequest().authenticated())
+ .addFilterBefore(jwtTokenFilter, UsernamePasswordAuthenticationFilter.class);
+
+ return http.build();
+ }
+
+
+}
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/controller/MemberController.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/controller/MemberController.java
index 252faea..6d0a0f3 100644
--- a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/controller/MemberController.java
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/controller/MemberController.java
@@ -1,15 +1,20 @@
package com.todolist.todolist.controller;
+import com.todolist.todolist.config.JwtTokenFilter;
import com.todolist.todolist.dto.member.MemberLoginResponseDto;
import com.todolist.todolist.dto.member.MemberResponseDto;
import com.todolist.todolist.dto.member.MemberRequestDto;
+import com.todolist.todolist.security.CustomUserDetailService;
+import com.todolist.todolist.security.JwtTokenProvider;
import com.todolist.todolist.service.MemberService;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
+import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -20,6 +25,13 @@
public class MemberController {
private final MemberService memberService;
+ @Value("${jwt.secret")
+ private String key;
+
+ private final JwtTokenProvider jwtTokenProvider;
+
+ private CustomUserDetailService userDetailService;
+
@Operation(summary = "회원가입")
@PostMapping
public ResponseEntity createMember(@Valid @RequestBody MemberRequestDto request) {
@@ -30,9 +42,13 @@ public ResponseEntity createMember(@Valid @RequestBody Member
@Operation(summary = "로그인")
@PostMapping("/login")
- public ResponseEntity loginMember(@RequestBody @Valid MemberRequestDto.LoginRequestDto request){
+ public String loginMember(@RequestBody @Valid MemberRequestDto.LoginRequestDto request){
MemberLoginResponseDto responseDto = memberService.login(request);
- return ResponseEntity.status(HttpStatus.CREATED).body(responseDto);
+
+ String jwtToken = jwtTokenProvider.createToken(request.getLoginId());
+
+ return jwtToken;
+ // return ResponseEntity.status(HttpStatus.CREATED).body(responseDto);
}
@Operation(summary = "회원정보 수정")
@PutMapping("/{memberId}")
@@ -65,5 +81,4 @@ public ResponseEntity delete(@PathVariable Long memberId){
return ResponseEntity.noContent().build();
}
-
}
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/domain/Member.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/domain/Member.java
index ec5cb22..be6f032 100644
--- a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/domain/Member.java
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/domain/Member.java
@@ -28,12 +28,16 @@ public class Member extends BaseEntity{
// 1:N ] N쪽이 FK가진 연관관계의 주인
private List todoList = new ArrayList<>();
+ @Enumerated(EnumType.STRING)
+ private Role role = Role.USER;
+
@Builder
- private Member(String name, String loginId, String password, List todoList){
+ private Member(String name, String loginId, String password, List todoList, Role role){
this.name = name;
this.loginId = loginId;
this.password = password;
this.todoList = todoList;
+ this.role = role;
}
public void updateLoginId(String loginId){
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/domain/Role.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/domain/Role.java
new file mode 100644
index 0000000..0d9a692
--- /dev/null
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/domain/Role.java
@@ -0,0 +1,6 @@
+package com.todolist.todolist.domain;
+
+public enum Role {
+ USER,
+ ADMIN
+}
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/CustomUserDetailService.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/CustomUserDetailService.java
new file mode 100644
index 0000000..431aa36
--- /dev/null
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/CustomUserDetailService.java
@@ -0,0 +1,39 @@
+package com.todolist.todolist.security;
+
+import com.todolist.todolist.domain.Member;
+import com.todolist.todolist.repository.MemberRepository;
+import com.todolist.todolist.validators.BaseException;
+import com.todolist.todolist.validators.ErrorCode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Optional;
+
+@Service
+public class CustomUserDetailService implements UserDetailsService {
+
+ @Autowired
+ private MemberRepository memberRepository;
+
+ @Override
+ public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
+ Optional memberOptional = memberRepository.findByLoginId(username);
+ if(!memberOptional.isPresent()){
+ throw new BaseException(ErrorCode.NOT_EXIST_ID);
+ }
+
+ Member member = memberOptional.get();
+ GrantedAuthority authority = new SimpleGrantedAuthority("ROLE_" + member.getRole());
+ return new
+ User(member.getLoginId(),member.getPassword(), Collections.singletonList(authority));
+
+ }
+}
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/JwtTokenProvider.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/JwtTokenProvider.java
new file mode 100644
index 0000000..ae5cee9
--- /dev/null
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/JwtTokenProvider.java
@@ -0,0 +1,114 @@
+package com.todolist.todolist.security;
+
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.ExpiredJwtException;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+import io.jsonwebtoken.io.Decoders;
+import io.jsonwebtoken.security.Keys;
+
+import jakarta.annotation.PostConstruct;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.stereotype.Component;
+
+import java.security.Key;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.stream.Collectors;
+
+@Component
+public class JwtTokenProvider {
+
+ // 비밀키
+ @Value("${jwt.secret}")
+ private String secretKeyBase64;
+
+ @Value("${jwt.token-validity-in-seconds}")
+ private static long tokenValidityInSeconds;
+
+ private Key key;
+
+ @PostConstruct
+ public void init() {
+ byte[] keyBytes = java.util.Base64.getDecoder().decode(secretKeyBase64);
+ this.key = Keys.hmacShaKeyFor(keyBytes);
+ }
+
+ // 유저 정보를 가지고 AccessToken, RefreshToken 을 생성하는 메서드
+ public String createToken(String loginId) {
+ // Claim = Jwt Token에 들어갈 정보
+ // Claim에 loginId를 넣어 줌으로써 나중에 loginId를 꺼낼 수 있음
+ Claims claims = Jwts.claims();
+ claims.put("loginId", loginId);
+
+ return Jwts.builder()
+ .setClaims(claims)
+ .setIssuedAt(new Date(System.currentTimeMillis()))
+ .setExpiration(new Date(System.currentTimeMillis() + tokenValidityInSeconds))
+ .signWith(key, SignatureAlgorithm.HS256)
+ .compact();
+ }
+
+ // JWT 토큰을 복호화하여 토큰에 들어있는 정보를 꺼내는 메서드
+ public Authentication getAuthentication(String token) {
+ // 토큰 복호화
+ Claims claims = parseClaims(token);
+
+ if (claims.get("auth") == null) {
+ throw new RuntimeException("권한 정보가 없는 토큰입니다.");
+ }
+
+ // 클레임에서 권한 정보 가져오기
+ Collection extends GrantedAuthority> authorities =
+ Arrays.stream(claims.get("auth").toString().split(","))
+ .map(SimpleGrantedAuthority::new)
+ .collect(Collectors.toList());
+
+ // UserDetails 객체를 만들어서 Authentication 리턴
+ UserDetails principal = new User(claims.getSubject(), "", authorities);
+ return new UsernamePasswordAuthenticationToken(principal, "", authorities);
+ }
+
+ // Claims에서 memberId 추출
+ public String getLoginIdFromToken(String token) {
+ return extractClaims(token).get("loginId").toString();
+ }
+
+
+ // SecretKey를 사용해 Token Parsing
+ private Claims extractClaims(String token) {
+ return Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(token).getBody();
+ }
+
+ // 발급된 Token이 만료 시간이 지났는지 체크
+ public boolean isExpired(String token) {
+ return extractClaims(token).getExpiration().before(new Date());
+ }
+
+
+ // 토큰 정보를 검증하는 메서드
+ public boolean validateToken(String token, String loginId) {
+ String id = getLoginIdFromToken(token);
+ return (id.equals(loginId) && !isExpired(token));
+ }
+
+ // 토큰 복호화
+ private Claims parseClaims(String accessToken) {
+ try {
+ return Jwts.parserBuilder()
+ .setSigningKey(key)
+ .build()
+ .parseClaimsJws(accessToken)
+ .getBody();
+ } catch (ExpiredJwtException e) {
+ return e.getClaims();
+ }
+ }
+}
\ No newline at end of file
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/PasswordConfig.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/PasswordConfig.java
new file mode 100644
index 0000000..a9ade69
--- /dev/null
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/security/PasswordConfig.java
@@ -0,0 +1,14 @@
+package com.todolist.todolist.security;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.password.PasswordEncoder;
+@Configuration
+public class PasswordConfig {
+
+ @Bean
+ public PasswordEncoder passwordEncoder(){
+ return new BCryptPasswordEncoder();
+ }
+}
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/service/MemberService.java b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/service/MemberService.java
index ca6f716..fcd91d5 100644
--- a/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/service/MemberService.java
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/java/com/todolist/todolist/service/MemberService.java
@@ -91,13 +91,13 @@ public void delete(Long id){
}
// 회원 조회 메서드
- private Member throwFindbyId(Long id){
+ public Member throwFindbyId(Long id){
return memberRepository.findById(id)
.orElseThrow(() -> new BaseException(ErrorCode.NOT_EXIST_ID));
}
// 회원 조회 - 로그인 아이디 조회 메서드
- private Member throwFindbyLoginId(String loginId){
+ public Member throwFindbyLoginId(String loginId){
return memberRepository.findByLoginId(loginId)
.orElseThrow(()-> new BaseException(ErrorCode.NOT_EXIST_ID));
}
diff --git a/contents/todoListAPI/hyeonseung/todolist/src/main/resources/application.properties b/contents/todoListAPI/hyeonseung/todolist/src/main/resources/application.properties
new file mode 100644
index 0000000..4809efe
--- /dev/null
+++ b/contents/todoListAPI/hyeonseung/todolist/src/main/resources/application.properties
@@ -0,0 +1,29 @@
+spring.application.name=todolist
+
+## DB ì¤ì
+
+# MySQL
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+
+# DB Source URL
+spring.datasource.url=jdbc:mysql://localhost:3306/todolist
+#characterEncoding=UTF-8&serverTimezone=UTC
+spring.datasource.username=root
+spring.datasource.password=root
+
+# DDL(create,alter,drop)
+spring.jpa.hibernate.ddl-auto=create
+
+#sql ë³´ì¬ì£¼ê¸°
+spring.jpa.show-sql=true
+
+spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQLDialect
+spring.jpa.properties.hibernate.format_sql=true
+
+
+#DRIVER SETTING
+#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
+
+# jwt
+jwt.secret=VlwEyVBsYt9V7zq57TejMnVUyzblYcfPQye08f7MGVA9XkHa
+jwt.token-validity-in-seconds=86400000
\ No newline at end of file