Skip to content

Commit d3e90bc

Browse files
authored
fix: Mock data is changed to be obtained from loginUserContext (#204)
* fix: Mock data is changed to be obtained from loginUserContext
1 parent b1370f0 commit d3e90bc

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

base/src/main/java/com/tinyengine/it/controller/CanvasController.java

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
@RequestMapping("/app-center/api")
4242
@Tag(name = "区块")
4343
public class CanvasController {
44+
/**
45+
* The canvas service.
46+
*/
4447
@Autowired
4548
private CanvasService canvasService;
4649

base/src/main/java/com/tinyengine/it/controller/UserController.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
package com.tinyengine.it.controller;
1414

1515
import com.tinyengine.it.common.base.Result;
16+
import com.tinyengine.it.common.context.LoginUserContext;
1617
import com.tinyengine.it.model.entity.User;
1718
import com.tinyengine.it.service.app.UserService;
1819

@@ -42,14 +43,20 @@ public class UserController {
4243
@Autowired
4344
private UserService userService;
4445

46+
/**
47+
* The loginUserContext service.
48+
*/
49+
@Autowired
50+
private LoginUserContext loginUserContext;
51+
4552
/**
4653
* Me result.
4754
*
4855
* @return the result
4956
*/
5057
@GetMapping("/user/me")
5158
public Result<User> me() {
52-
User user = userService.queryUserById(1);
59+
User user = userService.queryUserById(Integer.parseInt(loginUserContext.getLoginUserId()));
5360
return Result.success(user);
5461
}
5562
}

0 commit comments

Comments
 (0)