package com.jeequan.jeepay.core.model;


import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 代码功能枚举
 */
@Data
@ToString
public class Capability implements Serializable {

    /*[
    {"key": "PAY_BASE", "value": "Y", "desc": "当面付"},
    {"key": "H5_PAY", "value": "Y", "desc": "H5支付"},
    {"key": "TURNS_PAY", "value": "Y", "desc": "轮询码开关"},
      ]*/
    public static final Capability PAY_BASE = new Capability("PAY_BASE", "Y", "当面付");
    public static final Capability H5_PAY = new Capability("H5_PAY", "Y", "H5支付");
    public static final Capability TURNS_PAY = new Capability("TURNS_PAY", "Y", "轮询码开关");

    public static final Map<String, Capability> MAP = new HashMap<>();

    static {
        MAP.put(PAY_BASE.key, PAY_BASE);
        MAP.put(H5_PAY.key, H5_PAY);
        MAP.put(TURNS_PAY.key, TURNS_PAY);
    }

    private final String key;
    private final String value;
    private final String desc;
}
