package com.nq.enums;
|
|
|
import com.nq.utils.PropertiesUtil;
|
|
/**
|
* 股票类型
|
* */
|
|
public enum EStockType {
|
|
|
|
US("US","美国股票","5",PropertiesUtil.getProperty("US_HTTP_API"),PropertiesUtil.getProperty("US_KEY"),"USD","$"),
|
|
JP("JP","日本股票","35",PropertiesUtil.getProperty("JP_HTTP_API"),PropertiesUtil.getProperty("JP_KEY"),"JPY","¥");
|
|
|
private String code;
|
private String typeDesc;
|
public String contryId;
|
|
public String stockUrl;
|
public String stockKey;
|
|
private String symbol;
|
|
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;
|
this.typeDesc = typeDesc;
|
this.contryId = contryId;
|
this.stockUrl = stockUrl;
|
this.stockKey = stockKey;
|
this.symbol = symbol;
|
this.symbol1 = symbol1;
|
}
|
|
public static EStockType getEStockTypeByCode(String code){
|
if(EStockType.US.getCode().equals(code)){
|
return US;
|
}else if(EStockType.JP.getCode().equals(code)){
|
return JP;
|
}else{
|
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;
|
}
|
}
|
|
public String getContryId() {
|
return contryId;
|
}
|
|
public String getStockUrl() {
|
return stockUrl;
|
}
|
|
public String getStockKey() {
|
return stockKey;
|
}
|
|
public String getCode() {
|
return code;
|
}
|
|
public String getSymbol() {
|
return symbol;
|
}
|
|
public void setSymbol(String symbol) {
|
this.symbol = symbol;
|
}
|
|
public String getSymbol1() {
|
return symbol1;
|
}
|
|
public void setSymbol1(String symbol1) {
|
this.symbol1 = symbol1;
|
}
|
|
public String getTypeDesc() {
|
return typeDesc;
|
}
|
|
|
|
|
}
|