通讯录查询修改

master
Xusan 2024-05-16 15:55:48 +08:00
parent 1cf8c05ea8
commit f0c55aa46e
1 changed files with 11 additions and 0 deletions

View File

@ -266,7 +266,18 @@ public class AddressBookController {
@ApiOperation(value = "查询详情") @ApiOperation(value = "查询详情")
@GetMapping(value = "get/{id}") @GetMapping(value = "get/{id}")
public ResultJson get(@PathVariable("id") Integer id) { public ResultJson get(@PathVariable("id") Integer id) {
return ResultJson.ok(service.getById(id)); return ResultJson.ok(service.getById(id));
} }
@ApiOperation(value = "查询用户详情")
@GetMapping(value = "getByUser/{userId}")
public ResultJson getByUser(@PathVariable("userId") Integer userId) {
User byId = userService.getById(userId);
if (Objects.isNull(byId)){
return ResultJson.error("该用户不存在");
}
return ResultJson.ok(service.getById(byId.getAbId()));
}
} }