修改了添加商品的功能模块,限制了图片上传的数量

This commit is contained in:
XinYi Song 2021-12-23 14:46:00 +08:00
parent 9fd7a64d8e
commit 3c5d7d2784

View File

@ -71,6 +71,9 @@ public class ProductServiceImpl implements ProductService {
if(productCover == null || productCover.size() == 0 || productContent == null || productContent.size() == 0){ if(productCover == null || productCover.size() == 0 || productContent == null || productContent.size() == 0){
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"商品封面或商品内容图片不能未空!",locale); return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"商品封面或商品内容图片不能未空!",locale);
} }
if(productCover.size() > 6 || productContent.size() > 6){
return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG,"上传的图片不能超过六张!",locale);
}
ProductEntity productEntity = new ProductEntity(); ProductEntity productEntity = new ProductEntity();
productEntity.setProductName(productQo.getProductName()); productEntity.setProductName(productQo.getProductName());
productEntity.setProductDescription(productQo.getProductDescription()); productEntity.setProductDescription(productQo.getProductDescription());