Commit 079d5d70 authored by fangxinjiang's avatar fangxinjiang

非空判断

parent 5999cf23
...@@ -97,6 +97,9 @@ public class UserController { ...@@ -97,6 +97,9 @@ public class UserController {
@GetMapping("/getInfoByUsername") @GetMapping("/getInfoByUsername")
public UserInfo infoAPI(@RequestParam(required = true,name = "username") String username) { public UserInfo infoAPI(@RequestParam(required = true,name = "username") String username) {
SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUsername, username)); SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUsername, username));
if (null == user){
throw new RuntimeException("未获取到用户:"+ username);
}
return userService.getUserInfo(user); return userService.getUserInfo(user);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment