mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-30 12:47:46 +08:00
恢复2.9.4.BETA版本被误修改的代码
This commit is contained in:
parent
48d3163b33
commit
c755c3ec89
@ -7,7 +7,7 @@ import java.io.File;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 二维码相关操作接口
|
||||
* 二维码相关操作接口.
|
||||
*
|
||||
* 接口A(createWxCode)加上接口C(createQrcode),总共生成的码数量限制为100,000,请谨慎调用。
|
||||
*
|
||||
@ -22,9 +22,8 @@ public interface WxMaQrcodeService {
|
||||
String GET_WXACODE_UNLIMIT_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit";
|
||||
|
||||
/**
|
||||
* 接口C
|
||||
* 接口C: 获取小程序页面二维码.
|
||||
* <pre>
|
||||
* 获取小程序页面二维码
|
||||
* 适用于需要的码数量较少的业务场景
|
||||
* 通过该接口,仅能生成已发布的小程序的二维码。
|
||||
* 可以在开发者工具预览时生成开发版的带参二维码。
|
||||
@ -39,8 +38,7 @@ public interface WxMaQrcodeService {
|
||||
File createQrcode(String path) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 接口A
|
||||
* 获取小程序码
|
||||
* 接口A: 获取小程序码.
|
||||
*
|
||||
* @param path 不能为空,最大长度 128 字节
|
||||
* @param width 默认430 二维码的宽度
|
||||
@ -54,14 +52,13 @@ public interface WxMaQrcodeService {
|
||||
File createWxCode(String path) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 接口B
|
||||
* 获取小程序码(永久有效、数量暂无限制)
|
||||
* <p>
|
||||
* 接口B: 获取小程序码(永久有效、数量暂无限制).
|
||||
* <pre>
|
||||
* 通过该接口生成的小程序码,永久有效,数量暂无限制。
|
||||
* 用户扫描该码进入小程序后,将统一打开首页,开发者需在对应页面根据获取的码中 scene 字段的值,再做处理逻辑。
|
||||
* 使用如下代码可以获取到二维码中的 scene 字段的值。
|
||||
* 调试阶段可以使用开发工具的条件编译自定义参数 scene=xxxx 进行模拟,开发工具模拟时的 scene 的参数值需要进行 urlencode
|
||||
*
|
||||
* </pre>
|
||||
* @param scene 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式)
|
||||
* @param page 必须是已经发布的小程序页面,例如 "pages/index/index" ,如果不填写这个字段,默认跳主页面
|
||||
* @param width 默认false 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
|
||||
|
@ -54,10 +54,11 @@ public class WxMaQrcodeServiceImpl implements WxMaQrcodeService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public File createWxCodeLimit(String scene, String path, int width, boolean autoColor, WxMaCodeLineColor lineColor) throws WxErrorException {
|
||||
public File createWxCodeLimit(String scene, String page, int width, boolean autoColor, WxMaCodeLineColor lineColor)
|
||||
throws WxErrorException {
|
||||
WxMaWxcodeLimit wxMaWxcodeLimit = new WxMaWxcodeLimit();
|
||||
wxMaWxcodeLimit.setScene(scene);
|
||||
wxMaWxcodeLimit.setPath(path);
|
||||
wxMaWxcodeLimit.setPage(page);
|
||||
wxMaWxcodeLimit.setWidth(width);
|
||||
wxMaWxcodeLimit.setAutoColor(autoColor);
|
||||
wxMaWxcodeLimit.setLineColor(lineColor);
|
||||
|
@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 小程序码接口B.
|
||||
*
|
||||
* @author Element
|
||||
* @date 2017/7/27
|
||||
@ -17,7 +18,7 @@ import java.io.Serializable;
|
||||
public class WxMaWxcodeLimit extends AbstractWxMaQrcodeWrapper implements Serializable {
|
||||
private static final long serialVersionUID = 4782193774524960401L;
|
||||
private String scene;
|
||||
private String path;
|
||||
private String page;
|
||||
|
||||
private int width = 430;
|
||||
|
||||
@ -31,9 +32,4 @@ public class WxMaWxcodeLimit extends AbstractWxMaQrcodeWrapper implements Serial
|
||||
return WxMaGsonBuilder.create().fromJson(json, WxMaWxcodeLimit.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user