Skip to content

Commit 5acee3d

Browse files
authored
Merge pull request binarywang#99 from johnnytung/develop
优化命名
2 parents 4812697 + a2106d3 commit 5acee3d

File tree

9 files changed

+172
-128
lines changed

9 files changed

+172
-128
lines changed

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/device/BaseResp.java

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
package me.chanjar.weixin.mp.bean.device;
22

3+
import com.google.gson.annotations.SerializedName;
4+
35
/**
46
* Created by keungtung on 10/12/2016.
57
*/
68
public class BaseResp extends AbstractDeviceBean{
7-
private BaseInfo base_info;
8-
private Integer errcode;
9-
private String errmsg;
10-
11-
public Integer getErrcode() {
12-
return errcode;
9+
@SerializedName("base_info")
10+
private BaseInfo baseInfo;
11+
@SerializedName("errcode")
12+
private Integer errCode;
13+
@SerializedName("errmsg")
14+
private String errMsg;
15+
16+
public Integer getErrCode() {
17+
return errCode;
1318
}
1419

15-
public void setErrcode(Integer errcode) {
16-
this.errcode = errcode;
20+
public void setErrCode(Integer errCode) {
21+
this.errCode = errCode;
1722
}
1823

19-
public BaseInfo getBase_info() {
20-
return base_info;
24+
public BaseInfo getBaseInfo() {
25+
return baseInfo;
2126
}
2227

23-
public void setBase_info(BaseInfo base_info) {
24-
this.base_info = base_info;
28+
public void setBaseInfo(BaseInfo baseInfo) {
29+
this.baseInfo = baseInfo;
2530
}
2631

27-
public String getErrmsg() {
28-
return errmsg;
32+
public String getErrMsg() {
33+
return errMsg;
2934
}
3035

31-
public void setErrmsg(String errmsg) {
32-
this.errmsg = errmsg;
36+
public void setErrMsg(String errMsg) {
37+
this.errMsg = errMsg;
3338
}
3439

3540
private class BaseInfo {

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/device/RespMsg.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
package me.chanjar.weixin.mp.bean.device;
22

3+
import com.google.gson.annotations.SerializedName;
4+
35
/**
46
* Created by keungtung on 10/12/2016.
57
*/
68

79
public class RespMsg extends AbstractDeviceBean{
10+
@SerializedName("ret_code")
811
private Integer retCode;
12+
@SerializedName("error_info")
913
private String errorInfo;
1014

1115
public Integer getRetCode() {
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
package me.chanjar.weixin.mp.bean.device;
22

3+
import com.google.gson.annotations.SerializedName;
34
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
45

56
/**
67
* Created by keungtung on 14/12/2016.
78
*/
89
public class TransMsgResp extends AbstractDeviceBean{
910
private Integer ret;
10-
private String ret_info;
11-
private Integer errcode;
12-
private String errmsg;
11+
@SerializedName("ret_info")
12+
private String retInfo;
13+
@SerializedName("errcode")
14+
private Integer errCode;
15+
@SerializedName("errmsg")
16+
private String errMsg;
1317

1418
public static TransMsgResp fromJson(String json) {
1519
return WxGsonBuilder.create().fromJson(json, TransMsgResp.class);
@@ -23,27 +27,27 @@ public void setRet(Integer ret) {
2327
this.ret = ret;
2428
}
2529

26-
public String getRet_info() {
27-
return ret_info;
30+
public String getRetInfo() {
31+
return retInfo;
2832
}
2933

30-
public void setRet_info(String ret_info) {
31-
this.ret_info = ret_info;
34+
public void setRetInfo(String retInfo) {
35+
this.retInfo = retInfo;
3236
}
3337

34-
public Integer getErrcode() {
35-
return errcode;
38+
public Integer getErrCode() {
39+
return errCode;
3640
}
3741

38-
public void setErrcode(Integer errcode) {
39-
this.errcode = errcode;
42+
public void setErrCode(Integer errCode) {
43+
this.errCode = errCode;
4044
}
4145

42-
public String getErrmsg() {
43-
return errmsg;
46+
public String getErrMsg() {
47+
return errMsg;
4448
}
4549

46-
public void setErrmsg(String errmsg) {
47-
this.errmsg = errmsg;
50+
public void setErrMsg(String errMsg) {
51+
this.errMsg = errMsg;
4852
}
4953
}
Lines changed: 56 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
package me.chanjar.weixin.mp.bean.device;
22

3+
import com.google.gson.annotations.SerializedName;
4+
35
/**
46
* Created by keungtung on 10/12/2016.
57
*/
68
public class WxDevice {
79
private String id;
810
private String mac;
9-
private String connect_protocol;
10-
private String auth_key;
11-
private String close_strategy;
12-
private String conn_strategy;
13-
private String crypt_method;
14-
private String auth_ver;
15-
private String manu_mac_pos;
16-
private String ser_mac_pos;
17-
private String ble_simple_protocol;
11+
@SerializedName("connect_protocol")
12+
private String connectProtocol;
13+
@SerializedName("auth_key")
14+
private String authKey;
15+
@SerializedName("close_strategy")
16+
private String closeStrategy;
17+
@SerializedName("conn_strategy")
18+
private String connStrategy;
19+
@SerializedName("crypt_method")
20+
private String cryptMethod;
21+
@SerializedName("auth_ver")
22+
private String authVer;
23+
@SerializedName("manu_mac_pos")
24+
private String manuMacPos;
25+
@SerializedName("ser_mac_pos")
26+
private String serMacPos;
27+
@SerializedName("ble_simple_protocol")
28+
private String bleSimpleProtocol;
1829

1930
public String getId() {
2031
return id;
@@ -32,75 +43,75 @@ public void setMac(String mac) {
3243
this.mac = mac;
3344
}
3445

35-
public String getConnect_protocol() {
36-
return connect_protocol;
46+
public String getConnectProtocol() {
47+
return connectProtocol;
3748
}
3849

39-
public void setConnect_protocol(String connect_protocol) {
40-
this.connect_protocol = connect_protocol;
50+
public void setConnectProtocol(String connectProtocol) {
51+
this.connectProtocol = connectProtocol;
4152
}
4253

43-
public String getAuth_key() {
44-
return auth_key;
54+
public String getAuthKey() {
55+
return authKey;
4556
}
4657

47-
public void setAuth_key(String auth_key) {
48-
this.auth_key = auth_key;
58+
public void setAuthKey(String authKey) {
59+
this.authKey = authKey;
4960
}
5061

51-
public String getClose_strategy() {
52-
return close_strategy;
62+
public String getCloseStrategy() {
63+
return closeStrategy;
5364
}
5465

55-
public void setClose_strategy(String close_strategy) {
56-
this.close_strategy = close_strategy;
66+
public void setCloseStrategy(String closeStrategy) {
67+
this.closeStrategy = closeStrategy;
5768
}
5869

59-
public String getConn_strategy() {
60-
return conn_strategy;
70+
public String getConnStrategy() {
71+
return connStrategy;
6172
}
6273

63-
public void setConn_strategy(String conn_strategy) {
64-
this.conn_strategy = conn_strategy;
74+
public void setConnStrategy(String connStrategy) {
75+
this.connStrategy = connStrategy;
6576
}
6677

67-
public String getCrypt_method() {
68-
return crypt_method;
78+
public String getCryptMethod() {
79+
return cryptMethod;
6980
}
7081

71-
public void setCrypt_method(String crypt_method) {
72-
this.crypt_method = crypt_method;
82+
public void setCryptMethod(String cryptMethod) {
83+
this.cryptMethod = cryptMethod;
7384
}
7485

75-
public String getAuth_ver() {
76-
return auth_ver;
86+
public String getAuthVer() {
87+
return authVer;
7788
}
7889

79-
public void setAuth_ver(String auth_ver) {
80-
this.auth_ver = auth_ver;
90+
public void setAuthVer(String authVer) {
91+
this.authVer = authVer;
8192
}
8293

83-
public String getManu_mac_pos() {
84-
return manu_mac_pos;
94+
public String getManuMacPos() {
95+
return manuMacPos;
8596
}
8697

87-
public void setManu_mac_pos(String manu_mac_pos) {
88-
this.manu_mac_pos = manu_mac_pos;
98+
public void setManuMacPos(String manuMacPos) {
99+
this.manuMacPos = manuMacPos;
89100
}
90101

91-
public String getSer_mac_pos() {
92-
return ser_mac_pos;
102+
public String getSerMacPos() {
103+
return serMacPos;
93104
}
94105

95-
public void setSer_mac_pos(String ser_mac_pos) {
96-
this.ser_mac_pos = ser_mac_pos;
106+
public void setSerMacPos(String serMacPos) {
107+
this.serMacPos = serMacPos;
97108
}
98109

99-
public String getBle_simple_protocol() {
100-
return ble_simple_protocol;
110+
public String getBleSimpleProtocol() {
111+
return bleSimpleProtocol;
101112
}
102113

103-
public void setBle_simple_protocol(String ble_simple_protocol) {
104-
this.ble_simple_protocol = ble_simple_protocol;
114+
public void setBleSimpleProtocol(String bleSimpleProtocol) {
115+
this.bleSimpleProtocol = bleSimpleProtocol;
105116
}
106117
}
Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package me.chanjar.weixin.mp.bean.device;
22

3+
import com.google.gson.annotations.SerializedName;
4+
35
import java.util.Arrays;
46
import java.util.LinkedList;
57
import java.util.List;
@@ -8,35 +10,38 @@
810
* Created by keungtung on 10/12/2016.
911
*/
1012
public class WxDeviceAuthorize extends AbstractDeviceBean {
11-
private String deivce_num;
12-
private String op_type;
13-
private List<WxDevice> device_list = new LinkedList<>();
14-
15-
public String getDeivce_num() {
16-
return deivce_num;
13+
@SerializedName("device_num")
14+
private String deviceNum;
15+
@SerializedName("op_type")
16+
private String opType;
17+
@SerializedName("device_list")
18+
private List<WxDevice> deviceList = new LinkedList<>();
19+
20+
public String getDeviceNum() {
21+
return deviceNum;
1722
}
1823

19-
public void setDeivce_num(String deivce_num) {
20-
this.deivce_num = deivce_num;
24+
public void setDeviceNum(String deviceNum) {
25+
this.deviceNum = deviceNum;
2126
}
2227

23-
public String getOp_type() {
24-
return op_type;
28+
public String getOpType() {
29+
return opType;
2530
}
2631

27-
public void setOp_type(String op_type) {
28-
this.op_type = op_type;
32+
public void setOpType(String opType) {
33+
this.opType = opType;
2934
}
3035

31-
public List<WxDevice> getDevice_list() {
32-
return device_list;
36+
public List<WxDevice> getDeviceList() {
37+
return deviceList;
3338
}
3439

35-
public void setDevice_list(List<WxDevice> device_list) {
36-
this.device_list = device_list;
40+
public void setDeviceList(List<WxDevice> deviceList) {
41+
this.deviceList = deviceList;
3742
}
3843

3944
public void addDevice(WxDevice... devices) {
40-
this.device_list.addAll(Arrays.asList(devices));
45+
this.deviceList.addAll(Arrays.asList(devices));
4146
}
4247
}
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package me.chanjar.weixin.mp.bean.device;
22

3+
import com.google.gson.annotations.SerializedName;
4+
35
/**
46
* Created by keungtung on 10/12/2016.
57
*/
68
public class WxDeviceBind extends AbstractDeviceBean{
79
private String ticket;
8-
private String device_id;
9-
private String openid;
10+
@SerializedName("device_id")
11+
private String deviceId;
12+
@SerializedName("openid")
13+
private String openId;
1014

1115
public String getTicket() {
1216
return ticket;
@@ -16,19 +20,19 @@ public void setTicket(String ticket) {
1620
this.ticket = ticket;
1721
}
1822

19-
public String getDevice_id() {
20-
return device_id;
23+
public String getDeviceId() {
24+
return deviceId;
2125
}
2226

23-
public void setDevice_id(String device_id) {
24-
this.device_id = device_id;
27+
public void setDeviceId(String deviceId) {
28+
this.deviceId = deviceId;
2529
}
2630

27-
public String getOpenid() {
28-
return openid;
31+
public String getOpenId() {
32+
return openId;
2933
}
3034

31-
public void setOpenid(String openid) {
32-
this.openid = openid;
35+
public void setOpenId(String openId) {
36+
this.openId = openId;
3337
}
3438
}

0 commit comments

Comments
 (0)