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";

    // coco券校验异常的错误
    public final static String COCO_RESPONSE_COUPON_ERR_STR = "700";

    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;

    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);
    }

}
