Skip to content

Commit 48e7b0f

Browse files
committed
rzrq
1 parent 13da6b8 commit 48e7b0f

File tree

77 files changed

+2047
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2047
-263
lines changed

stock-service/src/main/java/vip/linhs/stock/api/TradeResultVo.java

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public class TradeResultVo<T> {
88

99
private String Message;
1010
private int Status;
11+
private int Count;
12+
private int Errcode;
1113
private List<T> Data;
1214

1315
public String getMessage() {
@@ -26,6 +28,22 @@ public void setStatus(int status) {
2628
Status = status;
2729
}
2830

31+
public int getCount() {
32+
return Count;
33+
}
34+
35+
public void setCount(int count) {
36+
Count = count;
37+
}
38+
39+
public int getErrcode() {
40+
return Errcode;
41+
}
42+
43+
public void setErrcode(int errcode) {
44+
Errcode = errcode;
45+
}
46+
2947
public List<T> getData() {
3048
return Data;
3149
}
@@ -34,17 +52,12 @@ public void setData(List<T> data) {
3452
Data = data;
3553
}
3654

37-
@Override
38-
public String toString() {
39-
return "TradeResultVo [Message=" + Message + ", Status=" + Status + ", Data=" + Data + "]";
40-
}
41-
42-
public boolean isSuccess() {
43-
return TradeResultVo.isSuccess(Status);
55+
public boolean success() {
56+
return TradeResultVo.success(Status);
4457
}
4558

46-
public static boolean isSuccess(int status) {
47-
return status == TradeResultVo.STATUS_SUCCESS;
59+
public static boolean success(int Status) {
60+
return Status == TradeResultVo.STATUS_SUCCESS;
4861
}
4962

5063
}

stock-service/src/main/java/vip/linhs/stock/api/request/AuthenticationRequest.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
public class AuthenticationRequest extends BaseTradeRequest {
44

55
private String password;
6-
private String randNumber = "0.9033461201665647";
6+
private String randNumber;
77
private String identifyCode;
88
private String duration = "1800";
9+
private String authCode;
910
private String type = "Z";
1011

1112
public AuthenticationRequest(int userId) {
@@ -44,6 +45,14 @@ public void setDuration(String duration) {
4445
this.duration = duration;
4546
}
4647

48+
public String getAuthCode() {
49+
return authCode;
50+
}
51+
52+
public void setAuthCode(String authCode) {
53+
this.authCode = authCode;
54+
}
55+
4756
public String getType() {
4857
return type;
4958
}
@@ -54,13 +63,7 @@ public void setType(String type) {
5463

5564
@Override
5665
public String getMethod() {
57-
return BaseTradeRequest.TradeRequestMethod.AuthenticationRequest.value();
58-
}
59-
60-
@Override
61-
public String toString() {
62-
return "AuthenticationRequest [password=" + password + ", randNumber=" + randNumber + ", identifyCode="
63-
+ identifyCode + ", duration=" + duration + ", type=" + type + ", " + super.toString() + "]";
66+
return BaseTradeRequest.TradeRequestMethod.Authentication.value();
6467
}
6568

6669
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package vip.linhs.stock.api.request;
2+
3+
public abstract class BaseQueryRequest extends BaseTradeRequest {
4+
5+
/**
6+
* 请求行数
7+
*/
8+
private String qqhs = "60";
9+
private String dwc;
10+
11+
public BaseQueryRequest(int userId) {
12+
super(userId);
13+
}
14+
15+
public String getQqhs() {
16+
return qqhs;
17+
}
18+
19+
public void setQqhs(String qqhs) {
20+
this.qqhs = qqhs;
21+
}
22+
23+
public String getDwc() {
24+
return dwc;
25+
}
26+
27+
public void setDwc(String dwc) {
28+
this.dwc = dwc;
29+
}
30+
31+
}

stock-service/src/main/java/vip/linhs/stock/api/request/BaseTradeRequest.java

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
public abstract class BaseTradeRequest {
44

5+
// 返回格式类型
6+
// { Data: [] }
7+
public static final int VERSION_DATA_LIST = 0;
8+
// { Data: {} }
9+
public static final int VERSION_DATA_OBJ = 1;
10+
// msg...
11+
public static final int VERSION_MSG = 2;
12+
// { }
13+
public static final int VERSION_OBJ = 3;
14+
515
private int userId;
616

717
public BaseTradeRequest(int userId) {
@@ -18,17 +28,27 @@ public void setUserId(int userId) {
1828

1929
public abstract String getMethod();
2030

21-
@Override
22-
public String toString() {
23-
return "BaseTradeRequest [userId=" + userId + ", method=" + getMethod() + "]";
24-
}
25-
2631
public enum TradeRequestMethod {
27-
GetAssertsRequest("get_asserts"), SubmitRequest("submit"), RevokeRequest("revoke"), GetStockList("get_stock_list"),
28-
GetOrdersDataRequest("get_orders_data"), GetDealDataRequest("get_deal_data"), AuthenticationRequest("authentication"),
29-
AuthenticationCheckRequest("authentication_check"), GetHisDealDataRequest("get_his_deal_data"), GetHisOrdersDataRequest("get_his_orders_data"),
30-
GetCanBuyNewStockListV3("get_can_buy_new_stock_list_v3"), GetConvertibleBondListV2("get_convertible_bond_list_v2"), SubmitBatTradeV2("submit_bat_trade_v2"),
31-
YZM("yzm");
32+
GetAsserts("get_asserts"), Submit("submit"), Revoke("revoke"), GetStockList("get_stock_list"),
33+
GetOrdersData("get_orders_data"), GetDealData("get_deal_data"), Authentication("authentication"),
34+
AuthenticationCheck("authentication_check"), GetHisDealData("get_his_deal_data"),
35+
GetHisOrdersData("get_his_orders_data"),
36+
GetCanBuyNewStockListV3("get_can_buy_new_stock_list_v3"),
37+
GetConvertibleBondListV2("get_convertible_bond_list_v2"),
38+
SubmitBatTradeV2("submit_bat_trade_v2"),
39+
YZM("yzm"),
40+
CrGetRzrqAsserts("cr_get_rzrq_asserts"),
41+
CrQueryCollateral("cr_query_collateral"),
42+
CrSubmit("cr_submit"),
43+
CrGetOrdersData("cr_get_orders_data"),
44+
CrGetDealData("cr_get_deal_data"),
45+
CrGetHisDealData("cr_get_his_deal_data"),
46+
CrGetHisOrdersData("cr_get_his_orders_data"),
47+
CrRevoke("cr_revoke"),
48+
CrGetCanBuyNewStockListV3("cr_get_can_buy_new_stock_list_v3"),
49+
CrGetConvertibleBondListV2("cr_get_convertible_bond_list_v2"),
50+
CrSubmitBatTradeV2("cr_submit_bat_trade_v2"),
51+
;
3252
private String value;
3353

3454
TradeRequestMethod(String value) {
@@ -41,4 +61,8 @@ public String value() {
4161

4262
}
4363

64+
public int responseVersion() {
65+
return VERSION_DATA_LIST;
66+
}
67+
4468
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package vip.linhs.stock.api.request;
2+
3+
public class CrGetCanBuyNewStockListV3Request extends GetCanBuyNewStockListV3Request {
4+
5+
public CrGetCanBuyNewStockListV3Request(int userId) {
6+
super(userId);
7+
}
8+
9+
@Override
10+
public String getMethod() {
11+
return BaseTradeRequest.TradeRequestMethod.CrGetCanBuyNewStockListV3.value();
12+
}
13+
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package vip.linhs.stock.api.request;
2+
3+
public class CrGetConvertibleBondListV2Request extends GetConvertibleBondListV2Request {
4+
5+
public CrGetConvertibleBondListV2Request(int userId) {
6+
super(userId);
7+
}
8+
9+
@Override
10+
public String getMethod() {
11+
return BaseTradeRequest.TradeRequestMethod.CrGetConvertibleBondListV2.value();
12+
}
13+
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package vip.linhs.stock.api.request;
2+
3+
public class CrGetDealDataRequest extends GetDealDataRequest {
4+
5+
public CrGetDealDataRequest(int userId) {
6+
super(userId);
7+
}
8+
9+
@Override
10+
public String getMethod() {
11+
return BaseTradeRequest.TradeRequestMethod.CrGetDealData.value();
12+
}
13+
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package vip.linhs.stock.api.request;
2+
3+
public class CrGetHisDealDataRequest extends GetHisDealDataRequest {
4+
5+
public CrGetHisDealDataRequest(int userId) {
6+
super(userId);
7+
}
8+
9+
@Override
10+
public String getMethod() {
11+
return BaseTradeRequest.TradeRequestMethod.CrGetHisDealData.value();
12+
}
13+
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package vip.linhs.stock.api.request;
2+
3+
public class CrGetHisOrdersDataRequest extends GetHisOrdersDataRequest {
4+
5+
public CrGetHisOrdersDataRequest(int userId) {
6+
super(userId);
7+
}
8+
9+
@Override
10+
public String getMethod() {
11+
return BaseTradeRequest.TradeRequestMethod.CrGetHisOrdersData.value();
12+
}
13+
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package vip.linhs.stock.api.request;
2+
3+
public class CrGetOrdersDataRequest extends GetOrdersDataRequest {
4+
5+
public CrGetOrdersDataRequest(int userId) {
6+
super(userId);
7+
}
8+
9+
@Override
10+
public String getMethod() {
11+
return BaseTradeRequest.TradeRequestMethod.CrGetOrdersData.value();
12+
}
13+
14+
}

0 commit comments

Comments
 (0)