class ServerService {

    public ServiceResult<String> deleteServer(Server server) {
        try {
            if (server.getId() == null) {
                return ServiceResult.fail("server id 为空");
            }
            boolean isSussess = serverDao.getDasClient().execute(() -> {
                int id = serverDao.deleteServerAndServerConfigByServerId(server.getId());
                if (id <= 0) {
                    throw new TransactionException(message.db_message_add_operation_failed);
                }
                return true;
            });
            if (isSussess) {
                return ServiceResult.success();
            }
        } catch (Exception e) {
            return ServiceResult.fail("deleteServer 删除异常 " + message.db_message_add_operation_failed);
        }
        return ServiceResult.fail("deleteServer 删除异常 " + message.db_message_add_operation_failed);
    }

}