Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

227 feat/build src query dsl #228

Merged
merged 7 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DockerfileDev
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ FROM openjdk:11
ARG JAR_FILE=build/libs/V2-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} app.jar


ENTRYPOINT ["java","-jar","app.jar","--spring.profiles.active=dev"]
77 changes: 47 additions & 30 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot") version "2.7.5"
id("io.spring.dependency-management") version "1.0.15.RELEASE"
kotlin("jvm") version "1.6.21"
kotlin("plugin.spring") version "1.6.21"
kotlin("plugin.jpa") version "1.6.21"
id("org.springframework.boot") version PluginVersions.SPRING_BOOT_VERSION
id("io.spring.dependency-management") version PluginVersions.SPRING_MANAGE_VERSION
id("com.ewerk.gradle.plugins.querydsl") version PluginVersions.QUERY_DSL_PLUGIN_VERSION

kotlin("jvm") version PluginVersions.JVM_VERSION
kotlin("plugin.spring") version PluginVersions.SPRING_PLUG_IN_VERSION
kotlin("plugin.jpa") version PluginVersions.JPA_VERSION
kotlin("kapt") version PluginVersions.KAPT_VERSION
idea
}

group = "com.dotori"
Expand All @@ -17,30 +21,32 @@ repositories {
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-data-redis")
implementation("org.springframework.boot:spring-boot-starter-mail")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
runtimeOnly("com.h2database:h2")
runtimeOnly("org.mariadb.jdbc:mariadb-java-client")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("io.kotest:kotest-runner-junit5:5.5.5")
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.1.2")
testImplementation("io.kotest:kotest-assertions-core:5.5.5")
testImplementation("io.kotest:kotest-framework-engine-jvm:5.5.5")
testImplementation("io.mockk:mockk:1.13.4")
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.11.5")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.5")
implementation("com.amazonaws:aws-java-sdk-ses:1.12.347")
implementation("aws.sdk.kotlin:ses:0.16.0")
implementation("org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE")
implementation(Dependencies.SPRING_JPA)
implementation(Dependencies.SPRING_REDIS)
implementation(Dependencies.MAIL)
implementation(Dependencies.SECURITY)
implementation(Dependencies.VALIDATION)
implementation(Dependencies.WEB)
implementation(Dependencies.KOTLIN_JACKSON)
implementation(Dependencies.KOTLIN_REFLECT)
implementation(Dependencies.KOTLIN_STDLIB)
runtimeOnly(Dependencies.H2_DATABASE)
runtimeOnly(Dependencies.MARIA_DATABASE)
testImplementation(Dependencies.SPRING_TEST)
testImplementation(Dependencies.SECURITY_TEST)
testImplementation(Dependencies.KOTEST_RUNNER)
testImplementation(Dependencies.KOTEST_EXTENSION)
testImplementation(Dependencies.KOTEST_ASSERTIONS)
testImplementation(Dependencies.KOTEST_JVM)
testImplementation(Dependencies.MOCKK)
implementation(Dependencies.JWT_API)
runtimeOnly(Dependencies.JWT_IMPL)
runtimeOnly(Dependencies.JWT_JACKSON)
implementation(Dependencies.AWS_SES)
implementation(Dependencies.KOTLIN_SES)
implementation(Dependencies.SPRING_CLOUD)
implementation(Dependencies.QUERY_DSL)
implementation(Dependencies.QUERY_DSL_APT)
}

tasks.withType<KotlinCompile> {
Expand All @@ -54,14 +60,25 @@ tasks.withType<Test> {
useJUnitPlatform()
}

idea {
module {
val kaptMain = file("build/generated/source/kapt/main")
sourceDirs.add(kaptMain)
generatedSourceDirs.add(kaptMain)
}
}

buildscript {
repositories {
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath("io.kotest:kotest-gradle-plugin:0.4.10")
classpath(Dependencies.KOTEST_PLUG_IN)
}
}



apply(plugin = "io.kotest")
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}
49 changes: 49 additions & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
object Dependencies {

// spring
const val SPRING_JPA = "org.springframework.boot:spring-boot-starter-data-jpa"
const val SPRING_REDIS = "org.springframework.boot:spring-boot-starter-data-redis"
const val MAIL = "org.springframework.boot:spring-boot-starter-mail"
const val SECURITY = "org.springframework.boot:spring-boot-starter-security"
const val VALIDATION = "org.springframework.boot:spring-boot-starter-validation"
const val WEB = "org.springframework.boot:spring-boot-starter-web"
const val SPRING_CLOUD = "org.springframework.cloud:spring-cloud-starter-aws:${DependencyVersions.SPRING_CLOUD_VERSION}"


// kotlin
const val KOTLIN_JACKSON = "com.fasterxml.jackson.module:jackson-module-kotlin"
const val KOTLIN_REFLECT = "org.jetbrains.kotlin:kotlin-reflect"
const val KOTLIN_STDLIB = "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

// h2
const val H2_DATABASE = "com.h2database:h2"
const val MARIA_DATABASE = "org.mariadb.jdbc:mariadb-java-client"

// test
const val SPRING_TEST = "org.springframework.boot:spring-boot-starter-test"
const val SECURITY_TEST = "org.springframework.security:spring-security-test"

// kotest
const val KOTEST_PLUG_IN = "io.kotest:kotest-gradle-plugin:${PluginVersions.KOTEST_PLUG_IN_VERSION}"
const val KOTEST_RUNNER = "io.kotest:kotest-runner-junit5:${DependencyVersions.KOTEST_RUNNER_VERSION}"
const val KOTEST_EXTENSION = "io.kotest.extensions:kotest-extensions-spring:${DependencyVersions.KOTEST_EXTENSION_VERSION}"
const val KOTEST_ASSERTIONS = "io.kotest:kotest-assertions-core:${DependencyVersions.KOTEST_ASSERTIONS_VERSION}"
const val KOTEST_JVM = "io.kotest:kotest-framework-engine-jvm:${DependencyVersions.KOTEST_JVM_VERSION}"

// mockk
const val MOCKK = "io.mockk:mockk:${DependencyVersions.MOCKK_VERSION}"

// jwt
const val JWT_API = "io.jsonwebtoken:jjwt-api:${DependencyVersions.JWT_API_VERSION}"
const val JWT_IMPL = "io.jsonwebtoken:jjwt-api:${DependencyVersions.JWT_IMPL_VERSION}"
const val JWT_JACKSON = "io.jsonwebtoken:jjwt-api:${DependencyVersions.JWT_JACKSON_VERSION}"

// aws
const val AWS_SES = "com.amazonaws:aws-java-sdk-ses:${DependencyVersions.AWS_SES_VERSION}"
const val KOTLIN_SES = "org.springframework.cloud:spring-cloud-starter-aws:${DependencyVersions.KOTLIN_SES_VERSION}"

// querydsl
const val QUERY_DSL = "com.querydsl:querydsl-jpa:${DependencyVersions.QUERY_DSL_VERSION}"
const val QUERY_DSL_APT = "com.querydsl:querydsl-apt:${DependencyVersions.QUERY_DSL_APT_VERSION}:jpa"

}
27 changes: 27 additions & 0 deletions buildSrc/src/main/kotlin/DependencyVersions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
object DependencyVersions {

// spring
const val SPRING_CLOUD_VERSION = "2.2.6.RELEASE"

// kotest
const val KOTEST_RUNNER_VERSION = "5.5.5"
const val KOTEST_EXTENSION_VERSION = "1.1.2"
const val KOTEST_ASSERTIONS_VERSION = "5.5.5"
const val KOTEST_JVM_VERSION = "5.5.5"

// mockk
const val MOCKK_VERSION = "1.13.4"

// jwt
const val JWT_API_VERSION = "0.11.5"
const val JWT_IMPL_VERSION = "0.11.5"
const val JWT_JACKSON_VERSION= "0.11.5"

// aws
const val AWS_SES_VERSION = "1.12.347"
const val KOTLIN_SES_VERSION = "0.16.0"

// querydsl
const val QUERY_DSL_VERSION = "5.0.0"
const val QUERY_DSL_APT_VERSION = "5.0.0"
}
10 changes: 10 additions & 0 deletions buildSrc/src/main/kotlin/PluginVersions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
object PluginVersions {
const val SPRING_BOOT_VERSION = "2.7.5"
const val SPRING_MANAGE_VERSION = "1.0.15.RELEASE"
const val JVM_VERSION = "1.6.21"
const val SPRING_PLUG_IN_VERSION = "1.6.21"
const val JPA_VERSION = "1.6.21"
const val KOTEST_PLUG_IN_VERSION = "0.4.10"
const val KAPT_VERSION = "1.7.10"
const val QUERY_DSL_PLUGIN_VERSION = "1.0.10"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.dotori.v2.domain.self_study.domain.repository

import com.dotori.v2.domain.member.domain.entity.Member
import com.dotori.v2.domain.self_study.domain.entity.SelfStudy
import kotlinx.coroutines.selects.select
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional
class SearchStudentServiceImpl(
private val memberRepository: MemberRepository
) : SearchStudentService {

override fun execute(
searchRequestDto: SearchRequestDto
): List<SearchStudentListResDto> =
Expand Down