We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
源代码中的create方法,入参为id,根本无法添加新的商品
// 修改后的方法(仅供参考) @Override public CommonResult<EsProduct> create(EsProduct esProduct) { if (esProduct != null) { long id = esProduct.getId(); Iterable<EsProduct> all = productRepository.findAll(); Iterator<EsProduct> iterator = all.iterator(); while (iterator.hasNext()) { Long id1 = iterator.next().getId(); if (Objects.equal(id, id1)) { LOGGER.warn("此id: {}已经被创建", id); return CommonResult.failed(); } } productRepository.save(esProduct); LOGGER.info("创建商品成功,id:{}", id); return CommonResult.success(esProduct); } return CommonResult.failed(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
源代码中的create方法,入参为id,根本无法添加新的商品
The text was updated successfully, but these errors were encountered: