package com.yami.trading.huobi.rose;
|
|
import lombok.Data;
|
import java.util.List;
|
|
/**
|
* 行情数据响应实体
|
*/
|
@Data
|
public class QuoteResponse {
|
private Integer total; // 总条数
|
private List<QuoteItem> items; // 行情数据列表
|
|
@lombok.Data
|
public static class QuoteItem {
|
private String code; // 股票代码
|
private Integer marketType; // 市场类型
|
private String name; // 股票名称
|
private Double currentPrice; // 最新价
|
private Double priceChange; // 涨跌额
|
private Double priceChangePercent; // 涨跌幅
|
private Double openPrice; // 今开
|
private Double highPrice; // 最高
|
private Double lowPrice; // 最低
|
private Long volume; // 成交额
|
private Long tradeAmount; // 成交额
|
private Long marketValue; // 总市值
|
private Double preClosePrice; // 昨收
|
private Double turnoverRate; // 换手率
|
private Double week52High; // 52周最高
|
|
public String getMarketTypeName() {
|
switch (marketType) {
|
case 1:
|
return "上证";
|
case 2:
|
return "深证";
|
case 3:
|
return "北证";
|
case 116:
|
return "港股";
|
case 105:
|
return "美股";
|
default:
|
return "未知";
|
}
|
}
|
|
@Override
|
public String toString() {
|
return String.format("%s(%s) - 当前价: %.2f,涨跌额: %f, 涨跌幅: %.2f%%, 成交额: %d万, 成交量: %d万",
|
name, code, currentPrice,priceChange, priceChangePercent,
|
tradeAmount, volume);
|
}
|
}
|
}
|