diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..a178c9f
Binary files /dev/null and b/.DS_Store differ
diff --git a/.gradle/8.1.1/checksums/checksums.lock b/.gradle/8.1.1/checksums/checksums.lock
deleted file mode 100644
index c860a62..0000000
Binary files a/.gradle/8.1.1/checksums/checksums.lock and /dev/null differ
diff --git a/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock b/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock
deleted file mode 100644
index aea0c51..0000000
Binary files a/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock and /dev/null differ
diff --git a/.gradle/8.1.1/executionHistory/executionHistory.lock b/.gradle/8.1.1/executionHistory/executionHistory.lock
deleted file mode 100644
index 27b0e26..0000000
Binary files a/.gradle/8.1.1/executionHistory/executionHistory.lock and /dev/null differ
diff --git a/.gradle/8.1.1/fileChanges/last-build.bin b/.gradle/8.1.1/fileChanges/last-build.bin
deleted file mode 100644
index f76dd23..0000000
Binary files a/.gradle/8.1.1/fileChanges/last-build.bin and /dev/null differ
diff --git a/.gradle/8.1.1/fileHashes/fileHashes.lock b/.gradle/8.1.1/fileHashes/fileHashes.lock
deleted file mode 100644
index 22cabd2..0000000
Binary files a/.gradle/8.1.1/fileHashes/fileHashes.lock and /dev/null differ
diff --git a/.gradle/8.1.1/gc.properties b/.gradle/8.1.1/gc.properties
deleted file mode 100644
index e69de29..0000000
diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock
deleted file mode 100644
index 6394df6..0000000
Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and /dev/null differ
diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties
deleted file mode 100644
index d8d5482..0000000
--- a/.gradle/buildOutputCleanup/cache.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-#Mon Jul 03 14:30:27 KST 2023
-gradle.version=8.1.1
diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties
deleted file mode 100644
index e69de29..0000000
diff --git a/.idea/$CACHE_FILE$ b/.idea/$CACHE_FILE$
deleted file mode 100644
index f9784d3..0000000
--- a/.idea/$CACHE_FILE$
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- Android
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 26d3352..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/.idea/.name b/.idea/.name
deleted file mode 100644
index 37e6a33..0000000
--- a/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-DongnaeFriend
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index a4b7174..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml
deleted file mode 100644
index d68d958..0000000
--- a/.idea/dbnavigator.xml
+++ /dev/null
@@ -1,463 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/dictionaries b/.idea/dictionaries
deleted file mode 100644
index 149349d..0000000
--- a/.idea/dictionaries
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 859c9b3..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
deleted file mode 100644
index fdc392f..0000000
--- a/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 4bc4fc6..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1dd..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 689a83e..ba1dac1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,8 +2,10 @@ plugins {
id 'java'
id 'org.springframework.boot' version '2.7.13'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
+ id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
}
+
group = 'com.umc'
version = '0.0.1-SNAPSHOT'
@@ -26,16 +28,52 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
+
+ // querydsl 추가
+ implementation "com.querydsl:querydsl-jpa:5.0.0"
+ implementation "com.querydsl:querydsl-apt:5.0.0"
+
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
+
+ //gson
+ implementation 'com.google.code.gson:gson:2.8.8'
+
+ //jwt
+ implementation 'io.jsonwebtoken:jjwt:0.9.1'
+
+ //thymeleaf
+ implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
}
tasks.named('test') {
useJUnitPlatform()
}
+
+
jar {
enabled = false
}
+
+// Qtype 생성 경로
+def querydslDir = "$buildDir/generated/querydsl"
+querydsl {
+ jpa = true
+ querydslSourcesDir = querydslDir
+}
+sourceSets {
+ main.java.srcDir querydslDir
+}
+compileQuerydsl{
+ options.annotationProcessorPath = configurations.querydsl
+}
+configurations {
+ compileOnly {
+ extendsFrom annotationProcessor
+ }
+ querydsl.extendsFrom compileClasspath
+}
+
diff --git a/out/production/classes/com/umc/DongnaeFriend/DongnaeFriendApplication.class b/out/production/classes/com/umc/DongnaeFriend/DongnaeFriendApplication.class
deleted file mode 100644
index 9880d22..0000000
Binary files a/out/production/classes/com/umc/DongnaeFriend/DongnaeFriendApplication.class and /dev/null differ
diff --git a/out/production/classes/com/umc/DongnaeFriend/HealthCheckController.class b/out/production/classes/com/umc/DongnaeFriend/HealthCheckController.class
deleted file mode 100644
index 4f3fc49..0000000
Binary files a/out/production/classes/com/umc/DongnaeFriend/HealthCheckController.class and /dev/null differ
diff --git a/out/production/classes/com/umc/DongnaeFriend/domain/user/entity/User.class b/out/production/classes/com/umc/DongnaeFriend/domain/user/entity/User.class
deleted file mode 100644
index df7c895..0000000
Binary files a/out/production/classes/com/umc/DongnaeFriend/domain/user/entity/User.class and /dev/null differ
diff --git a/out/production/resources/application.yml b/out/production/resources/application.yml
deleted file mode 100644
index 7878137..0000000
--- a/out/production/resources/application.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-logging:
- level:
- com.example.carrotmarket: debug
- org.hibernate.SQL: debug
-
-spring:
- jpa:
- properties:
- hibernate:
- format_sql: true
----
-# Settings for local
-spring:
- datasource:
- url: jdbc:mysql://localhost:3306/dongnae?characterEncoding=UTF-8&serverTimezone=UTC&useLegacyDatetimeCode=false
- username: dongnae
- password: df1234
- driver-class-name: com.mysql.cj.jdbc.Driver
- jpa:
- hibernate.ddl-auto: create
\ No newline at end of file
diff --git a/out/test/classes/com/umc/DongnaeFriend/DongnaeFriendApplicationTests.class b/out/test/classes/com/umc/DongnaeFriend/DongnaeFriendApplicationTests.class
deleted file mode 100644
index 2e115dc..0000000
Binary files a/out/test/classes/com/umc/DongnaeFriend/DongnaeFriendApplicationTests.class and /dev/null differ
diff --git a/src/.DS_Store b/src/.DS_Store
new file mode 100644
index 0000000..0f989cb
Binary files /dev/null and b/src/.DS_Store differ
diff --git a/src/main/.DS_Store b/src/main/.DS_Store
new file mode 100644
index 0000000..60811ad
Binary files /dev/null and b/src/main/.DS_Store differ
diff --git a/src/main/java/com/umc/DongnaeFriend/KakaoTokenController.java b/src/main/java/com/umc/DongnaeFriend/KakaoTokenController.java
new file mode 100644
index 0000000..d9668b9
--- /dev/null
+++ b/src/main/java/com/umc/DongnaeFriend/KakaoTokenController.java
@@ -0,0 +1,85 @@
+package com.umc.DongnaeFriend;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.umc.DongnaeFriend.domain.user.dto.UserDto;
+import com.umc.DongnaeFriend.domain.user.service.KakaoService;
+import com.umc.DongnaeFriend.domain.user.service.UserService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@Controller
+@RequestMapping("")
+public class KakaoTokenController {
+
+ @Autowired
+ private UserService userService;
+
+ @Autowired
+ private KakaoService kakaoService;
+
+ @GetMapping("/kakao")
+ public String kakologin(Model model, HttpServletResponse response) {
+ response.setContentType(MediaType.TEXT_HTML_VALUE);
+
+ return "html/index";
+ }
+
+ @GetMapping("/callback")
+ public String callback(Model model, @RequestParam("code") String code) throws IOException {
+
+ try {
+//------kakao POST 요청------
+ String reqURL = "https://kauth.kakao.com/oauth/token?grant_type=authorization_code&client_id=1ad317e194df665ca44dcb82d11a7093&code=" + code;
+ URL url = new URL(reqURL);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestMethod("POST");
+
+
+ BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+
+ String line = "";
+ String result = "";
+
+ while ((line = br.readLine()) != null) {
+ result += line;
+ }
+
+ ObjectMapper objectMapper = new ObjectMapper();
+ Map jsonMap = objectMapper.readValue(result, new TypeReference