临时二维码支持字符型
This commit is contained in:
parent
af879a9d32
commit
b92f53aaa7
@ -72,7 +72,7 @@ public class QRParameter implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建临时二维码
|
* 创建临时二维码(场景值为int)
|
||||||
*
|
*
|
||||||
* @param expireSeconds
|
* @param expireSeconds
|
||||||
* 二维码有效时间,以秒为单位。 最大不超过2592000(即30天)
|
* 二维码有效时间,以秒为单位。 最大不超过2592000(即30天)
|
||||||
@ -89,6 +89,25 @@ public class QRParameter implements Serializable {
|
|||||||
return new QRParameter(QRType.QR_SCENE, expireSeconds,
|
return new QRParameter(QRType.QR_SCENE, expireSeconds,
|
||||||
Long.toString(sceneValue), sceneContent);
|
Long.toString(sceneValue), sceneContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建临时二维码(场景值为string)
|
||||||
|
*
|
||||||
|
* @param expireSeconds
|
||||||
|
* 二维码有效时间,以秒为单位。 最大不超过2592000(即30天)
|
||||||
|
* @param sceneValue
|
||||||
|
* 二维码的场景值
|
||||||
|
* @return 二维码参数
|
||||||
|
*/
|
||||||
|
public static QRParameter createTemporaryQR(int expireSeconds,
|
||||||
|
String sceneValue) {
|
||||||
|
JSONObject sceneContent = new JSONObject();
|
||||||
|
JSONObject scene = new JSONObject();
|
||||||
|
scene.put("scene_id", sceneValue);
|
||||||
|
sceneContent.put("scene", scene);
|
||||||
|
return new QRParameter(QRType.QR_STR_SCENE, expireSeconds,
|
||||||
|
sceneValue, sceneContent);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建永久二维码(场景值为int)
|
* 创建永久二维码(场景值为int)
|
||||||
|
|||||||
@ -26,6 +26,10 @@ public enum QRType {
|
|||||||
* 卡券二维码:单个卡券
|
* 卡券二维码:单个卡券
|
||||||
*/
|
*/
|
||||||
QR_CARD,
|
QR_CARD,
|
||||||
|
/**
|
||||||
|
* 临时的字符串参数值
|
||||||
|
*/
|
||||||
|
QR_STR_SCENE,
|
||||||
/**
|
/**
|
||||||
* 卡券二维码:多个卡券
|
* 卡券二维码:多个卡券
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user