模块版本情况
WxJava 模块名: weixin-java-open
WxJava 版本号: 3.9.1.B
详细描述
使用的版本:
com.github.binarywang
weixin-java-open
3.9.1.B
WxMpMenu wxMpMenu = menuService.menuGet();
WxMenuRule rule = wxMpMenu..getConditionalMenu().getRule();
rule.getSex();可以正常取到值
rule.getClientPlatformType();的值永远为空,不管实际有没有值
查看源码:WxMenuRule对象里面的 clientPlatformType字段没有加 @SerializedName注解
日志
微信返回的原始 json:
{"menu":{"button":[{"type":"view","name":"阅读记录","url":"https://c115458.818tu.com/referrals/index/16513543","sub_button":[]},{"type":"view","name":"💕秦枫💕","url":"https://c115458.818tu.com/referrals/index/16513576","sub_button":[]},{"name":"签到送礼","sub_button":[{"type":"view","name":"书城首页","url":"https://c115458.818tu.com/referrals/index/16513635","sub_button":[]},{"type":"view","name":"我要充值","url":"https://c115458.818tu.com/referrals/index/16513652","sub_button":[]},{"type":"view","name":"个人中心","url":"https://c115458.818tu.com/referrals/index/16513714","sub_button":[]},{"type":"view","name":"签到送礼","url":"https://c115458.818tu.com/referrals/index/16513781","sub_button":[]}]}],"menuid":449778320},"conditionalmenu":[{"button":[{"type":"view","name":"阅读记录","url":"https://c115458.818tu.com/referrals/index/16513543","sub_button":[]},{"type":"view","name":"💕秦枫💕","url":"https://c115458.818tu.com/referrals/index/16513576","sub_button":[]},{"name":"签到送礼","sub_button":[{"type":"view","name":"书城首页","url":"https://c115458.818tu.com/referrals/index/16513635","sub_button":[]},{"type":"view","name":"我要看书","url":"https://c115458.818tu.com/referrals/index/16513652","sub_button":[]},{"type":"view","name":"个人中心","url":"https://c115458.818tu.com/referrals/index/16513714","sub_button":[]},{"type":"view","name":"签到送礼","url":"https://c115458.818tu.com/referrals/index/16513781","sub_button":[]}]}],"matchrule":{"client_platform_type":"1"},"menuid":449778326},{"button":[{"type":"view","name":"阅读记录","url":"https://c115458.818tu.com/referrals/index/16513543","sub_button":[]},{"type":"view","name":"💕秦枫💕","url":"https://c115458.818tu.com/referrals/index/16513576","sub_button":[]},{"name":"签到送礼","sub_button":[{"type":"view","name":"书城首页","url":"https://c115458.818tu.com/referrals/index/16513635","sub_button":[]},{"type":"view","name":"我要充值","url":"https://c115458.818tu.com/referrals/index/16513652","sub_button":[]},{"type":"view","name":"个人中心","url":"https://c115458.818tu.com/referrals/index/16513714","sub_button":[]},{"type":"view","name":"签到送礼","url":"https://c115458.818tu.com/referrals/index/16513781","sub_button":[]}]}],"matchrule":{"client_platform_type":"2"},"menuid":449778324}]}
反序列化成 WxMpMenu对象后:
{"menu":{"button":[{"type":"view","name":"阅读记录","url":"https://c115458.818tu.com/referrals/index/16513543","sub_button":[]},{"type":"view","name":"💕秦枫💕","url":"https://c115458.818tu.com/referrals/index/16513576","sub_button":[]},{"name":"签到送礼","sub_button":[{"type":"view","name":"书城首页","url":"https://c115458.818tu.com/referrals/index/16513635","sub_button":[]},{"type":"view","name":"我要充值","url":"https://c115458.818tu.com/referrals/index/16513652","sub_button":[]},{"type":"view","name":"个人中心","url":"https://c115458.818tu.com/referrals/index/16513714","sub_button":[]},{"type":"view","name":"签到送礼","url":"https://c115458.818tu.com/referrals/index/16513781","sub_button":[]}]}],"menuid":"449778320"},"conditionalmenu":[{"button":[{"type":"view","name":"阅读记录","url":"https://c115458.818tu.com/referrals/index/16513543","sub_button":[]},{"type":"view","name":"💕秦枫💕","url":"https://c115458.818tu.com/referrals/index/16513576","sub_button":[]},{"name":"签到送礼","sub_button":[{"type":"view","name":"书城首页","url":"https://c115458.818tu.com/referrals/index/16513635","sub_button":[]},{"type":"view","name":"我要看书","url":"https://c115458.818tu.com/referrals/index/16513652","sub_button":[]},{"type":"view","name":"个人中心","url":"https://c115458.818tu.com/referrals/index/16513714","sub_button":[]},{"type":"view","name":"签到送礼","url":"https://c115458.818tu.com/referrals/index/16513781","sub_button":[]}]}],"matchrule":{},"menuid":"449778326"},{"button":[{"type":"view","name":"阅读记录","url":"https://c115458.818tu.com/referrals/index/16513543","sub_button":[]},{"type":"view","name":"💕秦枫💕","url":"https://c115458.818tu.com/referrals/index/16513576","sub_button":[]},{"name":"签到送礼","sub_button":[{"type":"view","name":"书城首页","url":"https://c115458.818tu.com/referrals/index/16513635","sub_button":[]},{"type":"view","name":"我要充值","url":"https://c115458.818tu.com/referrals/index/16513652","sub_button":[]},{"type":"view","name":"个人中心","url":"https://c115458.818tu.com/referrals/index/16513714","sub_button":[]},{"type":"view","name":"签到送礼","url":"https://c115458.818tu.com/referrals/index/16513781","sub_button":[]}]}],"matchrule":{},"menuid":"449778324"}]}