package cc.mrbird.febs.dapp.enumerate; import lombok.Getter; import java.math.BigDecimal; @Getter public enum NodeType { /** * 节点类型 投注金额 投注奖励 */ NODE_13(13,"566.9","793.66"), NODE_12(12,"405","566.9"), NODE_11(11,"289.3","405"), NODE_10(10,"206.6","289.3"), NODE_9(9,"147.6","206.6"), NODE_8(8,"105.4","147.6"), NODE_7(7,"75.3","105.4"), NODE_6(6,"53.8","75.3"), NODE_5(5,"38.4","53.8"), NODE_4(4,"27.4","38.4"), NODE_3(3,"19.6","27.4"), NODE_2(2,"14","19.6"), NODE_1(1,"10","14"); private int nodeType; private String nodeAmount; private String nodePerk; NodeType(int nodeType, String nodeAmount, String nodePerk) { this.nodeType = nodeType; this.nodeAmount = nodeAmount; this.nodePerk = nodePerk; } public NodeType getNode(int nodeType) { for (NodeType value : NodeType.values()) { if (value.nodeType == nodeType) { return value; } } return null; } public NodeType getNodeByAmount(BigDecimal nodeAmount) { BigDecimal abs = nodeAmount.abs(); for (NodeType value : NodeType.values()) { if (abs.toString().equals(value.nodeAmount)) { return value; } } return null; } }