View Javadoc
1   package org.oxerr.chbtc.dto;
2   
3   import com.fasterxml.jackson.annotation.JsonProperty;
4   
5   public class CHBTCError extends BaseObject {
6   
7   	public static final int SUCCESS = 1000;
8   
9   	public static final int ERROR_TIPS = 1001;
10  
11  	public static final int INTERNAL_ERROR = 1002;
12  
13  	public static final int VALIDATE_NO_PASS = 1003;
14  
15  	public static final int INSUFFICIENT_CNY_BALANCE = 2001;
16  
17  	public static final int INSUFFICIENT_BTC_BALANCE = 2002;
18  
19  	public static final int INSUFFICIENT_LTC_BALANCE = 2003;
20  
21  	/**
22  	 * 挂单没有找到
23  	 */
24  	public static final int NOT_FOUND_ORDER = 3001;
25  
26  	public static final int INVALID_MONEY = 3002;
27  
28  	public static final int INVALID_AMOUNT = 3003;
29  
30  	public static final int NO_SUCH_USER = 3004;
31  
32  	public static final int INVALID_ARGUMENTS = 3005;
33  
34  	public static final int INVALID_IP_ADDRESS = 3006;
35  
36  	public static final int API_LOCKED_OR_NOT_ENABLED = 4001;
37  
38  	public static final int REQUEST_TOO_FREQUENTLY = 4002;
39  
40  	private static final long serialVersionUID = 2014063001L;
41  
42  	private final int code;
43  
44  	private final String message;
45  
46  	public CHBTCError(
47  			@JsonProperty("code") final int code,
48  			@JsonProperty("message") final String message) {
49  		this.code = code;
50  		this.message = message;
51  	}
52  
53  	public int getCode() {
54  		return code;
55  	}
56  
57  	public String getMessage() {
58  		return message;
59  	}
60  
61  	public boolean isSuccess() {
62  		return getCode() == SUCCESS || getCode() == 0;
63  	}
64  
65  }