class AppGroupService {

    public ServiceResult<String> deleteAppGroup(AppGroup appGroup) throws SQLException {
        boolean isSussess = appGroupDao.getDasClient().execute(() -> {
            List<Project> list = projectDao.getProjectByAppGroupId(appGroup.getId());
            if (CollectionUtils.isNotEmpty(list) && projectDao.deleteProjectAppGroupIdById(appGroup.getId()) <= 0) {
                throw new TransactionException(message.db_message_delete_operation_failed);
            }
            int rs = appGroupDao.deleteAppGroup(appGroup);
            if (rs <= 0) {
                throw new TransactionException(message.db_message_delete_operation_failed);
            }
            return true;
        });
        if (isSussess) {
            return ServiceResult.success();
        }
        return ServiceResult.fail(message.db_message_delete_operation_failed);
    }

}