-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 1.优化自定义菜单功能 * 2.新增小程序菜单 Close #1
- Loading branch information
yangqisheng
committed
Aug 9, 2018
1 parent
96a218b
commit e449b34
Showing
17 changed files
with
139 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
|
||
/** | ||
* 自定义菜单组件 | ||
* | ||
* | ||
* @author 杨启盛<[email protected]> | ||
* @since 0.1.0 | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,28 +25,28 @@ | |
* @author 杨启盛<[email protected]> | ||
* @since 0.0.1 | ||
*/ | ||
public abstract class BaseButton { | ||
public class BaseButton { | ||
|
||
/** | ||
* 菜单标题,不超过16个字节,子菜单不超过40个字节 | ||
*/ | ||
private String name; | ||
private final String name; | ||
|
||
/** | ||
* 获取 菜单标题 | ||
* 基础按钮 | ||
* | ||
* @return 菜单标题 | ||
* @param name 菜单标题 | ||
*/ | ||
public String getName() { | ||
return name; | ||
public BaseButton(String name) { | ||
this.name = name; | ||
} | ||
|
||
/** | ||
* 设置 菜单标题 | ||
* 获取 菜单标题 | ||
* | ||
* @param name 菜单标题 | ||
* @return 菜单标题 | ||
*/ | ||
public void setName(String name) { | ||
this.name = name; | ||
public String getName() { | ||
return name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
weixin4j/src/main/java/org/weixin4j/model/menu/MiniprogramButton.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* 微信公众平台(JAVA) SDK | ||
* | ||
* Copyright (c) 2014, Ansitech Network Technology Co.,Ltd All rights reserved. | ||
* | ||
* http://www.weixin4j.org/ | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.weixin4j.model.menu; | ||
|
||
/** | ||
* 打开小程序 | ||
* | ||
* @author 杨启盛<[email protected]> | ||
* @since 0.1.2 | ||
*/ | ||
public class MiniprogramButton extends SingleButton { | ||
|
||
/** | ||
* 小程序的appid(仅认证公众号可配置) | ||
*/ | ||
private String appid; | ||
/** | ||
* 小程序的页面路径 | ||
*/ | ||
private String pagepath; | ||
/** | ||
* 网页 链接,用户点击菜单可打开链接,不超过1024字节。 | ||
* | ||
* 不支持小程序的老版本客户端将打开本url。 | ||
*/ | ||
private String url; | ||
|
||
public MiniprogramButton(String name) { | ||
super(name); | ||
} | ||
|
||
public MiniprogramButton(String name, String appid, String pagepath, String url) { | ||
super(name); | ||
this.appid = appid; | ||
this.pagepath = pagepath; | ||
this.url = url; | ||
} | ||
|
||
public String getAppid() { | ||
return appid; | ||
} | ||
|
||
public void setAppid(String appid) { | ||
this.appid = appid; | ||
} | ||
|
||
public String getPagepath() { | ||
return pagepath; | ||
} | ||
|
||
public void setPagepath(String pagepath) { | ||
this.pagepath = pagepath; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.