class GroupDatabaseController {

    @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
    public ServiceResult<String> delete(@Validated(DeleteGroupDB.class) @RequestBody DataBaseInfo dataBaseInfo, @CurrentUser LoginUser user, Errors errors) throws Exception {
        ValidateResult validateRes = groupDatabaseService.validatePermision(user, errors)
                .addAssert(() -> groupDatabaseService.isGroupHadDB(dataBaseInfo.getId(), dataBaseInfo.getDal_group_id()), message.message_operation_pemission)
                .addAssert(() -> dataBaseDao.updateDataBaseInfo(dataBaseInfo.getId(), -1L) > 0, message.db_message_delete_operation_failed).validate();
        if (!validateRes.isValid()) {
            return ServiceResult.fail(validateRes.getSummarize());
        }
        return ServiceResult.success();
    }

}