package com.friday.custody.service.trustService.citicZhongXin.common;

import com.alibaba.fastjson.JSON;

import java.util.HashMap;
import java.util.Map;

public enum UrlFrequencyEnum {

    GET_TOKEN(ZhongXinConstants.GET_TOKEN,5),
    FUND_INFO(ZhongXinConstants.FUND_INFO,50),
    INVESTOR_INFO_AND_INVESTOR_BANK_INFO(ZhongXinConstants.INVESTOR_INFO_AND_INVESTOR_BANK_INFO,50),
    FUND_NET_VALUE_INFO(ZhongXinConstants.FUND_NET_VALUE_INFO,50),
    CUST_SHARE_INFO(ZhongXinConstants.CUST_SHARE_INFO,50),
    TG_ACCOUNT_BALANCE_INFO_AND_ACCOUNT_INFO_1(ZhongXinConstants.TG_ACCOUNT_BALANCE_INFO_AND_ACCOUNT_INFO_1,50),
    TG_ACCOUNT_SEQ_INFO_1(ZhongXinConstants.TG_ACCOUNT_SEQ_INFO_1,50),
    TG_ACCOUNT_SEQ_INFO_2(ZhongXinConstants.TG_ACCOUNT_SEQ_INFO_2,50),
    MJ_ACCOUNT_BALANCE_INFO_AND_ACCOUNT_INFO_2(ZhongXinConstants.MJ_ACCOUNT_BALANCE_INFO_AND_ACCOUNT_INFO_2,200),
    MJ_ACCOUNT_SEQ_INFO(ZhongXinConstants.MJ_ACCOUNT_SEQ_INFO,200),
    FUND_TRADE_INFO(ZhongXinConstants.FUND_TRADE_INFO,50),
    ACCOUNT_INFO_3(ZhongXinConstants.ACCOUNT_INFO_3,50),
    FUND_PROFIT_INFO(ZhongXinConstants.FUND_PROFIT_INFO,50),
    CUST_SHARE_DETAIL_INFO(ZhongXinConstants.CUST_SHARE_DETAIL_INFO,50),

    FUND_VALUE_TABLE_DATA_INFO(ZhongXinConstants.FUND_VALUE_TABLE_DATA_INFO, 200),
    FUND_OPEN_INFO(ZhongXinConstants.FUND_OPEN_INFO, 500);

    private String url;
    private Integer frequency;

    public String getUrl() {
        return url;
    }

    public Integer getFrequency() {
        return frequency;
    }

    UrlFrequencyEnum(String url, Integer frequency){
        this.url = url;
        this.frequency = frequency;
    }

    public static Map<String,Integer> getUrlFrequencyMap(){
        UrlFrequencyEnum[] values = UrlFrequencyEnum.values();
        HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
        for (UrlFrequencyEnum value : values) {
            String url = value.getUrl();
            Integer frequency = value.getFrequency();
            stringIntegerHashMap.put(url,frequency);
        }
        return stringIntegerHashMap;
    }

    public static void main(String[] args) {
        Map<String, Integer> urlFrequencyMap = getUrlFrequencyMap();
        System.out.println(JSON.toJSONString(urlFrequencyMap));
    }
}
