1
zyy
2 days ago 4fefff17528a878d345ff3311c297a66a671b8d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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);
        }
    }
}