开源软件名称(OpenSource Name):wonwoo/spring-boot-kotlin-example开源软件地址(OpenSource Url):https://github.com/wonwoo/spring-boot-kotlin-example开源编程语言(OpenSource Language):Kotlin 73.4%开源软件介绍(OpenSource Introduction):spring boot kotlinThis is spring boot kotlin example. Live Demohttps://spring-boot-kotlin-example.herokuapp.com Login
How to run?clone
run# cd web or webflux
# mvn spring-boot:run
or
use
spring boot koilin sample codeMain 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
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论