spring boot下使用RedisTemplate操做redis存取對象

在spring boot環境下有個StringRedisTemplate對象,默認已經爲咱們配置好了,只須要自動注入過來就能用,可是使用它只能在Redis中存放字符串。具體操做以下:html @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
相關文章
相關標籤/搜索