Tag: redis

春季开机缓存不支持kotlin?

我试图用kotlin替换一些java代码。 如jpa或缓存。 Start类是: @EnableAsync @EnableCaching @EnableSwagger2 @SpringBootApplication open class Application fun main(args: Array<String>) { SpringApplication.run(Application::class.java) } 简单的控制器: @RestController class CacheController { @Autowired private lateinit var cache: CacheService @PutMapping("{id}") fun save(@PathVariable id: Long) { cache.save(id) } } CacheService: @Component @CacheConfig(cacheNames = arrayOf("longCacheManager"), cacheManager = "longCacheManager") open class CacheService { @Cacheable(key = "#id") fun save(id: Long): Long […]