提交 131f5882 authored 作者: Whispa's avatar Whispa

commit

上级 925026c6
......@@ -7,8 +7,10 @@ import lombok.Setter;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 实体
......@@ -181,4 +183,32 @@ public class TbCfCategory {
public Date getUpdateTime() {
return updateTime;
}
private Integer getSwitched(String str){
switch (str){
case "XXS":
return 1;
case "XS":
return 2;
case "S":
return 3;
case "M":
return 4;
case "L":
return 5;
case "XL":
return 6;
case "XXL":
return 7;
case "XXXL":
return 8;
default:
return 9;
}
}
public List<TbCfOption> getOptionList() {
return optionList.stream().sorted(Comparator.comparing(o -> getSwitched(o.getOptiionSpecies()))).collect(Collectors.toList());
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论