class ServerGroupController {

    @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
    public ServiceResult<String> delete(@Validated(DeleteServerGroup.class) @RequestBody ServerGroup serverGroup, @CurrentUser LoginUser user, Errors errors) throws Exception {
        ValidateResult validateRes = serverGroupService.validatePermision(user, errors)
                .addAssert(() -> serverGroupService.deleteCheck(serverGroup.getId()))
                .addAssert(() -> serverGroupService.deleteDataCenter(user, serverGroup))
                .addAssert(() -> serverGroupService.deleteServerGroup(serverGroup)).validate();
        if (!validateRes.isValid()) {
            return ServiceResult.fail(validateRes.getSummarize());
        }
        return ServiceResult.success();
    }

}