小程序二维码接口代码优化

This commit is contained in:
Binary Wang
2017-09-27 11:14:59 +08:00
parent 17a446e372
commit ffcbb2a9eb
5 changed files with 60 additions and 60 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -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;
}
}