|
|
@@ -25,6 +25,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.SneakyThrows;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
import org.zhongzheng.common.mybatisplus.Condition;
|
|
|
import org.zhongzheng.common.mybatisplus.Query;
|
|
|
import org.zhongzheng.common.secure.ZhongZhengUser;
|
|
|
@@ -74,6 +75,9 @@ public class UserController {
|
|
|
@GetMapping("/detail")
|
|
|
public R<UserVO> detail(User user) throws SQLException {
|
|
|
User detail = userService.getOne(Condition.getQueryWrapper(user));
|
|
|
+ if(ObjectUtils.isEmpty(detail)){
|
|
|
+ return R.data(404, null, "not found");
|
|
|
+ }
|
|
|
return R.data(UserWrapper.build().entityVO(detail));
|
|
|
}
|
|
|
|
|
|
@@ -81,10 +85,14 @@ public class UserController {
|
|
|
* 查询单条
|
|
|
*/
|
|
|
@ApiOperationSupport(order =2)
|
|
|
- @ApiOperation(value = "查看详情", notes = "传入id")
|
|
|
+ @ApiOperation(value = "查看详情", notes = "传入userId")
|
|
|
@GetMapping("/info")
|
|
|
public R<UserVO> info(ZhongZhengUser user) {
|
|
|
User detail = userService.getById(user.getUserId());
|
|
|
+ if(ObjectUtils.isEmpty(detail)){
|
|
|
+ return R.data(404, null, "not found");
|
|
|
+ }
|
|
|
+
|
|
|
return R.data(UserWrapper.build().entityVO(detail));
|
|
|
}
|
|
|
|