Skip to content
Snippets Groups Projects
Commit 64c9faa8 authored by Alexandre Grison's avatar Alexandre Grison
Browse files

no command line runner

parent b0a7e22b
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@SpringBootApplication
class ApiApplication(val tagRepository: TagRepository,
val userRepository: UserRepository,
val articleRepository: ArticleRepository) : WebMvcConfigurerAdapter(), CommandLineRunner {
val articleRepository: ArticleRepository) : WebMvcConfigurerAdapter() {
override fun addInterceptors(registry: InterceptorRegistry?) {
registry!!.addInterceptor(exposeResponseInterceptor())
......@@ -55,37 +55,6 @@ class ApiApplication(val tagRepository: TagRepository,
@Bean
fun validator() = LocalValidatorFactoryBean()
override fun run(vararg p0: String?) {
/* val java = tagRepository.save(Tag(name = "java"))
val kotlin = tagRepository.save(Tag(name = "kotlin"))
val dev = tagRepository.save(Tag(name = "dev"))
val clojure = tagRepository.save(Tag(name = "clojure"))
var alex = userRepository.save(User(email = "a.grison@gmail.com",
password = BCrypt.hashpw("foofoo", BCrypt.gensalt()),
token = "eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0OTM4MzE2NzEsInN1YiI6ImEuZ3Jpc29uQGdtYWlsLmNvbSIsImlzcyI6IktvdGxpbiZTcHJpbmciLCJleHAiOjE0OTQ2OTU2NzF9.nxRpiUsRgNGgJPhMws0GiidqihaQcTBv1MxPP7LNAKw",
username = "Alex", bio = "This is Alex",
image = "http://i0.kym-cdn.com/entries/icons/original/000/014/959/Screenshot_116.png"))
val rich = userRepository.save(User(email = "rich@gmail.com",
password = BCrypt.hashpw("barbar", BCrypt.gensalt()),
token = "lmao",
image = "https://pbs.twimg.com/media/Cbg6oKqUkAI2PAB.jpg",
username = "Rich", bio = "This is Rich", follows = mutableListOf(alex)))
alex.follows.add(rich)
alex = userRepository.save(alex)
articleRepository.save(Article(title = "Kotlin is fun", body = "Kotlin is somewhat fun", slug = "kotlin-is-fun",
author = alex, tagList = mutableListOf(dev, kotlin)))
articleRepository.save(Article(title = "Java is still cool", body = "Java is still cool", slug = "java-is-still-cool",
author = alex, tagList = mutableListOf(dev, java)))
articleRepository.save(Article(title = "Clojure is the future", body = "Clojure up!", slug = "clojure-is-the-future",
author = alex, tagList = mutableListOf(dev, clojure),
favorited = mutableListOf(rich)))
articleRepository.save(Article(title = "Clojure spec", body = "Clojure spec!", slug = "clojure-spec",
author = rich, tagList = mutableListOf(dev, clojure),
favorited = mutableListOf(alex)))*/
}
}
fun main(args: Array<String>) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment