新增自定义个性化菜单语言信息匹配项
This commit is contained in:
parent
d3150cc936
commit
5d037b2eb6
@ -613,4 +613,6 @@
|
|||||||
|
|
||||||
* 2016-01-20
|
* 2016-01-20
|
||||||
|
|
||||||
+ weixin4j-mp:新增获取模板和删除模板接口
|
+ weixin4j-mp:新增获取模板和删除模板接口
|
||||||
|
|
||||||
|
+ weixin4j-mp:新增自定义个性化菜单语言信息匹配项
|
||||||
@ -202,4 +202,6 @@
|
|||||||
|
|
||||||
* 2016-01-20
|
* 2016-01-20
|
||||||
|
|
||||||
+ 新增获取模板和删除模板接口
|
+ 新增获取模板和删除模板接口
|
||||||
|
|
||||||
|
+ 新增自定义个性化菜单语言信息匹配项
|
||||||
@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.foxinmy.weixin4j.model.Gender;
|
import com.foxinmy.weixin4j.model.Gender;
|
||||||
import com.foxinmy.weixin4j.mp.type.ClientPlatformType;
|
import com.foxinmy.weixin4j.mp.type.ClientPlatformType;
|
||||||
|
import com.foxinmy.weixin4j.mp.type.Lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个性化菜单匹配规则
|
* 个性化菜单匹配规则
|
||||||
@ -62,6 +63,10 @@ public class MenuMatchRule implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private ClientPlatformType platformType;
|
private ClientPlatformType platformType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请使用 {@link #platform(ClientPlatformType platformType)}}
|
||||||
|
* @param platform
|
||||||
|
*/
|
||||||
@JSONField(name = "client_platform_type")
|
@JSONField(name = "client_platform_type")
|
||||||
public void platform0(int platform) {
|
public void platform0(int platform) {
|
||||||
this.platformType = ClientPlatformType.values().length >= platform ? ClientPlatformType
|
this.platformType = ClientPlatformType.values().length >= platform ? ClientPlatformType
|
||||||
@ -133,6 +138,29 @@ public class MenuMatchRule implements Serializable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语言信息,是用户在微信中设置的语言
|
||||||
|
*/
|
||||||
|
private Lang language;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请使用 {@link #language(Lang language)}
|
||||||
|
* @param language
|
||||||
|
*/
|
||||||
|
@JSONField(name = "language")
|
||||||
|
public void language0(int language) {
|
||||||
|
this.language = Lang.values().length >= language ? Lang.values()[language - 1]
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuMatchRule language(Lang language) {
|
||||||
|
if (language != null) {
|
||||||
|
matchRule.put("language", language.ordinal() + 1);
|
||||||
|
}
|
||||||
|
this.language = language;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public ClientPlatformType getPlatformType() {
|
public ClientPlatformType getPlatformType() {
|
||||||
return platformType;
|
return platformType;
|
||||||
}
|
}
|
||||||
@ -157,6 +185,10 @@ public class MenuMatchRule implements Serializable {
|
|||||||
return city;
|
return city;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Lang getLanguage() {
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasRule() {
|
public boolean hasRule() {
|
||||||
return !matchRule.isEmpty();
|
return !matchRule.isEmpty();
|
||||||
}
|
}
|
||||||
@ -169,6 +201,7 @@ public class MenuMatchRule implements Serializable {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return "MenuMatchRule [groupId=" + groupId + ", gender=" + gender
|
return "MenuMatchRule [groupId=" + groupId + ", gender=" + gender
|
||||||
+ ", platformType=" + platformType + ", country=" + country
|
+ ", platformType=" + platformType + ", country=" + country
|
||||||
+ ", province=" + province + ", city=" + city + "]";
|
+ ", province=" + province + ", city=" + city + ", language="
|
||||||
|
+ language + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
package com.foxinmy.weixin4j.mp.type;
|
package com.foxinmy.weixin4j.mp.type;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国家地区语言版本
|
* 国家地区语言版本
|
||||||
|
*
|
||||||
* @className Lang
|
* @className Lang
|
||||||
* @author jy
|
* @author jy
|
||||||
* @date 2014年11月5日
|
* @date 2014年11月5日
|
||||||
@ -10,8 +10,10 @@ package com.foxinmy.weixin4j.mp.type;
|
|||||||
* @see
|
* @see
|
||||||
*/
|
*/
|
||||||
public enum Lang {
|
public enum Lang {
|
||||||
zh_CN("简体"), zh_TW("繁体"), en("英语");
|
zh_CN("简体中文"), zh_TW("繁体中文"), zh_HK("繁体中文"), en("英语"), id("印尼"), ms("马来"), es(
|
||||||
|
"西班牙"), ko("韩国"), it("意大利"), ja("日本"), pl("波兰"), pt("葡萄牙"), ru("俄国"), th(
|
||||||
|
"泰文"), vi("越南"), ar("阿拉伯语"), hi("北印度"), he("希伯来"), tr("土耳其"), de(
|
||||||
|
"德语"), fr("法语");
|
||||||
private String desc;
|
private String desc;
|
||||||
|
|
||||||
Lang(String desc) {
|
Lang(String desc) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user