From 3c5d7d2784256fdfcd9dad149ef50d3d68ee9f63 Mon Sep 17 00:00:00 2001 From: XinYi Song <2037158277@qq.com> Date: Thu, 23 Dec 2021 14:46:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=9A=84=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E9=99=90=E5=88=B6=E4=BA=86=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E7=9A=84=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/service/impl/ProductServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/xkrs/service/impl/ProductServiceImpl.java b/src/main/java/com/xkrs/service/impl/ProductServiceImpl.java index 593da35..da92421 100644 --- a/src/main/java/com/xkrs/service/impl/ProductServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/ProductServiceImpl.java @@ -71,6 +71,9 @@ public class ProductServiceImpl implements ProductService { if(productCover == null || productCover.size() == 0 || productContent == null || productContent.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"商品封面或商品内容图片不能未空!",locale); } + if(productCover.size() > 6 || productContent.size() > 6){ + return outputEncapsulationObject(PromptMessageEnum.DATA_WRONG,"上传的图片不能超过六张!",locale); + } ProductEntity productEntity = new ProductEntity(); productEntity.setProductName(productQo.getProductName()); productEntity.setProductDescription(productQo.getProductDescription());