[Kotlin Spring boot] Dependency injection

In Java, you can use Autowired to init the service:

@Autowired
TheaterService theaterService

 

In kotlin, it is different, you need to use 'lateinit var'

@Autowired
lateinit var theaterService: TheaterService

 

posted @ 2020-11-05 03:17  Zhentiw  阅读(89)  评论(0)    收藏  举报