From 5bcb1e1742f55831f0e633a2dbe11d2546fe0614 Mon Sep 17 00:00:00 2001 From: wken5577 Date: Wed, 6 Mar 2024 16:24:10 +0900 Subject: [PATCH 1/3] [FEAT] #688 api module add --- build.gradle | 16 ++++++ .../main/java/gg/PingpongApiApplication.java | 2 +- gg-recruit-api/build.gradle | 53 +++++++++++++++++++ .../java/gg/recruit/api/TestController.java | 13 +++++ gg-utils/build.gradle | 2 + settings.gradle | 1 + 6 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 gg-recruit-api/build.gradle create mode 100644 gg-recruit-api/src/main/java/gg/recruit/api/TestController.java diff --git a/build.gradle b/build.gradle index 2f5aefec4..a9cadd9a4 100644 --- a/build.gradle +++ b/build.gradle @@ -56,6 +56,9 @@ subprojects { implementation 'org.springframework.boot:spring-boot-starter-data-redis' implementation 'org.redisson:redisson:3.17.3' + //devtools + implementation 'org.springframework.boot:spring-boot-devtools' + /* spring doc */ implementation 'org.springdoc:springdoc-openapi-ui:1.6.6' @@ -238,6 +241,19 @@ subprojects { project(':gg-pingpong-api') { bootJar { enabled = true } jar { enabled = true } + dependencies { + implementation project(':gg-data') + implementation project(':gg-repo') + implementation project(':gg-admin-repo') + implementation project(':gg-utils') + implementation project(':gg-auth') + implementation project(':gg-recruit-api') + } +} + +project(':gg-pingpong-api') { + bootJar { enabled = false } + jar { enabled = true } dependencies { implementation project(':gg-data') implementation project(':gg-repo') diff --git a/gg-pingpong-api/src/main/java/gg/PingpongApiApplication.java b/gg-pingpong-api/src/main/java/gg/PingpongApiApplication.java index d2cc3673a..b61ffb94e 100644 --- a/gg-pingpong-api/src/main/java/gg/PingpongApiApplication.java +++ b/gg-pingpong-api/src/main/java/gg/PingpongApiApplication.java @@ -4,7 +4,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication(scanBasePackages = {"gg.admin.repo", "gg.data", "gg.repo", - "gg.pingpong.api", "gg.utils", "gg.party.api", "gg.auth"}) + "gg.pingpong.api", "gg.utils", "gg.party.api", "gg.auth", "gg.recruit.api"}) public class PingpongApiApplication { public static void main(String[] args) { diff --git a/gg-recruit-api/build.gradle b/gg-recruit-api/build.gradle new file mode 100644 index 000000000..9edc92c20 --- /dev/null +++ b/gg-recruit-api/build.gradle @@ -0,0 +1,53 @@ +plugins { + id 'java' +} + +group 'gg.api' +version '42gg' + +repositories { + mavenCentral() +} + +dependencies { + /* spring */ + implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-mail' + annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' + + implementation 'org.springframework.session:spring-session-data-redis' + + /* oauth */ + implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' + + /* JSON Web Token */ + implementation 'io.jsonwebtoken:jjwt-api:0.11.2' + implementation 'io.jsonwebtoken:jjwt-impl:0.11.2' + implementation 'io.jsonwebtoken:jjwt-jackson:0.11.2' + + /* StringUtils */ + implementation 'org.apache.commons:commons-lang3:3.12.0' + + /* REST template */ + implementation 'org.apache.httpcomponents:httpcore:4.4.15' + implementation 'org.apache.httpcomponents:httpclient:4.5.13' + /* HttpHeaders */ + implementation 'com.google.guava:guava:31.0.1-jre' + + /* S3 Image Bucket */ + implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' + implementation 'org.springframework:spring-test:5.3.20' + implementation "com.amazonaws:aws-java-sdk-s3:1.12.281" + + testImplementation 'org.springframework.security:spring-security-test' + + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' + testImplementation testFixtures(project(':gg-utils')) +} + +test { + useJUnitPlatform() +} diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java b/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java new file mode 100644 index 000000000..aaf8a81f7 --- /dev/null +++ b/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java @@ -0,0 +1,13 @@ +package gg.recruit.api; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class TestController { + + @GetMapping("/test") + public String test() { + return "test"; + } +} diff --git a/gg-utils/build.gradle b/gg-utils/build.gradle index ee14b69b8..cad5924ec 100644 --- a/gg-utils/build.gradle +++ b/gg-utils/build.gradle @@ -92,12 +92,14 @@ dependencies { testFixturesImplementation project(":gg-repo") testFixturesImplementation project(":gg-admin-repo") testFixturesImplementation project(":gg-pingpong-api") + testFixturesImplementation project(":gg-recruit-api") jacocoAggregation(project(':gg-data')) jacocoAggregation(project(':gg-auth')) jacocoAggregation(project(':gg-repo')) jacocoAggregation(project(':gg-admin-repo')) jacocoAggregation(project(':gg-pingpong-api')) + jacocoAggregation(project(':gg-recruit-api')) } test { diff --git a/settings.gradle b/settings.gradle index 887aef09f..9e311f424 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,4 +5,5 @@ include 'gg-repo' include 'gg-pingpong-api' include 'gg-utils' include 'gg-auth' +include 'gg-recruit-api' From ba041dad03f4caac40f1b83b579bacdaec5cde3d Mon Sep 17 00:00:00 2001 From: wken5577 Date: Wed, 6 Mar 2024 16:40:27 +0900 Subject: [PATCH 2/3] [FIX] #668 check style fix --- .../controller/CoinPolicyAdminControllerTest.java | 13 +++---------- .../testFixtures/java/gg/utils/TestDataUtils.java | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java index affef5991..c9eaa3e2d 100644 --- a/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java +++ b/gg-pingpong-api/src/test/java/gg/pingpong/api/admin/coin/controller/CoinPolicyAdminControllerTest.java @@ -18,11 +18,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import gg.admin.repo.store.CoinPolicyAdminRepository; - -import gg.data.pingpong.store.CoinPolicy; - import gg.auth.utils.AuthTokenProvider; - +import gg.data.pingpong.store.CoinPolicy; import gg.data.user.User; import gg.pingpong.api.admin.store.controller.response.CoinPolicyAdminListResponseDto; import gg.pingpong.api.admin.store.dto.CoinPolicyAdminAddDto; @@ -38,18 +35,14 @@ class CoinPolicyAdminControllerTest { @Autowired TestDataUtils testDataUtils; - - @Autowired - private MockMvc mockMvc; - @Autowired ObjectMapper objectMapper; - @Autowired AuthTokenProvider tokenProvider; - @Autowired CoinPolicyAdminRepository coinPolicyAdminRepository; + @Autowired + private MockMvc mockMvc; @Test @DisplayName("[Get]/pingpong/admin/coinpolicy") diff --git a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java index e4a6bf48f..f1ec3b36d 100644 --- a/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java +++ b/gg-utils/src/testFixtures/java/gg/utils/TestDataUtils.java @@ -9,6 +9,7 @@ import org.springframework.stereotype.Component; +import gg.auth.utils.AuthTokenProvider; import gg.data.manage.Announcement; import gg.data.noti.Noti; import gg.data.noti.type.NotiType; @@ -37,7 +38,6 @@ import gg.data.user.type.SnsType; import gg.pingpong.api.admin.tournament.controller.request.TournamentAdminCreateRequestDto; import gg.pingpong.api.admin.tournament.controller.request.TournamentAdminUpdateRequestDto; -import gg.auth.utils.AuthTokenProvider; import gg.pingpong.api.user.tournament.controller.response.TournamentResponseDto; import gg.pingpong.api.user.user.dto.UserImageDto; import gg.repo.game.GameRepository; From 0c383aa8badb512b64faa52fac2d139a5845ea51 Mon Sep 17 00:00:00 2001 From: wken5577 Date: Wed, 6 Mar 2024 17:21:25 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[FEAT]=20#688=20build=20=EC=A2=85=EC=86=A1?= =?UTF-8?q?=EC=84=B1=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- gg-recruit-api/build.gradle | 22 ------------------- .../java/gg/recruit/api/TestController.java | 9 ++++++++ 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index a9cadd9a4..c64de17ee 100644 --- a/build.gradle +++ b/build.gradle @@ -251,7 +251,7 @@ project(':gg-pingpong-api') { } } -project(':gg-pingpong-api') { +project(':gg-recruit-api') { bootJar { enabled = false } jar { enabled = true } dependencies { diff --git a/gg-recruit-api/build.gradle b/gg-recruit-api/build.gradle index 9edc92c20..215acef41 100644 --- a/gg-recruit-api/build.gradle +++ b/gg-recruit-api/build.gradle @@ -16,31 +16,9 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-mail' annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' - implementation 'org.springframework.session:spring-session-data-redis' - - /* oauth */ - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - - /* JSON Web Token */ - implementation 'io.jsonwebtoken:jjwt-api:0.11.2' - implementation 'io.jsonwebtoken:jjwt-impl:0.11.2' - implementation 'io.jsonwebtoken:jjwt-jackson:0.11.2' - /* StringUtils */ implementation 'org.apache.commons:commons-lang3:3.12.0' - /* REST template */ - implementation 'org.apache.httpcomponents:httpcore:4.4.15' - implementation 'org.apache.httpcomponents:httpclient:4.5.13' - /* HttpHeaders */ - implementation 'com.google.guava:guava:31.0.1-jre' - - /* S3 Image Bucket */ - implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE' - implementation 'org.springframework:spring-test:5.3.20' - implementation "com.amazonaws:aws-java-sdk-s3:1.12.281" - testImplementation 'org.springframework.security:spring-security-test' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' diff --git a/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java b/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java index aaf8a81f7..2764d00f9 100644 --- a/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java +++ b/gg-recruit-api/src/main/java/gg/recruit/api/TestController.java @@ -3,6 +3,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; +import gg.auth.UserDto; +import gg.auth.argumentresolver.Login; + @RestController public class TestController { @@ -10,4 +13,10 @@ public class TestController { public String test() { return "test"; } + + @GetMapping("/login") + public String login(@Login UserDto user) { + System.out.println("user = " + user); + return "login"; + } }