Commit b242585c authored by xuxin's avatar xuxin

不允许 非 vps创建者以及父账户 删除vps

parent 05c340c5
......@@ -112,7 +112,6 @@ public class VpsServiceImpl implements VpsService {
Vps vps = vpsRepository.findById(vpsId).orElseThrow(() -> new ClientRequestException(VpsErrorCode.VPS_NOT_EXIST));
if (userId.equals(vps.getOwner1()) || userId.equals(vps.getOwner2())) {
vpsRepository.deleteById(vpsId);
}
// 删除与当前 vps 相关的 分配信息
List<String> userIds = accountRepository.findIdsByParentId(userId);
......@@ -125,6 +124,7 @@ public class VpsServiceImpl implements VpsService {
userId1 -> userVpsRepository.deleteVpsIdOfUserVpsList(userId1, vpsId)
);
}
}
@Override
public void updateVps(Vps vps) {
......
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