用springboot整合redis的文件
-
1-目录的路径:
-
2-SpringRedisapplicationTests文件信息
@RunWith(SpringRunner.class)
@SpringBootTest
class SpringbootRedisApplicationTests {
@Autowired
private RedisTemplate redisTemplate;
@Test
public void testSet(){
//存入数据
redisTemplate.boundValueOps("name").set("zahngsan");
}
@Test
public void testGet(){
//获取数据
Object name = redisTemplate.boundValueOps("name").get();
System.out.println(name);
}
}
标签:name,spring,redis,SpringBoot06,Test,redisTemplate
From: https://www.cnblogs.com/chen-zhou1027/p/16871502.html