diff --git a/src/main/kotlin/io/realworld/ApiApplication.kt b/src/main/kotlin/io/realworld/ApiApplication.kt index 4a1022a720fce4a76e1b948c30f73c059522673e..35b591f6843ba7996869b9b4ee27b813dfe6ab53 100644 --- a/src/main/kotlin/io/realworld/ApiApplication.kt +++ b/src/main/kotlin/io/realworld/ApiApplication.kt @@ -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>) {