mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
#292 增加小程序码支持
* 更新小程序二维码(小程序码)接口 修复小程序模板推送读取错误字段导致的NullPoint * 更新小程序二维码(小程序码)接口 修复小程序模板推送读取错误字段导致的NullPoint * 更正WxMaMsgService接口逻辑 * 使用IDEA对miniapp做了批量格式化
This commit is contained in:
@@ -18,6 +18,13 @@ public class WxMaJscode2SessionResult {
|
||||
@SerializedName("openid")
|
||||
private String openid;
|
||||
|
||||
@SerializedName("unionid")
|
||||
private String unionid;
|
||||
|
||||
public static WxMaJscode2SessionResult fromJson(String json) {
|
||||
return WxMaGsonBuilder.create().fromJson(json, WxMaJscode2SessionResult.class);
|
||||
}
|
||||
|
||||
public String getSessionKey() {
|
||||
return sessionKey;
|
||||
}
|
||||
@@ -42,8 +49,12 @@ public class WxMaJscode2SessionResult {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public static WxMaJscode2SessionResult fromJson(String json) {
|
||||
return WxMaGsonBuilder.create().fromJson(json, WxMaJscode2SessionResult.class);
|
||||
public String getUnionid() {
|
||||
return unionid;
|
||||
}
|
||||
|
||||
public void setUnionid(String unionid) {
|
||||
this.unionid = unionid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.io.Serializable;
|
||||
/**
|
||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||
*/
|
||||
public class WxMaQrcode implements Serializable {
|
||||
public class WxMaQrcode extends WxMaQrcodeWrapper implements Serializable {
|
||||
private static final long serialVersionUID = 5777119669111011584L;
|
||||
private String path;
|
||||
private int width = 430;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package cn.binarywang.wx.miniapp.bean;
|
||||
|
||||
import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
|
||||
|
||||
/**
|
||||
* 微信二维码(小程序码)包装器
|
||||
* Created by Element on 2017/7/27.
|
||||
*/
|
||||
public abstract class WxMaQrcodeWrapper {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return WxMaGsonBuilder.create().toJson(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.binarywang.wx.miniapp.bean;
|
||||
|
||||
import cn.binarywang.wx.miniapp.api.WxMaQrcodeService;
|
||||
import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by Element on 2017/7/27.
|
||||
*/
|
||||
public class WxMaWxcode extends WxMaQrcodeWrapper implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1287399621649210322L;
|
||||
private String path;
|
||||
private int width = 430;
|
||||
|
||||
@SerializedName("auto_color")
|
||||
private boolean autoColor = true;
|
||||
|
||||
@SerializedName("line_color")
|
||||
private WxMaQrcodeService.LineColor lineColor = new WxMaQrcodeService.LineColor("0", "0", "0");
|
||||
|
||||
public static WxMaWxcode fromJson(String json) {
|
||||
return WxMaGsonBuilder.create().fromJson(json, WxMaWxcode.class);
|
||||
}
|
||||
|
||||
public static long getSerialVersionUID() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public boolean isAutoColor() {
|
||||
return autoColor;
|
||||
}
|
||||
|
||||
public void setAutoColor(boolean autoColor) {
|
||||
this.autoColor = autoColor;
|
||||
}
|
||||
|
||||
public WxMaQrcodeService.LineColor getLineColor() {
|
||||
return lineColor;
|
||||
}
|
||||
|
||||
public void setLineColor(WxMaQrcodeService.LineColor lineColor) {
|
||||
this.lineColor = lineColor;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.binarywang.wx.miniapp.bean;
|
||||
|
||||
import cn.binarywang.wx.miniapp.api.WxMaQrcodeService;
|
||||
import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by Element on 2017/7/27.
|
||||
*/
|
||||
public class WxMaWxcodeLimit extends WxMaQrcodeWrapper implements Serializable {
|
||||
private static final long serialVersionUID = 4782193774524960401L;
|
||||
private String scene;
|
||||
private String page;
|
||||
|
||||
private int width = 430;
|
||||
|
||||
@SerializedName("auto_color")
|
||||
private boolean autoColor = true;
|
||||
|
||||
@SerializedName("line_color")
|
||||
private WxMaQrcodeService.LineColor lineColor = new WxMaQrcodeService.LineColor("0", "0", "0");
|
||||
|
||||
public static WxMaWxcodeLimit fromJson(String json) {
|
||||
return WxMaGsonBuilder.create().fromJson(json, WxMaWxcodeLimit.class);
|
||||
}
|
||||
|
||||
public String getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(String page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public String getScene() {
|
||||
return scene;
|
||||
}
|
||||
|
||||
public void setScene(String scene) {
|
||||
this.scene = scene;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public boolean isAutoColor() {
|
||||
return autoColor;
|
||||
}
|
||||
|
||||
public void setAutoColor(boolean autoColor) {
|
||||
this.autoColor = autoColor;
|
||||
}
|
||||
|
||||
public WxMaQrcodeService.LineColor getLineColor() {
|
||||
return lineColor;
|
||||
}
|
||||
|
||||
public void setLineColor(WxMaQrcodeService.LineColor lineColor) {
|
||||
this.lineColor = lineColor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user