fix: fix delete and update club user logic

This commit is contained in:
Wzp-2008 2025-01-12 21:22:36 +08:00
parent 5c78612726
commit e34ffb4d6f

View File

@ -104,7 +104,7 @@ public class ClubServices {
Long clubAuthId = NullableUtils.ifNonNullDoElse(clubAuth, ClubAuthVo::getId, -1L);
if (clubAuthId <= authId && !isSuperAdmin)
throw new AuthorizationException(Result.failed(HttpStatus.FORBIDDEN, "权限不足!"));
clubUserAuthDao.delete(clubUserAuthVo);
clubUserAuthDao.deleteByCondition(CLUB_USER_AUTH_VO.USER_ID.eq(userId).and(CLUB_USER_AUTH_VO.CLUB_ID.eq(clubId)));
return Result.success(true);
}
@ -128,7 +128,7 @@ public class ClubServices {
if (targetClubAuthId >= operatorClubAuthId && !isSuperAdmin)
throw new AuthorizationException(Result.failed(HttpStatus.FORBIDDEN, "权限不足!"));
clubUserAuthVo.setAuthId(targetClubAuthId);
clubUserAuthDao.update(clubUserAuthVo);
clubUserAuthDao.updateByCondition(clubUserAuthVo, CLUB_USER_AUTH_VO.USER_ID.eq(targetUserId).and(CLUB_USER_AUTH_VO.CLUB_ID.eq(targetClubId)));
return Result.success(true);
}