新增加app支付、邀请码等
This commit is contained in:
@ -34,6 +34,11 @@ public interface ShopConstants {
|
||||
*/
|
||||
String YSHOP_WEIXIN_MINI_PAY_SERVICE = "yshop_weixin_mini_pay_service";
|
||||
|
||||
/**
|
||||
* 微信支付app service
|
||||
*/
|
||||
String YSHOP_WEIXIN_APP_PAY_SERVICE = "yshop_weixin_app_pay_service";
|
||||
|
||||
/**
|
||||
* 微信公众号service
|
||||
*/
|
||||
|
@ -14,6 +14,7 @@ public enum AppFromEnum {
|
||||
WEIXIN_H5("weixinh5","weixinh5"),
|
||||
H5("h5","H5"),
|
||||
WECHAT("wechat","公众号"),
|
||||
APP("app","APP"),
|
||||
ROUNTINE("routine","小程序");
|
||||
|
||||
|
||||
|
@ -8,6 +8,7 @@ import javax.xml.crypto.Data;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @ClassName OrderUtil
|
||||
@ -16,6 +17,30 @@ import java.util.Date;
|
||||
**/
|
||||
public class OrderUtil {
|
||||
|
||||
/**
|
||||
* 生成邀请码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String createShareCode() {
|
||||
int maxNum = 36;
|
||||
int i;
|
||||
int count = 0;
|
||||
char[] str = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
|
||||
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
|
||||
'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
|
||||
StringBuffer pwd = new StringBuffer("");
|
||||
Random r = new Random();
|
||||
while (count < 10) {
|
||||
i = Math.abs(r.nextInt(maxNum));
|
||||
if (i >= 0 && i < str.length) {
|
||||
pwd.append(str[i]);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return pwd.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取俩个数之间的随机数
|
||||
* @param min
|
||||
|
Reference in New Issue
Block a user