Skip to content

Commit

Permalink
#443 在获取会员卡信息中增加balance字段,涉及金额的balance字段改为double类型
Browse files Browse the repository at this point in the history
* 在获取会员卡信息中增加balance字段,涉及金额的balance字段改为double类型

* 同步 修改 GsonAdapter 中相关字段
  • Loading branch information
CodeIdeal authored and binarywang committed Jan 24, 2018
1 parent 2ac2568 commit 905f098
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class WxMpMemberCardActivatedMessage implements Serializable {
* 初始余额,不填为0。
*/
@SerializedName("init_balance")
private Integer initBalance;
private Double initBalance;
/**
* 创建时字段custom_field1定义类型的初始值,限制为4个汉字,12字节。
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public class WxMpMemberCardUpdateMessage implements Serializable {
/**
* 需要设置的余额全量值,传入的数值会直接显示在卡面
*/
private Integer balance;
private Double balance;
/**
* 本次余额变动值,传负数代表减少
*/
@SerializedName("add_balance")
private Integer addBalance;
private Double addBalance;
/**
* 商家自定义金额消耗记录,不超过14个汉字。
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class WxMpMemberCardUpdateResult implements Serializable {

private Integer resultBonus;

private Integer resultBalance;
private Double resultBalance;

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class WxMpMemberCardUserInfoResult implements Serializable {

private Integer bonus;

private Double balance;

private String sex;

private MemberCardUserInfo userInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public WxMpMemberCardUpdateResult deserialize(JsonElement jsonElement, Type type
result.setOpenId(GsonHelper.getString(jsonObject, "openid"));
result.setErrorCode(GsonHelper.getString(jsonObject, "errcode"));
result.setErrorMsg(GsonHelper.getString(jsonObject, "errmsg"));
result.setResultBalance(GsonHelper.getInteger(jsonObject, "result_balance"));
result.setResultBalance(GsonHelper.getDouble(jsonObject, "result_balance"));
result.setResultBonus(GsonHelper.getInteger(jsonObject, "result_bonus"));

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public WxMpMemberCardUserInfoResult deserialize(JsonElement jsonElement, Type ty
result.setNickname(GsonHelper.getString(jsonObject, "nickname"));
result.setMembershipNumber(GsonHelper.getString(jsonObject, "membership_number"));
result.setBonus(GsonHelper.getInteger(jsonObject, "bonus"));
result.setBalance(GsonHelper.getDouble(jsonObject, "balance"));
result.setSex(GsonHelper.getString(jsonObject, "sex"));
result.setUserCardStatus(GsonHelper.getString(jsonObject, "user_card_status"));
result.setHasActive(GsonHelper.getBoolean(jsonObject, "has_active"));
Expand Down

0 comments on commit 905f098

Please sign in to comment.