Merge pull request #99 from johnnytung/develop

优化命名
This commit is contained in:
Binary Wang 2016-12-16 13:47:55 +08:00 committed by GitHub
commit 5acee3dc24
9 changed files with 170 additions and 126 deletions

View File

@ -1,35 +1,40 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
/** /**
* Created by keungtung on 10/12/2016. * Created by keungtung on 10/12/2016.
*/ */
public class BaseResp extends AbstractDeviceBean{ public class BaseResp extends AbstractDeviceBean{
private BaseInfo base_info; @SerializedName("base_info")
private Integer errcode; private BaseInfo baseInfo;
private String errmsg; @SerializedName("errcode")
private Integer errCode;
@SerializedName("errmsg")
private String errMsg;
public Integer getErrcode() { public Integer getErrCode() {
return errcode; return errCode;
} }
public void setErrcode(Integer errcode) { public void setErrCode(Integer errCode) {
this.errcode = errcode; this.errCode = errCode;
} }
public BaseInfo getBase_info() { public BaseInfo getBaseInfo() {
return base_info; return baseInfo;
} }
public void setBase_info(BaseInfo base_info) { public void setBaseInfo(BaseInfo baseInfo) {
this.base_info = base_info; this.baseInfo = baseInfo;
} }
public String getErrmsg() { public String getErrMsg() {
return errmsg; return errMsg;
} }
public void setErrmsg(String errmsg) { public void setErrMsg(String errMsg) {
this.errmsg = errmsg; this.errMsg = errMsg;
} }
private class BaseInfo { private class BaseInfo {

View File

@ -1,11 +1,15 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
/** /**
* Created by keungtung on 10/12/2016. * Created by keungtung on 10/12/2016.
*/ */
public class RespMsg extends AbstractDeviceBean{ public class RespMsg extends AbstractDeviceBean{
@SerializedName("ret_code")
private Integer retCode; private Integer retCode;
@SerializedName("error_info")
private String errorInfo; private String errorInfo;
public Integer getRetCode() { public Integer getRetCode() {

View File

@ -1,5 +1,6 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.common.util.json.WxGsonBuilder;
/** /**
@ -7,9 +8,12 @@ import me.chanjar.weixin.common.util.json.WxGsonBuilder;
*/ */
public class TransMsgResp extends AbstractDeviceBean{ public class TransMsgResp extends AbstractDeviceBean{
private Integer ret; private Integer ret;
private String ret_info; @SerializedName("ret_info")
private Integer errcode; private String retInfo;
private String errmsg; @SerializedName("errcode")
private Integer errCode;
@SerializedName("errmsg")
private String errMsg;
public static TransMsgResp fromJson(String json) { public static TransMsgResp fromJson(String json) {
return WxGsonBuilder.create().fromJson(json, TransMsgResp.class); return WxGsonBuilder.create().fromJson(json, TransMsgResp.class);
@ -23,27 +27,27 @@ public class TransMsgResp extends AbstractDeviceBean{
this.ret = ret; this.ret = ret;
} }
public String getRet_info() { public String getRetInfo() {
return ret_info; return retInfo;
} }
public void setRet_info(String ret_info) { public void setRetInfo(String retInfo) {
this.ret_info = ret_info; this.retInfo = retInfo;
} }
public Integer getErrcode() { public Integer getErrCode() {
return errcode; return errCode;
} }
public void setErrcode(Integer errcode) { public void setErrCode(Integer errCode) {
this.errcode = errcode; this.errCode = errCode;
} }
public String getErrmsg() { public String getErrMsg() {
return errmsg; return errMsg;
} }
public void setErrmsg(String errmsg) { public void setErrMsg(String errMsg) {
this.errmsg = errmsg; this.errMsg = errMsg;
} }
} }

View File

@ -1,20 +1,31 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
/** /**
* Created by keungtung on 10/12/2016. * Created by keungtung on 10/12/2016.
*/ */
public class WxDevice { public class WxDevice {
private String id; private String id;
private String mac; private String mac;
private String connect_protocol; @SerializedName("connect_protocol")
private String auth_key; private String connectProtocol;
private String close_strategy; @SerializedName("auth_key")
private String conn_strategy; private String authKey;
private String crypt_method; @SerializedName("close_strategy")
private String auth_ver; private String closeStrategy;
private String manu_mac_pos; @SerializedName("conn_strategy")
private String ser_mac_pos; private String connStrategy;
private String ble_simple_protocol; @SerializedName("crypt_method")
private String cryptMethod;
@SerializedName("auth_ver")
private String authVer;
@SerializedName("manu_mac_pos")
private String manuMacPos;
@SerializedName("ser_mac_pos")
private String serMacPos;
@SerializedName("ble_simple_protocol")
private String bleSimpleProtocol;
public String getId() { public String getId() {
return id; return id;
@ -32,75 +43,75 @@ public class WxDevice {
this.mac = mac; this.mac = mac;
} }
public String getConnect_protocol() { public String getConnectProtocol() {
return connect_protocol; return connectProtocol;
} }
public void setConnect_protocol(String connect_protocol) { public void setConnectProtocol(String connectProtocol) {
this.connect_protocol = connect_protocol; this.connectProtocol = connectProtocol;
} }
public String getAuth_key() { public String getAuthKey() {
return auth_key; return authKey;
} }
public void setAuth_key(String auth_key) { public void setAuthKey(String authKey) {
this.auth_key = auth_key; this.authKey = authKey;
} }
public String getClose_strategy() { public String getCloseStrategy() {
return close_strategy; return closeStrategy;
} }
public void setClose_strategy(String close_strategy) { public void setCloseStrategy(String closeStrategy) {
this.close_strategy = close_strategy; this.closeStrategy = closeStrategy;
} }
public String getConn_strategy() { public String getConnStrategy() {
return conn_strategy; return connStrategy;
} }
public void setConn_strategy(String conn_strategy) { public void setConnStrategy(String connStrategy) {
this.conn_strategy = conn_strategy; this.connStrategy = connStrategy;
} }
public String getCrypt_method() { public String getCryptMethod() {
return crypt_method; return cryptMethod;
} }
public void setCrypt_method(String crypt_method) { public void setCryptMethod(String cryptMethod) {
this.crypt_method = crypt_method; this.cryptMethod = cryptMethod;
} }
public String getAuth_ver() { public String getAuthVer() {
return auth_ver; return authVer;
} }
public void setAuth_ver(String auth_ver) { public void setAuthVer(String authVer) {
this.auth_ver = auth_ver; this.authVer = authVer;
} }
public String getManu_mac_pos() { public String getManuMacPos() {
return manu_mac_pos; return manuMacPos;
} }
public void setManu_mac_pos(String manu_mac_pos) { public void setManuMacPos(String manuMacPos) {
this.manu_mac_pos = manu_mac_pos; this.manuMacPos = manuMacPos;
} }
public String getSer_mac_pos() { public String getSerMacPos() {
return ser_mac_pos; return serMacPos;
} }
public void setSer_mac_pos(String ser_mac_pos) { public void setSerMacPos(String serMacPos) {
this.ser_mac_pos = ser_mac_pos; this.serMacPos = serMacPos;
} }
public String getBle_simple_protocol() { public String getBleSimpleProtocol() {
return ble_simple_protocol; return bleSimpleProtocol;
} }
public void setBle_simple_protocol(String ble_simple_protocol) { public void setBleSimpleProtocol(String bleSimpleProtocol) {
this.ble_simple_protocol = ble_simple_protocol; this.bleSimpleProtocol = bleSimpleProtocol;
} }
} }

View File

@ -1,5 +1,7 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -8,35 +10,38 @@ import java.util.List;
* Created by keungtung on 10/12/2016. * Created by keungtung on 10/12/2016.
*/ */
public class WxDeviceAuthorize extends AbstractDeviceBean { public class WxDeviceAuthorize extends AbstractDeviceBean {
private String deivce_num; @SerializedName("device_num")
private String op_type; private String deviceNum;
private List<WxDevice> device_list = new LinkedList<>(); @SerializedName("op_type")
private String opType;
@SerializedName("device_list")
private List<WxDevice> deviceList = new LinkedList<>();
public String getDeivce_num() { public String getDeviceNum() {
return deivce_num; return deviceNum;
} }
public void setDeivce_num(String deivce_num) { public void setDeviceNum(String deviceNum) {
this.deivce_num = deivce_num; this.deviceNum = deviceNum;
} }
public String getOp_type() { public String getOpType() {
return op_type; return opType;
} }
public void setOp_type(String op_type) { public void setOpType(String opType) {
this.op_type = op_type; this.opType = opType;
} }
public List<WxDevice> getDevice_list() { public List<WxDevice> getDeviceList() {
return device_list; return deviceList;
} }
public void setDevice_list(List<WxDevice> device_list) { public void setDeviceList(List<WxDevice> deviceList) {
this.device_list = device_list; this.deviceList = deviceList;
} }
public void addDevice(WxDevice... devices) { public void addDevice(WxDevice... devices) {
this.device_list.addAll(Arrays.asList(devices)); this.deviceList.addAll(Arrays.asList(devices));
} }
} }

View File

@ -1,12 +1,16 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
/** /**
* Created by keungtung on 10/12/2016. * Created by keungtung on 10/12/2016.
*/ */
public class WxDeviceBind extends AbstractDeviceBean{ public class WxDeviceBind extends AbstractDeviceBean{
private String ticket; private String ticket;
private String device_id; @SerializedName("device_id")
private String openid; private String deviceId;
@SerializedName("openid")
private String openId;
public String getTicket() { public String getTicket() {
return ticket; return ticket;
@ -16,19 +20,19 @@ public class WxDeviceBind extends AbstractDeviceBean{
this.ticket = ticket; this.ticket = ticket;
} }
public String getDevice_id() { public String getDeviceId() {
return device_id; return deviceId;
} }
public void setDevice_id(String device_id) { public void setDeviceId(String deviceId) {
this.device_id = device_id; this.deviceId = deviceId;
} }
public String getOpenid() { public String getOpenId() {
return openid; return openId;
} }
public void setOpenid(String openid) { public void setOpenId(String openId) {
this.openid = openid; this.openId = openId;
} }
} }

View File

@ -1,22 +1,24 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
/** /**
* Created by keungtung on 10/12/2016. * Created by keungtung on 10/12/2016.
*/ */
public class WxDeviceBindResult extends AbstractDeviceBean{ public class WxDeviceBindResult extends AbstractDeviceBean{
private BaseResp base_resp; @SerializedName("base_resp")
private BaseResp baseResp;
public static WxDeviceBindResult fromJson(String json) { public static WxDeviceBindResult fromJson(String json) {
return WxMpGsonBuilder.create().fromJson(json, WxDeviceBindResult.class); return WxMpGsonBuilder.create().fromJson(json, WxDeviceBindResult.class);
} }
public BaseResp getBase_resp() { public BaseResp getBaseResp() {
return base_resp; return baseResp;
} }
public void setBase_resp(BaseResp base_resp) { public void setBaseResp(BaseResp baseResp) {
this.base_resp = base_resp; this.baseResp = baseResp;
} }
} }

View File

@ -1,13 +1,17 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
import me.chanjar.weixin.common.util.ToStringUtils; import me.chanjar.weixin.common.util.ToStringUtils;
/** /**
* Created by keungtung on 10/12/2016. * Created by keungtung on 10/12/2016.
*/ */
public class WxDeviceMsg extends AbstractDeviceBean{ public class WxDeviceMsg extends AbstractDeviceBean{
@SerializedName("device_type")
private String deviceType; private String deviceType;
@SerializedName("device_id")
private String deviceId; private String deviceId;
@SerializedName("open_id")
private String openId; private String openId;
private String content; private String content;

View File

@ -1,49 +1,54 @@
package me.chanjar.weixin.mp.bean.device; package me.chanjar.weixin.mp.bean.device;
import com.google.gson.annotations.SerializedName;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
/** /**
* Created by keungtung on 10/12/2016. * Created by keungtung on 10/12/2016.
*/ */
public class WxDeviceQrCodeResult extends AbstractDeviceBean{ public class WxDeviceQrCodeResult extends AbstractDeviceBean{
private String deviceid; @SerializedName("deviceid")
private String qrticket; private String deviceId;
private String devcielicence; @SerializedName("qrticket")
private RespMsg resp_msg; private String qrTicket;
@SerializedName("devicelicence")
private String deviceLicence;
@SerializedName("resp_msg")
private RespMsg respMsg;
public static WxDeviceQrCodeResult fromJson(String json) { public static WxDeviceQrCodeResult fromJson(String json) {
return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxDeviceQrCodeResult.class); return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxDeviceQrCodeResult.class);
} }
public String getDevcielicence() { public String getDeviceLicence() {
return devcielicence; return deviceLicence;
} }
public void setDevcielicence(String devcielicence) { public void setDeviceLicence(String deviceLicence) {
this.devcielicence = devcielicence; this.deviceLicence = deviceLicence;
} }
public RespMsg getResp_msg() { public RespMsg getRespMsg() {
return resp_msg; return respMsg;
} }
public void setResp_msg(RespMsg resp_msg) { public void setRespMsg(RespMsg respMsg) {
this.resp_msg = resp_msg; this.respMsg = respMsg;
} }
public String getDeviceid() { public String getDeviceId() {
return deviceid; return deviceId;
} }
public void setDeviceid(String deviceid) { public void setDeviceId(String deviceId) {
this.deviceid = deviceid; this.deviceId = deviceId;
} }
public String getQrticket() { public String getQrTicket() {
return qrticket; return qrTicket;
} }
public void setQrticket(String qrticket) { public void setQrTicket(String qrTicket) {
this.qrticket = qrticket; this.qrTicket = qrTicket;
} }
} }