Skip to content

Commit

Permalink
Merge pull request #15 from saagie/google-assistant-compatibility
Browse files Browse the repository at this point in the history
Add google assistant compatibility for consultation (#14)
  • Loading branch information
guillaumeNaimi authored Dec 16, 2019
2 parents 36a42dd + b137ce4 commit d5cb3c6
Show file tree
Hide file tree
Showing 151 changed files with 361 additions and 47,434 deletions.
17 changes: 6 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
buildScanVersion = '1.13.2'
gradlePythonPluginVersion = '1.0.2'
gradleMkdocsPluginVersion = '1.0.1'
actionsOnGoogleVersion = '1.8.0'
}
repositories {
maven {
Expand Down Expand Up @@ -68,26 +69,20 @@ ext.kluentVersion="1.35"
ext.mockitoVersion="1.5.0"

dependencies {
compile ("com.google.actions:actions-on-google:${actionsOnGoogleVersion}")
compile('org.springframework.boot:spring-boot-starter')
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
compile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
compile("org.springframework.boot:spring-boot-starter-data-mongodb")
compile("org.springframework.boot:spring-boot-starter-mail")
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.security.oauth:spring-security-oauth2")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:${jacksonModuleVersion}")
compile("me.ramswaroop.jbot:jbot:${jbotVersion}")
compile("io.springfox:springfox-swagger2:${swaggerVersion}")
compile("io.springfox:springfox-swagger-ui:${swaggerVersion}")
//Just for the login/logout demo START
compile("org.webjars:angularjs:1.4.3")
compile("org.webjars:jquery:2.1.1")
compile("org.webjars:bootstrap:3.2.0")
compile("org.webjars:webjars-locator")
compile 'com.google.api-client:google-api-client:1.25.0'

testCompile("org.springframework.boot:spring-boot-starter-test")


testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.springframework.security:spring-security-test")
testCompile("org.amshove.kluent:kluent:${kluentVersion}")
testCompile("com.nhaarman:mockito-kotlin-kt1.1:${mockitoVersion}")
Expand Down
18 changes: 0 additions & 18 deletions src/main/kotlin/io/saagie/astonparking/AstonParkingApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import org.springframework.context.annotation.Configuration
import org.springframework.scheduling.annotation.EnableAsync
import org.springframework.scheduling.annotation.EnableScheduling
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
import springfox.documentation.builders.PathSelectors
import springfox.documentation.builders.RequestHandlerSelectors
import springfox.documentation.spi.DocumentationType
import springfox.documentation.spring.web.plugins.Docket
import springfox.documentation.swagger2.annotations.EnableSwagger2
import java.util.concurrent.Executor


Expand All @@ -33,19 +28,6 @@ class AstonParkingApplication {

}

@Configuration
@EnableSwagger2
class SwaggerConfig {
@Bean
fun api(): Docket {
return Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}

fun main(args: Array<String>) {
SpringApplication.run(AstonParkingApplication::class.java, *args)
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/kotlin/io/saagie/astonparking/dao/UserDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ import org.springframework.stereotype.Repository
interface UserDao : CrudRepository<User, String> {
fun findByEnable(active: Boolean): List<User>
fun findByUnregister(unregister: Boolean): List<User>
fun findTopByEmail(mail: String): User?
fun existsByEmailAndIdNot(mail: String, id: String): Boolean
}
8 changes: 1 addition & 7 deletions src/main/kotlin/io/saagie/astonparking/domain/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ data class User(
@JsonIgnore @Id val id: String?,
val username: String,
var email: String? = null,
var image_24: String? = null,
var image_32: String? = null,
var image_48: String? = null,
var image_72: String? = null,
var image_192: String? = null,
var image_512: String? = null,
var creationDate: Date = Date.from(Instant.now()),
var attribution: Int = 0,
var enable: Boolean = false,
var enable: Boolean = true,
var activated: Boolean = false,
var alreadySelected: Boolean = false,
var hasFixedSpot: Boolean = false,
Expand Down
11 changes: 11 additions & 0 deletions src/main/kotlin/io/saagie/astonparking/exceptions/PickException.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.saagie.astonparking.exceptions

import java.lang.IllegalArgumentException
import java.time.LocalDate

sealed class PickException(message: String): IllegalArgumentException(message) {
data class NoScheduleError(private val date: LocalDate) : PickException("No schedule for the date $date")
data class NoFreeSpotsError(private val date: LocalDate) : PickException("No free spot for the date $date")
object AlreadyPickError : PickException("A spot is already reserved for you")

}
Loading

0 comments on commit d5cb3c6

Please sign in to comment.