package com.zzh.common;
import com.google.common.collect.Sets;
import java.util.Set;
/**
* Created by geely
*/
public class Const {
public static final String CURRENT_USER = "currentUser";
public static final String ADMIN_USER = "adminUser";
public static final String EMAIL = "email";
public static final String USERNAME = "username";
public interface ProductListOrderBy{
Set<String> PRICE_ASC_DESC = Sets.newHashSet("price_desc","price_asc");
}
public interface Role{
int ROLE_CUSTOMER = 1; //普通用户
int ROLE_ADMIN = 0;//管理员
}
public enum ProductStatusEnum{
ON_SALE(1,"在线");
private String value;
private int code;
ProductStatusEnum(int code,String value){
this.code = code;
this.value = value;
}
public String getValue() {
return value;
}
public int getCode() {
return code;
}
}
public enum OrderStatusEnum{
CANCELED(0,"已取消"),
NO_PAY(10,"未支付"),
PAID(20,"已付款"),
SHIPPED(40,"已发货"),
ORDER_SUCCESS(50,"订单完成"),
ORDER_CLOSE(60,"订单关闭");
OrderStatusEnum(int code,String value){
this.code = code;
this.value = value;
}
private String value;
private int code;
public String getValue() {
return value;
}
public int getCode() {
return code;
}
public static OrderStatusEnum codeOf(int code){
for(OrderStatusEnum orderStatusEnum : values()){
if(orderStatusEnum.getCode() == code){
return orderStatusEnum;
}
}
throw new RuntimeException("么有找到对应的枚举");
}
}
public interface AlipayCallback{
String TRADE_STATUS_WAIT_BUYER_PAY = "WAIT_BUYER_PAY";
String TRADE_STATUS_TRADE_SUCCESS = "TRADE_SUCCESS";
String RESPONSE_SUCCESS = "success";
String RESPONSE_FAILED = "failed";
}
public enum PayPlatformEnum{
ALIPAY(1,"支付宝");
PayPlatformEnum(int code,String value){
this.code = code;
this.value = value;
}
private String value;
private int code;
public String getValue() {
return value;
}
public int getCode() {
return code;
}
}
public enum PaymentTypeEnum{
ONLINE_PAY(1,"在线支付");
PaymentTypeEnum(int code,String value){
this.code = code;
this.value = value;
}
private String value;
private int code;
public String getValue() {
return value;
}
public int getCode() {
return code;
}
public static PaymentTypeEnum codeOf(int code){
for(PaymentTypeEnum paymentTypeEnum : values()){
if(paymentTypeEnum.getCode() == code){
return paymentTypeEnum;
}
}
throw new RuntimeException("么有找到对应的枚举");
}
}
}
最近下载更多
zuidaama LV2
4月20日
zhangbo2020 LV6
4月17日
微信网友_6444139264921600 LV8
2月25日
zolscy LV24
2024年11月28日
krispeng LV15
2024年10月31日
233002037 LV3
2024年10月20日
xiquyiyuan LV10
2024年8月28日
TY0165 LV20
2024年6月22日
alsk222 LV4
2024年5月10日
ruozizz LV3
2024年4月21日
最近浏览更多
mritsy LV2
11月13日
奋斗的小蚂蚁 LV17
10月17日
微信网友_6956978011000832 LV2
7月27日
zuidaama LV2
4月20日
zhangbo2020 LV6
4月17日
jinxinquq
3月30日
暂无贡献等级
Javatopone
3月29日
暂无贡献等级
哪里的完整版 LV8
3月6日
qibodong LV15
2月28日
2636804923 LV6
2月24日

