用户信息接口新增是否有上级

This commit is contained in:
2024-11-19 22:35:04 +08:00
parent 460d239b9f
commit a0962340b1
2 changed files with 10 additions and 1 deletions

View File

@@ -88,6 +88,8 @@ public class MainController extends BaseController {
private UserRoleService userRoleService; private UserRoleService userRoleService;
@Resource @Resource
private CompanyService companyService; private CompanyService companyService;
@Resource
private UserRefereeService userRefereeService;
@ApiOperation("用户登录") @ApiOperation("用户登录")
@@ -225,7 +227,10 @@ public class MainController extends BaseController {
public ApiResult<User> userInfo() { public ApiResult<User> userInfo() {
final Integer loginUserId = getLoginUserId(); final Integer loginUserId = getLoginUserId();
if (loginUserId != null) { if (loginUserId != null) {
return success(userService.getByIdRel(getLoginUserId())); User user = userService.getByIdRel(getLoginUserId());
UserReferee userReferee = userRefereeService.getByUserId(loginUserId);
user.setHasParent(userReferee != null);
return success(user);
} }
return fail("loginUserId不存在", null); return fail("loginUserId不存在", null);
} }

View File

@@ -319,6 +319,10 @@ public class User implements UserDetails {
@TableField(exist = false) @TableField(exist = false)
private String authCode; private String authCode;
@ApiModelProperty("是否有上级")
@TableField(exist = false)
private Boolean hasParent;
// @ApiModelProperty("企业信息") // @ApiModelProperty("企业信息")
// @TableField(exist = false) // @TableField(exist = false)
// private Company companyInfo; // private Company companyInfo;