格式化代码
Sync All Branches to GitHub / sync (push) Successful in 3s

This commit is contained in:
hanfuye
2026-01-12 19:39:33 +08:00
parent 2f001c3e9e
commit 1c1490271d
2 changed files with 13 additions and 7 deletions
@@ -15,7 +15,6 @@ import java.time.LocalDateTime;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/**
*
* @author ayi
@@ -30,7 +29,12 @@ public class TestController {
@GetMapping("/test")
@ApiOperationLog(description = "测试接口")
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")
@@ -42,7 +46,7 @@ public class TestController {
@RequestMapping("/user/doLogin")
public String doLogin(String username, String password) {
// 此处仅作模拟示例,真实项目需要从数据库中查询数据进行比对
if("ayi".equals(username) && "12345678".equals(password)) {
if ("ayi".equals(username) && "12345678".equals(password)) {
StpUtil.login(10001);
return "登录成功";
}
@@ -28,7 +28,8 @@ public class RedisTests {
@Test
void testSetKeyValue() {
// 添加一个 key 为 name, value 值为 刑加一
redisTemplate.opsForValue().set("name", "刑加一");
redisTemplate.opsForValue()
.set("name", "刑加一");
}
/**
@@ -44,7 +45,8 @@ public class RedisTests {
*/
@Test
void testGetValue() {
log.info("value 值:{}", redisTemplate.opsForValue().get("name"));
log.info("value 值:{}", redisTemplate.opsForValue()
.get("name"));
}
/**