package cn.freemud.constant;

import java.util.HashSet;
import java.util.Set;

public class ResponseCodeConstant {

    public final static Integer RESPONSE_SUCCESS = 100;

    public final static String RESPONSE_SUCCESS_STR = "100";

    public final static String RESPONSE_SUCCESS_OK = "ok";
    public final static Integer RESPONSE_SUCCESS_1 = 1;
    public final static String RESPONSE_SUCCESS_0_STR = "0";
    public final static int RESPONSE_SUCCESS_0 = 0;

    // 电子风味卡,密码错误或者余额不足,需要特殊处理
    public final static String PASSWORD_WRONG = "8200407";
    public final static String NOT_SUFFICIENT_FUND = "8200407";
    public final static Integer PAYMENT_RESPONSE_SUCCESS = 200;

    private final static Set<Object> successResponseCodeSet = new HashSet<>();

    static {
        successResponseCodeSet.add(RESPONSE_SUCCESS);
        successResponseCodeSet.add(RESPONSE_SUCCESS_STR);
        successResponseCodeSet.add(RESPONSE_SUCCESS_OK);
        successResponseCodeSet.add(RESPONSE_SUCCESS_1);
        successResponseCodeSet.add(RESPONSE_SUCCESS_0_STR);
    }

    public static boolean isSuccessRespinseCode(Object o) {
        return successResponseCodeSet.contains(o);
    }

}
