版本号
parent
b6797652e5
commit
d4146f285e
4
pom.xml
4
pom.xml
|
@ -5,12 +5,12 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common</artifactId>
|
<artifactId>cloud-common</artifactId>
|
||||||
<version>3.6.4</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>cloud-common-core</artifactId>
|
<artifactId>cloud-common-core</artifactId>
|
||||||
<version>3.6.4</version>
|
<version>1.0.0</version>
|
||||||
<description>
|
<description>
|
||||||
cloud-common-core核心模块
|
cloud-common-core核心模块
|
||||||
</description>
|
</description>
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.muyu.common.core.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum SysPayType {
|
||||||
|
|
||||||
|
ALPAY("aliPay","支付宝"),
|
||||||
|
WECHATPAY("wechatPay","微信支付"),
|
||||||
|
JDPAY("jdPay","京东支付");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String info;
|
||||||
|
|
||||||
|
SysPayType(String code,String info){
|
||||||
|
this.code=code;
|
||||||
|
this.info=info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isCode(String code){
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.map(SysPayType::getCode)
|
||||||
|
.anyMatch(s->s.equals(code));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code查询渠道商的名称
|
||||||
|
* @param code
|
||||||
|
* @return 返回渠道商的名称
|
||||||
|
*/
|
||||||
|
public static String getInfoByCode(String code){
|
||||||
|
return Arrays.stream(values())
|
||||||
|
.filter(s->s.getCode().equals(code))
|
||||||
|
.findFirst()
|
||||||
|
.map(SysPayType::getInfo)
|
||||||
|
.orElseGet(()->"没有该渠道商");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue