From 2a83907be14b11698ab45df861ac9405753c4107 Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Thu, 28 Jan 2021 13:22:46 +0700 Subject: [PATCH] Add customer api module for demo --- customer-api/build.gradle.kts | 8 ++++++++ demo/build.gradle.kts | 1 + demo/src/main/kotlin/com/example/demo/DemoApplication.kt | 7 +++++-- demo/src/main/resources/application.properties | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/customer-api/build.gradle.kts b/customer-api/build.gradle.kts index 230a621..be490ba 100644 --- a/customer-api/build.gradle.kts +++ b/customer-api/build.gradle.kts @@ -17,3 +17,11 @@ dependencies { tasks.withType { useJUnitPlatform() } + +tasks.withType { + enabled = true +} + +tasks.withType { + enabled = false +} \ No newline at end of file diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts index 1a5b04b..cf9b422 100644 --- a/demo/build.gradle.kts +++ b/demo/build.gradle.kts @@ -7,6 +7,7 @@ plugins { dependencies { api(project(":lib")) + api(project(":customer-api")) implementation("org.springframework.boot:spring-boot-starter-web") implementation("com.fasterxml.jackson.module:jackson-module-kotlin") diff --git a/demo/src/main/kotlin/com/example/demo/DemoApplication.kt b/demo/src/main/kotlin/com/example/demo/DemoApplication.kt index de312e3..bc7cd3b 100644 --- a/demo/src/main/kotlin/com/example/demo/DemoApplication.kt +++ b/demo/src/main/kotlin/com/example/demo/DemoApplication.kt @@ -2,12 +2,15 @@ package com.example.demo import com.example.lib.MyLib import com.example.lib.MyUtils +import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.CommandLineRunner import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication -@SpringBootApplication -class DemoApplication : CommandLineRunner { +@SpringBootApplication (scanBasePackages = ["com.example.customerapi"]) +class DemoApplication @Autowired constructor( + //customerRepository: CustomerRepository, +) : CommandLineRunner { override fun run(vararg args: String?) { MyLib.doOnMe() diff --git a/demo/src/main/resources/application.properties b/demo/src/main/resources/application.properties index 8b13789..78195c5 100644 --- a/demo/src/main/resources/application.properties +++ b/demo/src/main/resources/application.properties @@ -1 +1 @@ - +spring.data.mongodb.uri=mongodb://192.168.0.202:27017/db-customer-api \ No newline at end of file