对商品名称包含逗号可能导致的问题处理

This commit is contained in:
Chopper 2022-01-21 16:31:06 +08:00
parent a65f0ad384
commit 145406be32

View File

@ -103,7 +103,7 @@ public class GoodsOperationDTO implements Serializable {
* @see cn.lili.modules.goods.entity.enums.GoodsTypeEnum * @see cn.lili.modules.goods.entity.enums.GoodsTypeEnum
*/ */
@ApiModelProperty(value = "商品类型") @ApiModelProperty(value = "商品类型")
@EnumValue(strValues = {"PHYSICAL_GOODS","VIRTUAL_GOODS","E_COUPON"},message = "商品类型参数值错误") @EnumValue(strValues = {"PHYSICAL_GOODS", "VIRTUAL_GOODS", "E_COUPON"}, message = "商品类型参数值错误")
private String goodsType; private String goodsType;
/** /**
@ -112,6 +112,9 @@ public class GoodsOperationDTO implements Serializable {
@ApiModelProperty(value = "商品视频") @ApiModelProperty(value = "商品视频")
private String goodsVideo; private String goodsVideo;
public String getGoodsName() {
//对商品对名称做一个极限处理这里没有用xss过滤是因为xss过滤为全局过滤影响很大
// 业务中全局代码中只有商品名称不能拥有英文逗号是由于商品名称存在一个数据库联合查询结果要根据逗号分组
return goodsName.replace(",", "");
}
} }