From 823ef3d1c48f7d52316784b45a07a4f22932cd14 Mon Sep 17 00:00:00 2001 From: ronger Date: Wed, 20 Mar 2024 21:43:10 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/rymcu/forest/service/impl/ProductServiceImpl.java | 3 +++ src/main/java/mapper/ProductMapper.xml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rymcu/forest/service/impl/ProductServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/ProductServiceImpl.java index 8c7152e..3b5f277 100644 --- a/src/main/java/com/rymcu/forest/service/impl/ProductServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/ProductServiceImpl.java @@ -53,6 +53,7 @@ public class ProductServiceImpl extends AbstractService implements Prod if (FileDataType.BASE64.equals(product.getProductImgType())) { String headImgUrl = UploadController.uploadBase64File(product.getProductImgUrl(), FilePath.PRODUCT); product.setProductImgUrl(headImgUrl); + product.setProductImgType(FileDataType.URL); } Product newProduct; if (isUpdate) { @@ -60,7 +61,9 @@ public class ProductServiceImpl extends AbstractService implements Prod newProduct.setProductImgUrl(product.getProductImgUrl()); newProduct.setProductTitle(product.getProductTitle()); newProduct.setProductPrice(product.getProductPrice()); + newProduct.setTags(product.getTags()); newProduct.setProductDescription(product.getProductDescription()); + newProduct.setUpdatedTime(new Date()); productMapper.updateByPrimaryKeySelective(newProduct); // 更新产品详情 productMapper.updateProductContent(newProduct.getIdProduct(), product.getProductContent(), product.getProductContentHtml()); diff --git a/src/main/java/mapper/ProductMapper.xml b/src/main/java/mapper/ProductMapper.xml index ddf51f6..ca94d19 100644 --- a/src/main/java/mapper/ProductMapper.xml +++ b/src/main/java/mapper/ProductMapper.xml @@ -37,7 +37,7 @@ where id_product = #{idProduct} @@ -57,7 +57,7 @@