更新了写真预约产品的删除校验

This commit is contained in:
chen-xin-zhi 2025-03-15 15:37:58 +08:00
parent 5d7ef14a4b
commit 193aef2e2c
16 changed files with 65 additions and 132 deletions

View File

@ -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 = "<p></p>")
private String richText;
/**
* 商品标签

View File

@ -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;

View File

@ -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 = "<p></p>")
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;
}

View File

@ -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 = "<p></p>")
private String richText;
/**
* 商品标签

View File

@ -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 = "<p></p>")
private String richText;
/**
* 商品标签

View File

@ -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 = "<p></p>")
private String richText;
/**
* 商品标签

View File

@ -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;
/**

View File

@ -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;
/**

View File

@ -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;
/**
* 是否是商品类型
*/

View File

@ -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;
/**

View File

@ -40,14 +40,9 @@ public class GoodPageVO implements Serializable {
private String intro;
/**
* 商品详情简介
* 商品详情富文本
*/
private String introDetail;
/**
* 商品详情图片
*/
private String detailImg;
private String richText;
/**
* 商品标签

View File

@ -38,14 +38,9 @@ public class ServiceGoodVO implements Serializable {
private String intro;
/**
* 商品详情简介
* 商品详情富文本
*/
private String introDetail;
/**
* 商品详情图片
*/
private String detailImg;
private String richText;
/**
* 商品标签

View File

@ -31,15 +31,9 @@ public class PhotoProductsVO implements Serializable {
/**
* 效果图
* 产品详情富文本
*/
private String [] effectImg;
/**
* 详情图片
*/
private String detailImg;
private String richText;
/**

View File

@ -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<PhotoProductsMapper, P
Long id = photoProducts.getId();
String name = photoProducts.getName();
String introImg = photoProducts.getIntroImg();
String [] effectImg = photoProducts.getEffectImg();
String detailImg = photoProducts.getDetailImg();
String richText = photoProducts.getRichText();
Integer minNumber = photoProducts.getMinNumber();
Integer maxNumber = photoProducts.getMaxNumber();
String shotScene = photoProducts.getShotScene();
@ -42,12 +40,9 @@ public class PhotoProductsServiceImpl extends ServiceImpl<PhotoProductsMapper, P
throw new BusinessException(ErrorCode.PARAMS_ERROR, "id参错误");
}
}
if (StringUtils.isAnyBlank(name, introImg, detailImg, shotScene, categoryName)) {
if (StringUtils.isAnyBlank(name, introImg, richText, shotScene, categoryName)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "参数不全");
}
if (ArrayUtils.isEmpty(effectImg)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "效果图片参数为空");
}
if (ObjectUtils.anyNull(minNumber, maxNumber)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "预约人数参数错误");
}

View File

@ -96,8 +96,7 @@ public class GoodServiceImpl extends ServiceImpl<GoodMapper, Good> implements Go
String type = good.getType();
String goodImg = good.getGoodImg();
String intro = good.getIntro();
String introDetail = good.getIntroDetail();
String detailImg = good.getDetailImg();
String richText = good.getRichText();
String label = good.getLabel();
Integer inventory = good.getInventory();
String festivalName = good.getFestivalName();
@ -108,7 +107,7 @@ public class GoodServiceImpl extends ServiceImpl<GoodMapper, Good> implements Go
throw new BusinessException(ErrorCode.PARAMS_ERROR, "参数id错误");
}
}
if (StringUtils.isAnyBlank(type, goodImg, intro, introDetail, detailImg, label, name, festivalName)) {
if (StringUtils.isAnyBlank(type, goodImg, intro, richText, label, name, festivalName)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "存在参数为空");
}
if (ObjectUtils.isEmpty(inventory) || inventory < 1) {

View File

@ -1,14 +1,25 @@
spring:
datasource:
# 生产环境
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://154.8.193.216:3306/feiyi?serverTimezone=Asia/Shanghai
# username: feiyi
# password: 123456asd
# hikari:
# maximum-pool-size: 20
# max-lifetime: 120000
# 开发环境
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://154.8.193.216:3306/feiyi?serverTimezone=Asia/Shanghai
username: feiyi
url: jdbc:mysql://123.249.108.160:3306/feiyi?serverTimezone=Asia/Shanghai
username: feiyi-sc
password: 123456asd
hikari:
maximum-pool-size: 20
max-lifetime: 120000
# 测试环境
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://123.249.108.160:3306/feiyi?serverTimezone=Asia/Shanghai
@ -19,6 +30,8 @@ spring:
# max-lifetime: 120000
# 生产环境
rabbitmq:
host: 123.249.108.160
@ -96,10 +109,6 @@ hwyun:
bucketName: carbon2
files:
upload:
path: C:\Users\35880\Desktop\文件上传测试
wx: