From 193aef2e2c277e52b3e86f96791e4aabb43d7995 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Sat, 15 Mar 2025 15:37:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E5=86=99=E7=9C=9F?= =?UTF-8?q?=E9=A2=84=E7=BA=A6=E4=BA=A7=E5=93=81=E7=9A=84=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/dto/good/GoodAddRequest.java | 13 ++++-------- .../model/dto/good/GoodQueryRequest.java | 4 ++++ .../model/dto/good/GoodUpdateRequest.java | 16 ++++++-------- .../good/service/ServiceGoodAddRequest.java | 15 +++++-------- .../ServiceGoodSingleUpdateRequest.java | 15 ++++--------- .../service/ServiceGoodUpdateRequest.java | 15 ++++--------- .../PhotoProductsAddRequest.java | 14 +++---------- .../PhotoProductsUpdateRequest.java | 14 +++---------- .../cultural/heritage/model/entity/Good.java | 15 +++++-------- .../heritage/model/entity/PhotoProducts.java | 13 ++---------- .../heritage/model/vo/good/GoodPageVO.java | 9 ++------ .../heritage/model/vo/good/ServiceGoodVO.java | 9 ++------ .../vo/photoProducts/PhotoProductsVO.java | 10 ++------- .../book/impl/PhotoProductsServiceImpl.java | 9 ++------ .../service/good/impl/GoodServiceImpl.java | 5 ++--- src/main/resources/application.yml | 21 +++++++++++++------ 16 files changed, 65 insertions(+), 132 deletions(-) diff --git a/src/main/java/com/cultural/heritage/model/dto/good/GoodAddRequest.java b/src/main/java/com/cultural/heritage/model/dto/good/GoodAddRequest.java index cb08535..acf846d 100644 --- a/src/main/java/com/cultural/heritage/model/dto/good/GoodAddRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/good/GoodAddRequest.java @@ -10,7 +10,7 @@ import java.math.BigDecimal; @Data @Schema(description = "商品添加请求体", requiredProperties = {"name", "type", "price", "goodImg", "intro", - "introDetail", "detailImg", "label", "inventory", "festivalName"}) + "richText", "label", "inventory", "festivalName"}) public class GoodAddRequest implements Serializable { @@ -44,17 +44,12 @@ public class GoodAddRequest implements Serializable { @Schema(description = "商品简介", example = "传承千年文化,守护健康美好") private String intro; - /** - * 商品详情简介 - */ - @Schema(description = "商品详情简介", example = "精选药材:选用艾草、菖蒲、苍术、白芷等十多种纯天然中草药,科学配比,香气宜人,具有驱蚊、防疫、安神等多种功效。端午香囊,传承千年文化,守护健康美好。在这个端午节,让我们共同感受传统文化的魅力,为生活增添一抹色彩!") - private String introDetail; /** - * 商品详情图片 + * 商品详情(富文本) */ - @Schema(description = "商品详情图片", example = "https://xxx/xxx.jpg") - private String detailImg; + @Schema(description = "商品详情(富文本)", example = "
") + private String richText; /** * 商品标签 diff --git a/src/main/java/com/cultural/heritage/model/dto/good/GoodQueryRequest.java b/src/main/java/com/cultural/heritage/model/dto/good/GoodQueryRequest.java index 9a8223f..3532c8c 100644 --- a/src/main/java/com/cultural/heritage/model/dto/good/GoodQueryRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/good/GoodQueryRequest.java @@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.cultural.heritage.common.PageRequest; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import lombok.EqualsAndHashCode; +import java.io.Serial; import java.io.Serializable; +@EqualsAndHashCode(callSuper = true) @Data @Schema(description = "商品查询请求体", requiredProperties = {"current", "pageSize"}) public class GoodQueryRequest extends PageRequest implements Serializable { @@ -41,6 +44,7 @@ public class GoodQueryRequest extends PageRequest implements Serializable { @Schema(description = "是否上架(1:上架;0:下架)", example = "1") private Integer isShelves; + @Serial @TableField(exist = false) private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/cultural/heritage/model/dto/good/GoodUpdateRequest.java b/src/main/java/com/cultural/heritage/model/dto/good/GoodUpdateRequest.java index c56dc58..fb7f4f8 100644 --- a/src/main/java/com/cultural/heritage/model/dto/good/GoodUpdateRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/good/GoodUpdateRequest.java @@ -4,12 +4,13 @@ import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; @Data @Schema(description = "商品更新请求体", requiredProperties = {"id", "name", "type", "price", "goodImg", "intro", - "introDetail", "detailImg", "label", "inventory", "festivalName", "isShelves"}) + "richText", "label", "inventory", "festivalName", "isShelves"}) public class GoodUpdateRequest implements Serializable { /** @@ -49,16 +50,10 @@ public class GoodUpdateRequest implements Serializable { private String intro; /** - * 商品详情简介 + * 商品详情(富文本) */ - @Schema(description = "商品详情简介", example = "精选药材:选用艾草、菖蒲、苍术、白芷等十多种纯天然中草药,科学配比,香气宜人,具有驱蚊、防疫、安神等多种功效。端午香囊,传承千年文化,守护健康美好。在这个端午节,让我们共同感受传统文化的魅力,为生活增添一抹色彩!") - private String introDetail; - - /** - * 商品详情图片 - */ - @Schema(description = "商品详情图片", example = "https://xxx/xxx.jpg") - private String detailImg; + @Schema(description = "商品详情(富文本)", example = "") + private String richText; /** * 商品标签 @@ -86,6 +81,7 @@ public class GoodUpdateRequest implements Serializable { private Integer isShelves; + @Serial @TableField(exist = false) private static final long serialVersionUID = 1L; } diff --git a/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodAddRequest.java b/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodAddRequest.java index e5bd231..5a9c985 100644 --- a/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodAddRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodAddRequest.java @@ -10,8 +10,7 @@ import java.math.BigDecimal; import java.util.List; @Data -@Schema(description = "服务类商品添加请求体", requiredProperties = {"name", "price", "goodImg", "intro", "introDetail", -"detailImg", "label", "appointmentDateAddRequestList"}) +@Schema(description = "服务类商品添加请求体", requiredProperties = {"name", "price", "goodImg", "intro", "richText", "label", "appointmentDateAddRequestList"}) public class ServiceGoodAddRequest implements Serializable { /** @@ -38,17 +37,13 @@ public class ServiceGoodAddRequest implements Serializable { @Schema(description = "商品简介", example = "传承千年文化,守护健康美好") private String intro; - /** - * 商品详情简介 - */ - @Schema(description = "商品详情简介", example = "精选药材:选用艾草、菖蒲、苍术、白芷等十多种纯天然中草药,科学配比,香气宜人,具有驱蚊、防疫、安神等多种功效。端午香囊,传承千年文化,守护健康美好。在这个端午节,让我们共同感受传统文化的魅力,为生活增添一抹色彩!") - private String introDetail; /** - * 商品详情图片 + * 商品详情(富文本) */ - @Schema(description = "商品详情图片", example = "https://xxx/xxx.jpg") - private String detailImg; + @Schema(description = "商品详情(富文本)", example = "") + private String richText; + /** * 商品标签 diff --git a/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodSingleUpdateRequest.java b/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodSingleUpdateRequest.java index 391e28e..7c37320 100644 --- a/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodSingleUpdateRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodSingleUpdateRequest.java @@ -8,8 +8,7 @@ import java.io.Serializable; import java.math.BigDecimal; @Data -@Schema(description = "服务类商品更新请求体", requiredProperties = {"id", "name", "price", "goodImg", "intro", "introDetail", - "detailImg", "label"}) +@Schema(description = "服务类商品更新请求体", requiredProperties = {"id", "name", "price", "goodImg", "intro", "richText", "label"}) public class ServiceGoodSingleUpdateRequest implements Serializable { /** @@ -43,16 +42,10 @@ public class ServiceGoodSingleUpdateRequest implements Serializable { private String intro; /** - * 商品详情简介 + * 商品详情(富文本) */ - @Schema(description = "商品详情简介", example = "精选药材:选用艾草、菖蒲、苍术、白芷等十多种纯天然中草药,科学配比,香气宜人,具有驱蚊、防疫、安神等多种功效。端午香囊,传承千年文化,守护健康美好。在这个端午节,让我们共同感受传统文化的魅力,为生活增添一抹色彩!") - private String introDetail; - - /** - * 商品详情图片 - */ - @Schema(description = "商品详情图片", example = "https://xxx/xxx.jpg") - private String detailImg; + @Schema(description = "商品详情(富文本)", example = "") + private String richText; /** * 商品标签 diff --git a/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodUpdateRequest.java b/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodUpdateRequest.java index 5515712..d3e8bb4 100644 --- a/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodUpdateRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/good/service/ServiceGoodUpdateRequest.java @@ -10,8 +10,7 @@ import java.math.BigDecimal; import java.util.List; @Data -@Schema(description = "服务类商品更新请求体", requiredProperties = {"id", "name", "price", "goodImg", "intro", "introDetail", - "detailImg", "label", "appointmentDateUpdateRequestList"}) +@Schema(description = "服务类商品更新请求体", requiredProperties = {"id", "name", "price", "goodImg", "intro", "label", "richText", "appointmentDateUpdateRequestList"}) public class ServiceGoodUpdateRequest implements Serializable { /** @@ -45,16 +44,10 @@ public class ServiceGoodUpdateRequest implements Serializable { private String intro; /** - * 商品详情简介 + * 商品详情(富文本) */ - @Schema(description = "商品详情简介", example = "精选药材:选用艾草、菖蒲、苍术、白芷等十多种纯天然中草药,科学配比,香气宜人,具有驱蚊、防疫、安神等多种功效。端午香囊,传承千年文化,守护健康美好。在这个端午节,让我们共同感受传统文化的魅力,为生活增添一抹色彩!") - private String introDetail; - - /** - * 商品详情图片 - */ - @Schema(description = "商品详情图片", example = "https://xxx/xxx.jpg") - private String detailImg; + @Schema(description = "商品详情(富文本)", example = "") + private String richText; /** * 商品标签 diff --git a/src/main/java/com/cultural/heritage/model/dto/photoProducts/PhotoProductsAddRequest.java b/src/main/java/com/cultural/heritage/model/dto/photoProducts/PhotoProductsAddRequest.java index 75cacc0..b9fd272 100644 --- a/src/main/java/com/cultural/heritage/model/dto/photoProducts/PhotoProductsAddRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/photoProducts/PhotoProductsAddRequest.java @@ -12,7 +12,7 @@ import java.util.List; @Data @Schema(description = "写真产品添加请求体", requiredProperties = - {"name", "introImg", "effectImg", "detailImg", "minNumber", "maxNumber", "shotScene", "price", "categoryId"}) + {"name", "introImg", "richText", "minNumber", "maxNumber", "shotScene", "price", "categoryId"}) public class PhotoProductsAddRequest implements Serializable { @@ -32,17 +32,9 @@ public class PhotoProductsAddRequest implements Serializable { /** - * 效果图片 + * 产品详情(富文本) */ - @Schema(description = "效果图片", example = "https://www.xxx.jpg;https://www.xxx.png") - private String [] effectImg; - - - /** - * 详情图片 - */ - @Schema(description = "详情图片", example = "https://www.xxx.jpg;https://www.xxx.png") - private String detailImg; + private String richText; /** diff --git a/src/main/java/com/cultural/heritage/model/dto/photoProducts/PhotoProductsUpdateRequest.java b/src/main/java/com/cultural/heritage/model/dto/photoProducts/PhotoProductsUpdateRequest.java index 37afd63..e0bb719 100644 --- a/src/main/java/com/cultural/heritage/model/dto/photoProducts/PhotoProductsUpdateRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/photoProducts/PhotoProductsUpdateRequest.java @@ -9,7 +9,7 @@ import java.math.BigDecimal; @Data @Schema(description = "写真产品更新请求体", requiredProperties = - {"id", "name", "introImg", "effectImg", "detailImg", "minNumber", "maxNumber", "shotScene", "price", "categoryId"}) + {"id", "name", "introImg", "richText", "minNumber", "maxNumber", "shotScene", "price", "categoryId"}) public class PhotoProductsUpdateRequest implements Serializable { @@ -35,17 +35,9 @@ public class PhotoProductsUpdateRequest implements Serializable { /** - * 效果图片 + * 产品详情(富文本) */ - @Schema(description = "效果图片", example = "https://www.xxx.jpg;https://www.xxx.png") - private String [] effectImg; - - - /** - * 详情图片 - */ - @Schema(description = "详情图片", example = "https://www.xxx.jpg;https://www.xxx.png") - private String detailImg; + private String richText; /** diff --git a/src/main/java/com/cultural/heritage/model/entity/Good.java b/src/main/java/com/cultural/heritage/model/entity/Good.java index dc88f71..109df00 100644 --- a/src/main/java/com/cultural/heritage/model/entity/Good.java +++ b/src/main/java/com/cultural/heritage/model/entity/Good.java @@ -51,16 +51,6 @@ public class Good implements Serializable { */ private String intro; - /** - * 商品详情简介 - */ - private String introDetail; - - /** - * 商品详情图片 - */ - private String detailImg; - /** * 商品标签 */ @@ -71,6 +61,11 @@ public class Good implements Serializable { */ private Integer inventory; + /** + * 商品详情(富文本) + */ + private String richText; + /** * 是否是商品类型 */ diff --git a/src/main/java/com/cultural/heritage/model/entity/PhotoProducts.java b/src/main/java/com/cultural/heritage/model/entity/PhotoProducts.java index 2c1c5fe..7c88195 100644 --- a/src/main/java/com/cultural/heritage/model/entity/PhotoProducts.java +++ b/src/main/java/com/cultural/heritage/model/entity/PhotoProducts.java @@ -1,10 +1,8 @@ package com.cultural.heritage.model.entity; import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.cultural.heritage.handler.StringArrayTypeHandler; import lombok.Data; import java.io.Serial; @@ -42,16 +40,9 @@ public class PhotoProducts implements Serializable { /** - * 效果图 + * 产品详情(富文本) */ - @TableField(typeHandler = StringArrayTypeHandler.class) - private String [] effectImg; - - - /** - * 详情图片 - */ - private String detailImg; + private String richText; /** diff --git a/src/main/java/com/cultural/heritage/model/vo/good/GoodPageVO.java b/src/main/java/com/cultural/heritage/model/vo/good/GoodPageVO.java index e20df7a..f59f26f 100644 --- a/src/main/java/com/cultural/heritage/model/vo/good/GoodPageVO.java +++ b/src/main/java/com/cultural/heritage/model/vo/good/GoodPageVO.java @@ -40,14 +40,9 @@ public class GoodPageVO implements Serializable { private String intro; /** - * 商品详情简介 + * 商品详情(富文本) */ - private String introDetail; - - /** - * 商品详情图片 - */ - private String detailImg; + private String richText; /** * 商品标签 diff --git a/src/main/java/com/cultural/heritage/model/vo/good/ServiceGoodVO.java b/src/main/java/com/cultural/heritage/model/vo/good/ServiceGoodVO.java index 4f8664f..909d785 100644 --- a/src/main/java/com/cultural/heritage/model/vo/good/ServiceGoodVO.java +++ b/src/main/java/com/cultural/heritage/model/vo/good/ServiceGoodVO.java @@ -38,14 +38,9 @@ public class ServiceGoodVO implements Serializable { private String intro; /** - * 商品详情简介 + * 商品详情(富文本) */ - private String introDetail; - - /** - * 商品详情图片 - */ - private String detailImg; + private String richText; /** * 商品标签 diff --git a/src/main/java/com/cultural/heritage/model/vo/photoProducts/PhotoProductsVO.java b/src/main/java/com/cultural/heritage/model/vo/photoProducts/PhotoProductsVO.java index 0d85925..d416adf 100644 --- a/src/main/java/com/cultural/heritage/model/vo/photoProducts/PhotoProductsVO.java +++ b/src/main/java/com/cultural/heritage/model/vo/photoProducts/PhotoProductsVO.java @@ -31,15 +31,9 @@ public class PhotoProductsVO implements Serializable { /** - * 效果图 + * 产品详情(富文本) */ - private String [] effectImg; - - - /** - * 详情图片 - */ - private String detailImg; + private String richText; /** diff --git a/src/main/java/com/cultural/heritage/service/book/impl/PhotoProductsServiceImpl.java b/src/main/java/com/cultural/heritage/service/book/impl/PhotoProductsServiceImpl.java index ea39705..76beb20 100644 --- a/src/main/java/com/cultural/heritage/service/book/impl/PhotoProductsServiceImpl.java +++ b/src/main/java/com/cultural/heritage/service/book/impl/PhotoProductsServiceImpl.java @@ -10,7 +10,6 @@ import com.cultural.heritage.model.dto.photoProducts.PhotoProductsQueryRequest; import com.cultural.heritage.model.entity.PhotoProducts; import com.cultural.heritage.service.book.PhotoProductsService; import com.cultural.heritage.utils.SqlUtils; -import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -29,8 +28,7 @@ public class PhotoProductsServiceImpl extends ServiceImpl