|
|
@@ -82,4 +82,25 @@ public class TradeVistorReqVO {
|
|
|
|
|
|
@Schema(description = "价格")
|
|
|
private BigDecimal price;
|
|
|
+
|
|
|
+ public void setName(String str) {
|
|
|
+ if (str == null) {
|
|
|
+ this.name = null;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String s = str;
|
|
|
+ // 1. 删除真实ASCII控制字符 \t\r\n\v\f
|
|
|
+ s = s.replaceAll("[\\p{Cntrl}]", "");
|
|
|
+
|
|
|
+ // 2. 删除字符串字面转义:\r \n \t \v \f
|
|
|
+ s = s.replaceAll("\\\\r|\\\\n|\\\\t|\\\\v|\\\\f", "");
|
|
|
+
|
|
|
+ // 3. 合并连续空格
|
|
|
+ s = s.replaceAll(" +", " ");
|
|
|
+
|
|
|
+ // 4. 去除首尾空格
|
|
|
+ s = s.trim();
|
|
|
+
|
|
|
+ this.name = s.isEmpty() ? null : s;
|
|
|
+ }
|
|
|
}
|