@@ -15,7 +15,6 @@ import java.time.LocalDateTime;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author ayi
|
* @author ayi
|
||||||
@@ -30,7 +29,12 @@ public class TestController {
|
|||||||
@GetMapping("/test")
|
@GetMapping("/test")
|
||||||
@ApiOperationLog(description = "测试接口")
|
@ApiOperationLog(description = "测试接口")
|
||||||
public Response<User> testController() {
|
public Response<User> testController() {
|
||||||
return Response.success(User.builder().id(1L).name("ayi").age(18).createTime(LocalDateTime.now()).build());
|
return Response.success(User.builder()
|
||||||
|
.id(1L)
|
||||||
|
.name("ayi")
|
||||||
|
.age(18)
|
||||||
|
.createTime(LocalDateTime.now())
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/test2")
|
@PostMapping("/test2")
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ public class RedisTests {
|
|||||||
@Test
|
@Test
|
||||||
void testSetKeyValue() {
|
void testSetKeyValue() {
|
||||||
// 添加一个 key 为 name, value 值为 刑加一
|
// 添加一个 key 为 name, value 值为 刑加一
|
||||||
redisTemplate.opsForValue().set("name", "刑加一");
|
redisTemplate.opsForValue()
|
||||||
|
.set("name", "刑加一");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,7 +45,8 @@ public class RedisTests {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
void testGetValue() {
|
void testGetValue() {
|
||||||
log.info("value 值:{}", redisTemplate.opsForValue().get("name"));
|
log.info("value 值:{}", redisTemplate.opsForValue()
|
||||||
|
.get("name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user