Last active
September 18, 2017 16:41
-
-
Save pengisgood/dbea1fcdc45c2bb5809871c7f020b800 to your computer and use it in GitHub Desktop.
Return customized http status code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
ext { | |
kotlinVersion = '1.1.4-3' | |
springBootVersion = '2.0.0.M4' | |
} | |
repositories { | |
mavenCentral() | |
maven { url "https://repo.spring.io/snapshot" } | |
maven { url "https://repo.spring.io/milestone" } | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") | |
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}") | |
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}") | |
} | |
} | |
apply plugin: 'kotlin' | |
apply plugin: 'kotlin-spring' | |
apply plugin: 'idea' | |
apply plugin: 'org.springframework.boot' | |
apply plugin: 'io.spring.dependency-management' | |
version = '0.0.1-SNAPSHOT' | |
sourceCompatibility = 1.8 | |
compileKotlin { | |
kotlinOptions.jvmTarget = "1.8" | |
} | |
compileTestKotlin { | |
kotlinOptions.jvmTarget = "1.8" | |
} | |
repositories { | |
mavenCentral() | |
maven { url "https://repo.spring.io/snapshot" } | |
maven { url "https://repo.spring.io/milestone" } | |
} | |
dependencies { | |
compile('org.springframework.boot:spring-boot-starter-web') | |
compile("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}") | |
compile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") | |
testCompile('org.springframework.boot:spring-boot-starter-test') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.pengisgood.demo | |
import org.springframework.boot.SpringApplication | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
@SpringBootApplication | |
class DemoApplication | |
fun main(args: Array<String>) { | |
SpringApplication.run(DemoApplication::class.java, *args) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.pengisgood.demo | |
import org.springframework.http.ResponseEntity | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.web.bind.annotation.RestController | |
@RestController | |
class DemoController { | |
@GetMapping("/hello") | |
fun helloKotlin(): ResponseEntity<Any> { | |
return ResponseEntity.status(105).build() | |
} | |
} |
Author
pengisgood
commented
Sep 18, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment