| @@ -1,35 +1,40 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| /** | |||
| * Created by keungtung on 10/12/2016. | |||
| */ | |||
| public class BaseResp extends AbstractDeviceBean{ | |||
| private BaseInfo base_info; | |||
| private Integer errcode; | |||
| private String errmsg; | |||
| public Integer getErrcode() { | |||
| return errcode; | |||
| @SerializedName("base_info") | |||
| private BaseInfo baseInfo; | |||
| @SerializedName("errcode") | |||
| private Integer errCode; | |||
| @SerializedName("errmsg") | |||
| private String errMsg; | |||
| public Integer getErrCode() { | |||
| return errCode; | |||
| } | |||
| public void setErrcode(Integer errcode) { | |||
| this.errcode = errcode; | |||
| public void setErrCode(Integer errCode) { | |||
| this.errCode = errCode; | |||
| } | |||
| public BaseInfo getBase_info() { | |||
| return base_info; | |||
| public BaseInfo getBaseInfo() { | |||
| return baseInfo; | |||
| } | |||
| public void setBase_info(BaseInfo base_info) { | |||
| this.base_info = base_info; | |||
| public void setBaseInfo(BaseInfo baseInfo) { | |||
| this.baseInfo = baseInfo; | |||
| } | |||
| public String getErrmsg() { | |||
| return errmsg; | |||
| public String getErrMsg() { | |||
| return errMsg; | |||
| } | |||
| public void setErrmsg(String errmsg) { | |||
| this.errmsg = errmsg; | |||
| public void setErrMsg(String errMsg) { | |||
| this.errMsg = errMsg; | |||
| } | |||
| private class BaseInfo { | |||
| @@ -1,11 +1,15 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| /** | |||
| * Created by keungtung on 10/12/2016. | |||
| */ | |||
| public class RespMsg extends AbstractDeviceBean{ | |||
| @SerializedName("ret_code") | |||
| private Integer retCode; | |||
| @SerializedName("error_info") | |||
| private String errorInfo; | |||
| public Integer getRetCode() { | |||
| @@ -1,5 +1,6 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| 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{ | |||
| private Integer ret; | |||
| private String ret_info; | |||
| private Integer errcode; | |||
| private String errmsg; | |||
| @SerializedName("ret_info") | |||
| private String retInfo; | |||
| @SerializedName("errcode") | |||
| private Integer errCode; | |||
| @SerializedName("errmsg") | |||
| private String errMsg; | |||
| public static TransMsgResp fromJson(String json) { | |||
| return WxGsonBuilder.create().fromJson(json, TransMsgResp.class); | |||
| @@ -23,27 +27,27 @@ public class TransMsgResp extends AbstractDeviceBean{ | |||
| this.ret = ret; | |||
| } | |||
| public String getRet_info() { | |||
| return ret_info; | |||
| public String getRetInfo() { | |||
| return retInfo; | |||
| } | |||
| public void setRet_info(String ret_info) { | |||
| this.ret_info = ret_info; | |||
| public void setRetInfo(String retInfo) { | |||
| this.retInfo = retInfo; | |||
| } | |||
| public Integer getErrcode() { | |||
| return errcode; | |||
| public Integer getErrCode() { | |||
| return errCode; | |||
| } | |||
| public void setErrcode(Integer errcode) { | |||
| this.errcode = errcode; | |||
| public void setErrCode(Integer errCode) { | |||
| this.errCode = errCode; | |||
| } | |||
| public String getErrmsg() { | |||
| return errmsg; | |||
| public String getErrMsg() { | |||
| return errMsg; | |||
| } | |||
| public void setErrmsg(String errmsg) { | |||
| this.errmsg = errmsg; | |||
| public void setErrMsg(String errMsg) { | |||
| this.errMsg = errMsg; | |||
| } | |||
| } | |||
| @@ -1,20 +1,31 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| /** | |||
| * Created by keungtung on 10/12/2016. | |||
| */ | |||
| public class WxDevice { | |||
| private String id; | |||
| private String mac; | |||
| private String connect_protocol; | |||
| private String auth_key; | |||
| private String close_strategy; | |||
| private String conn_strategy; | |||
| private String crypt_method; | |||
| private String auth_ver; | |||
| private String manu_mac_pos; | |||
| private String ser_mac_pos; | |||
| private String ble_simple_protocol; | |||
| @SerializedName("connect_protocol") | |||
| private String connectProtocol; | |||
| @SerializedName("auth_key") | |||
| private String authKey; | |||
| @SerializedName("close_strategy") | |||
| private String closeStrategy; | |||
| @SerializedName("conn_strategy") | |||
| private String connStrategy; | |||
| @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() { | |||
| return id; | |||
| @@ -32,75 +43,75 @@ public class WxDevice { | |||
| this.mac = mac; | |||
| } | |||
| public String getConnect_protocol() { | |||
| return connect_protocol; | |||
| public String getConnectProtocol() { | |||
| return connectProtocol; | |||
| } | |||
| public void setConnect_protocol(String connect_protocol) { | |||
| this.connect_protocol = connect_protocol; | |||
| public void setConnectProtocol(String connectProtocol) { | |||
| this.connectProtocol = connectProtocol; | |||
| } | |||
| public String getAuth_key() { | |||
| return auth_key; | |||
| public String getAuthKey() { | |||
| return authKey; | |||
| } | |||
| public void setAuth_key(String auth_key) { | |||
| this.auth_key = auth_key; | |||
| public void setAuthKey(String authKey) { | |||
| this.authKey = authKey; | |||
| } | |||
| public String getClose_strategy() { | |||
| return close_strategy; | |||
| public String getCloseStrategy() { | |||
| return closeStrategy; | |||
| } | |||
| public void setClose_strategy(String close_strategy) { | |||
| this.close_strategy = close_strategy; | |||
| public void setCloseStrategy(String closeStrategy) { | |||
| this.closeStrategy = closeStrategy; | |||
| } | |||
| public String getConn_strategy() { | |||
| return conn_strategy; | |||
| public String getConnStrategy() { | |||
| return connStrategy; | |||
| } | |||
| public void setConn_strategy(String conn_strategy) { | |||
| this.conn_strategy = conn_strategy; | |||
| public void setConnStrategy(String connStrategy) { | |||
| this.connStrategy = connStrategy; | |||
| } | |||
| public String getCrypt_method() { | |||
| return crypt_method; | |||
| public String getCryptMethod() { | |||
| return cryptMethod; | |||
| } | |||
| public void setCrypt_method(String crypt_method) { | |||
| this.crypt_method = crypt_method; | |||
| public void setCryptMethod(String cryptMethod) { | |||
| this.cryptMethod = cryptMethod; | |||
| } | |||
| public String getAuth_ver() { | |||
| return auth_ver; | |||
| public String getAuthVer() { | |||
| return authVer; | |||
| } | |||
| public void setAuth_ver(String auth_ver) { | |||
| this.auth_ver = auth_ver; | |||
| public void setAuthVer(String authVer) { | |||
| this.authVer = authVer; | |||
| } | |||
| public String getManu_mac_pos() { | |||
| return manu_mac_pos; | |||
| public String getManuMacPos() { | |||
| return manuMacPos; | |||
| } | |||
| public void setManu_mac_pos(String manu_mac_pos) { | |||
| this.manu_mac_pos = manu_mac_pos; | |||
| public void setManuMacPos(String manuMacPos) { | |||
| this.manuMacPos = manuMacPos; | |||
| } | |||
| public String getSer_mac_pos() { | |||
| return ser_mac_pos; | |||
| public String getSerMacPos() { | |||
| return serMacPos; | |||
| } | |||
| public void setSer_mac_pos(String ser_mac_pos) { | |||
| this.ser_mac_pos = ser_mac_pos; | |||
| public void setSerMacPos(String serMacPos) { | |||
| this.serMacPos = serMacPos; | |||
| } | |||
| public String getBle_simple_protocol() { | |||
| return ble_simple_protocol; | |||
| public String getBleSimpleProtocol() { | |||
| return bleSimpleProtocol; | |||
| } | |||
| public void setBle_simple_protocol(String ble_simple_protocol) { | |||
| this.ble_simple_protocol = ble_simple_protocol; | |||
| public void setBleSimpleProtocol(String bleSimpleProtocol) { | |||
| this.bleSimpleProtocol = bleSimpleProtocol; | |||
| } | |||
| } | |||
| @@ -1,5 +1,7 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| import java.util.Arrays; | |||
| import java.util.LinkedList; | |||
| import java.util.List; | |||
| @@ -8,35 +10,38 @@ import java.util.List; | |||
| * Created by keungtung on 10/12/2016. | |||
| */ | |||
| public class WxDeviceAuthorize extends AbstractDeviceBean { | |||
| private String deivce_num; | |||
| private String op_type; | |||
| private List<WxDevice> device_list = new LinkedList<>(); | |||
| public String getDeivce_num() { | |||
| return deivce_num; | |||
| @SerializedName("device_num") | |||
| private String deviceNum; | |||
| @SerializedName("op_type") | |||
| private String opType; | |||
| @SerializedName("device_list") | |||
| private List<WxDevice> deviceList = new LinkedList<>(); | |||
| public String getDeviceNum() { | |||
| return deviceNum; | |||
| } | |||
| public void setDeivce_num(String deivce_num) { | |||
| this.deivce_num = deivce_num; | |||
| public void setDeviceNum(String deviceNum) { | |||
| this.deviceNum = deviceNum; | |||
| } | |||
| public String getOp_type() { | |||
| return op_type; | |||
| public String getOpType() { | |||
| return opType; | |||
| } | |||
| public void setOp_type(String op_type) { | |||
| this.op_type = op_type; | |||
| public void setOpType(String opType) { | |||
| this.opType = opType; | |||
| } | |||
| public List<WxDevice> getDevice_list() { | |||
| return device_list; | |||
| public List<WxDevice> getDeviceList() { | |||
| return deviceList; | |||
| } | |||
| public void setDevice_list(List<WxDevice> device_list) { | |||
| this.device_list = device_list; | |||
| public void setDeviceList(List<WxDevice> deviceList) { | |||
| this.deviceList = deviceList; | |||
| } | |||
| public void addDevice(WxDevice... devices) { | |||
| this.device_list.addAll(Arrays.asList(devices)); | |||
| this.deviceList.addAll(Arrays.asList(devices)); | |||
| } | |||
| } | |||
| @@ -1,12 +1,16 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| /** | |||
| * Created by keungtung on 10/12/2016. | |||
| */ | |||
| public class WxDeviceBind extends AbstractDeviceBean{ | |||
| private String ticket; | |||
| private String device_id; | |||
| private String openid; | |||
| @SerializedName("device_id") | |||
| private String deviceId; | |||
| @SerializedName("openid") | |||
| private String openId; | |||
| public String getTicket() { | |||
| return ticket; | |||
| @@ -16,19 +20,19 @@ public class WxDeviceBind extends AbstractDeviceBean{ | |||
| this.ticket = ticket; | |||
| } | |||
| public String getDevice_id() { | |||
| return device_id; | |||
| public String getDeviceId() { | |||
| return deviceId; | |||
| } | |||
| public void setDevice_id(String device_id) { | |||
| this.device_id = device_id; | |||
| public void setDeviceId(String deviceId) { | |||
| this.deviceId = deviceId; | |||
| } | |||
| public String getOpenid() { | |||
| return openid; | |||
| public String getOpenId() { | |||
| return openId; | |||
| } | |||
| public void setOpenid(String openid) { | |||
| this.openid = openid; | |||
| public void setOpenId(String openId) { | |||
| this.openId = openId; | |||
| } | |||
| } | |||
| @@ -1,22 +1,24 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; | |||
| /** | |||
| * Created by keungtung on 10/12/2016. | |||
| */ | |||
| public class WxDeviceBindResult extends AbstractDeviceBean{ | |||
| private BaseResp base_resp; | |||
| @SerializedName("base_resp") | |||
| private BaseResp baseResp; | |||
| public static WxDeviceBindResult fromJson(String json) { | |||
| return WxMpGsonBuilder.create().fromJson(json, WxDeviceBindResult.class); | |||
| } | |||
| public BaseResp getBase_resp() { | |||
| return base_resp; | |||
| public BaseResp getBaseResp() { | |||
| return baseResp; | |||
| } | |||
| public void setBase_resp(BaseResp base_resp) { | |||
| this.base_resp = base_resp; | |||
| public void setBaseResp(BaseResp baseResp) { | |||
| this.baseResp = baseResp; | |||
| } | |||
| } | |||
| @@ -1,13 +1,17 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| import me.chanjar.weixin.common.util.ToStringUtils; | |||
| /** | |||
| * Created by keungtung on 10/12/2016. | |||
| */ | |||
| public class WxDeviceMsg extends AbstractDeviceBean{ | |||
| @SerializedName("device_type") | |||
| private String deviceType; | |||
| @SerializedName("device_id") | |||
| private String deviceId; | |||
| @SerializedName("open_id") | |||
| private String openId; | |||
| private String content; | |||
| @@ -1,49 +1,54 @@ | |||
| package me.chanjar.weixin.mp.bean.device; | |||
| import com.google.gson.annotations.SerializedName; | |||
| import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; | |||
| /** | |||
| * Created by keungtung on 10/12/2016. | |||
| */ | |||
| public class WxDeviceQrCodeResult extends AbstractDeviceBean{ | |||
| private String deviceid; | |||
| private String qrticket; | |||
| private String devcielicence; | |||
| private RespMsg resp_msg; | |||
| @SerializedName("deviceid") | |||
| private String deviceId; | |||
| @SerializedName("qrticket") | |||
| private String qrTicket; | |||
| @SerializedName("devicelicence") | |||
| private String deviceLicence; | |||
| @SerializedName("resp_msg") | |||
| private RespMsg respMsg; | |||
| public static WxDeviceQrCodeResult fromJson(String json) { | |||
| return WxMpGsonBuilder.INSTANCE.create().fromJson(json, WxDeviceQrCodeResult.class); | |||
| } | |||
| public String getDevcielicence() { | |||
| return devcielicence; | |||
| public String getDeviceLicence() { | |||
| return deviceLicence; | |||
| } | |||
| public void setDevcielicence(String devcielicence) { | |||
| this.devcielicence = devcielicence; | |||
| public void setDeviceLicence(String deviceLicence) { | |||
| this.deviceLicence = deviceLicence; | |||
| } | |||
| public RespMsg getResp_msg() { | |||
| return resp_msg; | |||
| public RespMsg getRespMsg() { | |||
| return respMsg; | |||
| } | |||
| public void setResp_msg(RespMsg resp_msg) { | |||
| this.resp_msg = resp_msg; | |||
| public void setRespMsg(RespMsg respMsg) { | |||
| this.respMsg = respMsg; | |||
| } | |||
| public String getDeviceid() { | |||
| return deviceid; | |||
| public String getDeviceId() { | |||
| return deviceId; | |||
| } | |||
| public void setDeviceid(String deviceid) { | |||
| this.deviceid = deviceid; | |||
| public void setDeviceId(String deviceId) { | |||
| this.deviceId = deviceId; | |||
| } | |||
| public String getQrticket() { | |||
| return qrticket; | |||
| public String getQrTicket() { | |||
| return qrTicket; | |||
| } | |||
| public void setQrticket(String qrticket) { | |||
| this.qrticket = qrticket; | |||
| public void setQrTicket(String qrTicket) { | |||
| this.qrTicket = qrTicket; | |||
| } | |||
| } | |||