1
zj
2026-01-14 d147df97cffc18ac764719041b2a4dda8311921c
src/main/java/com/nq/enums/EStockType.java
@@ -13,15 +13,9 @@
    US("US","美国股票","5",PropertiesUtil.getProperty("US_HTTP_API"),PropertiesUtil.getProperty("US_KEY"),"USD","$"),
//    HK("HK","香港股票","39",PropertiesUtil.getProperty("HK_HTTP_API"),PropertiesUtil.getProperty("HK_KEY"),"HKD","HK$"),
//    MAS("MAS","马来西亚股票","42",PropertiesUtil.getProperty("MAS_HTTP_API"),PropertiesUtil.getProperty("MAS_KEY"),"MYR","RM"),
//
//    IN("IN","印度股票","14", PropertiesUtil.getProperty("JS_IN_HTTP_URL"),PropertiesUtil.getProperty("JS_IN_KEY"),"INR","₹"),
    MX("MEX","墨西哥股票","7",PropertiesUtil.getProperty("MX_HTTP_API"),PropertiesUtil.getProperty("MX_KEY"),"MXN","MXN$");
    JP("JP","日本股票","35",PropertiesUtil.getProperty("JP_HTTP_API"),PropertiesUtil.getProperty("JP_KEY"),"JPY","¥");
//    TH("TH","泰国股票","41",PropertiesUtil.getProperty("TH_HTTP_API"),PropertiesUtil.getProperty("TH_KEY")),
//    HG("HG","韩国股票","11",PropertiesUtil.getProperty("HG_HTTP_API"),PropertiesUtil.getProperty("HG_KEY")),
//    SZHB("SZHB","数字货币","41",PropertiesUtil.getProperty("SZHB_HTTP_API"),PropertiesUtil.getProperty("SZHB_KEY"));
    private String code;
    private String typeDesc;
    public String contryId;
@@ -33,6 +27,9 @@
    private String symbol1;
    public static EStockType getDefault() {
        return US; // 指定默认
    }
    EStockType(String code, String typeDesc, String contryId, String stockUrl, String stockKey,String  symbol,String symbol1) {
        this.code = code;
@@ -47,10 +44,31 @@
    public static EStockType getEStockTypeByCode(String code){
        if(EStockType.US.getCode().equals(code)){
            return US;
        }else if(EStockType.MX.getCode().equals(code)){
            return  MX;
        }else if(EStockType.JP.getCode().equals(code)){
            return JP;
        }else{
            return  MX;
            return US;
        }
    }
    public static boolean isExistByCode(String code){
        if(EStockType.US.getCode().equals(code)){
            return true;
        }else if(EStockType.JP.getCode().equals(code)){
            return true;
        }else{
            return false;
        }
    }
    //根据货币获取类型
    public static EStockType getEStockTypeBySymbol(String symbol){
        if(EStockType.US.getSymbol().equals(symbol)){
            return US;
        }else if(EStockType.JP.getSymbol().equals(symbol)){
            return JP;
        }else{
            return null;
        }
    }