spring-boot-kotlin-example
                                
                                 spring-boot-kotlin-example copied to clipboard
                                
                                    spring-boot-kotlin-example copied to clipboard
                            
                            
                            
                        spring boot kotlin example
spring boot kotlin
This is spring boot kotlin example.
Live Demo
https://spring-boot-kotlin-example.herokuapp.com
 

Login
ID : wonwoo
Password : 123
ID : user
Password : 456
How to run?
clone
# git clone https://github.com/wonwoo/spring-boot-kotlin-example.git
run
# cd web or webflux
# mvn spring-boot:run
or
# cd web or webflux
# mvn install
# java -jar target/${name}.jar
use
- kotlin 1.3.50
- Spring Boot 2.2.x
- JPA(hibernate) 5.4.8
- h2
- thymeleaf 3.0.11
- Spring Security 5.2.1
spring boot koilin sample code
Main sample
@SpringBootApplication
class SpringBootKotlinExampleApplication(private val accountRepository: AccountRepository,
                                         private val messageRepository: MessageRepository) : CommandLineRunner {
  override fun run(vararg p0: String?) {
    //.. some logic  
  }
}
fun main(args: Array<String>) {
    runApplication<SpringBootKotlinExampleApplication>(*args)
}
Service sample
@Service
@Transactional
class MessageService constructor(val messageRepository: MessageRepository){
  @Transactional(readOnly = true)
  fun findAll() : List<Message> {
    return messageRepository.findAll()
  }
  // ... some logic 
}