spring-web-modules/api/src/main/kotlin/com/cubetiqs/web/modules/redis/RedisConfig.kt
Sambo Chea 8c999a9e7c
Some checks failed
continuous-integration/drone/push Build is failing
Add basic module and redis data with jpa and example
2022-04-11 12:35:47 +07:00

20 lines
698 B
Kotlin

package com.cubetiqs.web.modules.redis
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.data.redis.connection.RedisConnectionFactory
import org.springframework.data.redis.core.RedisTemplate
@RedisModule
@Configuration
class RedisConfig @Autowired constructor(
private val connectionFactory: RedisConnectionFactory,
) {
@Bean
fun redisTemplate(): RedisTemplate<String, RedisKVModel> {
val template = RedisTemplate<String, RedisKVModel>()
template.setConnectionFactory(connectionFactory)
return template
}
}