View Javadoc
1   package org.oxerr.chbtc.dto;
2   
3   import java.math.BigDecimal;
4   
5   import com.fasterxml.jackson.annotation.JsonProperty;
6   
7   /**
8    * 订单。
9    */
10  public class Order extends CHBTCError {
11  
12  	private static final long serialVersionUID = 2014063001L;
13  
14  	/**
15  	 * 挂单 ID。
16  	 */
17  	private final long id;
18  
19  	/**
20  	 * 挂单类型 1/0[buy/sell]
21  	 */
22  	private final int type;
23  
24  	/**
25  	 * 单价。
26  	 */
27  	private final BigDecimal price;
28  
29  	/**
30  	 * 挂单货币类型 btc/ltc。
31  	 */
32  	private final String currency;
33  
34  	/**
35  	 * 已成交数量。
36  	 */
37  	private final BigDecimal tradeAmount;
38  
39  	/**
40  	 * 已成交总金额。
41  	 */
42  	private final BigDecimal tradeMoney;
43  
44  	/**
45  	 * 挂单总数量。
46  	 */
47  	private final BigDecimal totalAmount;
48  
49  	/**
50  	 * Unix 时间戳。 In milliseconds.
51  	 */
52  	private final long tradeDate;
53  
54  	/**
55  	 * 挂单状态(0、待成交 1、取消 2、交易完成 3、待成交未成交部分)
56  	 */
57  	private final int status;
58  
59  	public Order(
60  			@JsonProperty("code") final int code,
61  			@JsonProperty("message") final String message,
62  			@JsonProperty("id") final long id,
63  			@JsonProperty("type") final int type,
64  			@JsonProperty("price") final BigDecimal price,
65  			@JsonProperty("currency") final String currency,
66  			@JsonProperty("trade_amount") final BigDecimal tradeAmount,
67  			@JsonProperty("trade_money") final BigDecimal tradeMoney,
68  			@JsonProperty("total_amount") final BigDecimal totalAmount,
69  			@JsonProperty("trade_date") final long tradeDate,
70  			@JsonProperty("status") final int status
71  			) {
72  		super(code, message);
73  		this.id = id;
74  		this.type = type;
75  		this.price = price;
76  		this.currency = currency;
77  		this.tradeAmount = tradeAmount;
78  		this.tradeMoney = tradeMoney;
79  		this.totalAmount = totalAmount;
80  		this.tradeDate = tradeDate;
81  		this.status = status;
82  	}
83  
84  	public long getId() {
85  		return id;
86  	}
87  
88  	public int getType() {
89  		return type;
90  	}
91  
92  	public BigDecimal getPrice() {
93  		return price;
94  	}
95  
96  	public String getCurrency() {
97  		return currency;
98  	}
99  
100 	public BigDecimal getTradeAmount() {
101 		return tradeAmount;
102 	}
103 
104 	public BigDecimal getTradeMoney() {
105 		return tradeMoney;
106 	}
107 
108 	public BigDecimal getTotalAmount() {
109 		return totalAmount;
110 	}
111 
112 	public long getTradeDate() {
113 		return tradeDate;
114 	}
115 
116 	public int getStatus() {
117 		return status;
118 	}
119 
120 }