Authored by zhaojun2

bugfix

1 package com.yohoufo.common.utils; 1 package com.yohoufo.common.utils;
2 2
3 -import java.util.Map; 3 +import org.apache.commons.lang3.StringUtils;
  4 +
  5 +import java.util.*;
4 import java.util.Map.Entry; 6 import java.util.Map.Entry;
5 import java.util.regex.Matcher; 7 import java.util.regex.Matcher;
6 import java.util.regex.Pattern; 8 import java.util.regex.Pattern;
  9 +import java.util.stream.Collectors;
7 10
8 public final class UfoStringUtils extends org.apache.commons.lang3.StringUtils{ 11 public final class UfoStringUtils extends org.apache.commons.lang3.StringUtils{
9 /** 12 /**
@@ -145,5 +148,13 @@ public final class UfoStringUtils extends org.apache.commons.lang3.StringUtils{ @@ -145,5 +148,13 @@ public final class UfoStringUtils extends org.apache.commons.lang3.StringUtils{
145 return password.matches(reg); 148 return password.matches(reg);
146 } 149 }
147 150
  151 + public static List<Integer> string2IntegerList(String str) {
  152 + if (StringUtils.isNotBlank(str)) {
  153 + List<Integer> list = Arrays.stream(str.split(",")).map(e -> parseInt(e)).filter(Objects::nonNull).collect(Collectors.toList());
  154 + return list;
  155 + }
  156 + return Collections.emptyList();
  157 + }
  158 +
148 159
149 } 160 }
@@ -6,8 +6,6 @@ import com.alibaba.fastjson.annotation.JSONField; @@ -6,8 +6,6 @@ import com.alibaba.fastjson.annotation.JSONField;
6 public class ProductSeriesTemplate { 6 public class ProductSeriesTemplate {
7 7
8 8
9 - @JSONField(name = "product_id")  
10 - private String productId;  
11 @JSONField(name = "image_url") 9 @JSONField(name = "image_url")
12 private String imageUrl; 10 private String imageUrl;
13 @JSONField(name = "series_id") 11 @JSONField(name = "series_id")
@@ -15,14 +13,6 @@ public class ProductSeriesTemplate { @@ -15,14 +13,6 @@ public class ProductSeriesTemplate {
15 @JSONField(name = "series_name") 13 @JSONField(name = "series_name")
16 private String seriesName; 14 private String seriesName;
17 15
18 - public String getProductId() {  
19 - return productId;  
20 - }  
21 -  
22 - public void setProductId(String productId) {  
23 - this.productId = productId;  
24 - }  
25 -  
26 public String getImageUrl() { 16 public String getImageUrl() {
27 return imageUrl; 17 return imageUrl;
28 } 18 }