mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
小程序二维码接口代码优化
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package cn.binarywang.wx.miniapp.bean;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* lineColor 包装类
|
||||
* 用于描述二维码(小程序码)颜色(RGB参数值),
|
||||
* 详情请查看文档 https://mp.weixin.qq.com/debug/wxadoc/dev/api/qrcode.html
|
||||
* </pre>
|
||||
*/
|
||||
public class WxMaCodeLineColor {
|
||||
private String r = "0", g = "0", b = "0";
|
||||
|
||||
public WxMaCodeLineColor(String r, String g, String b) {
|
||||
this.r = r;
|
||||
this.g = g;
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
public String getR() {
|
||||
return r;
|
||||
}
|
||||
|
||||
public void setR(String r) {
|
||||
this.r = r;
|
||||
}
|
||||
|
||||
public String getG() {
|
||||
return g;
|
||||
}
|
||||
|
||||
public void setG(String g) {
|
||||
this.g = g;
|
||||
}
|
||||
|
||||
public String getB() {
|
||||
return b;
|
||||
}
|
||||
|
||||
public void setB(String b) {
|
||||
this.b = b;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
|
||||
@@ -19,7 +18,7 @@ public class WxMaWxcode extends WxMaQrcodeWrapper implements Serializable {
|
||||
private boolean autoColor = true;
|
||||
|
||||
@SerializedName("line_color")
|
||||
private WxMaQrcodeService.LineColor lineColor = new WxMaQrcodeService.LineColor("0", "0", "0");
|
||||
private WxMaCodeLineColor lineColor = new WxMaCodeLineColor("0", "0", "0");
|
||||
|
||||
public static WxMaWxcode fromJson(String json) {
|
||||
return WxMaGsonBuilder.create().fromJson(json, WxMaWxcode.class);
|
||||
@@ -53,11 +52,11 @@ public class WxMaWxcode extends WxMaQrcodeWrapper implements Serializable {
|
||||
this.autoColor = autoColor;
|
||||
}
|
||||
|
||||
public WxMaQrcodeService.LineColor getLineColor() {
|
||||
public WxMaCodeLineColor getLineColor() {
|
||||
return lineColor;
|
||||
}
|
||||
|
||||
public void setLineColor(WxMaQrcodeService.LineColor lineColor) {
|
||||
public void setLineColor(WxMaCodeLineColor lineColor) {
|
||||
this.lineColor = lineColor;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
|
||||
@@ -20,7 +19,7 @@ public class WxMaWxcodeLimit extends WxMaQrcodeWrapper implements Serializable {
|
||||
private boolean autoColor = true;
|
||||
|
||||
@SerializedName("line_color")
|
||||
private WxMaQrcodeService.LineColor lineColor = new WxMaQrcodeService.LineColor("0", "0", "0");
|
||||
private WxMaCodeLineColor lineColor = new WxMaCodeLineColor("0", "0", "0");
|
||||
|
||||
public static WxMaWxcodeLimit fromJson(String json) {
|
||||
return WxMaGsonBuilder.create().fromJson(json, WxMaWxcodeLimit.class);
|
||||
@@ -58,11 +57,11 @@ public class WxMaWxcodeLimit extends WxMaQrcodeWrapper implements Serializable {
|
||||
this.autoColor = autoColor;
|
||||
}
|
||||
|
||||
public WxMaQrcodeService.LineColor getLineColor() {
|
||||
public WxMaCodeLineColor getLineColor() {
|
||||
return lineColor;
|
||||
}
|
||||
|
||||
public void setLineColor(WxMaQrcodeService.LineColor lineColor) {
|
||||
public void setLineColor(WxMaCodeLineColor lineColor) {
|
||||
this.lineColor = lineColor;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user