parent
bdc29d2c99
commit
71dfb87c33
@ -1,6 +1,9 @@
|
||||
package com.bsd.say.service;
|
||||
|
||||
import com.bsd.say.beans.AjaxRequest;
|
||||
import com.bsd.say.beans.AjaxResult;
|
||||
import com.bsd.say.entities.LoveLetter;
|
||||
|
||||
public interface LoveLetterService extends BaseService<LoveLetter>{
|
||||
AjaxResult createLoveLetter(AjaxRequest ajaxRequest);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.bsd.say.util;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class RandomUtils {
|
||||
|
||||
public static String random(int num){
|
||||
String str="zxcvbnmlkjhgfdsaqwertyuiopQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
|
||||
Random random=new Random();
|
||||
StringBuffer sb=new StringBuffer();
|
||||
for(int i=0; i<num; ++i){
|
||||
//产生0-61的数字
|
||||
int number=random.nextInt(62);
|
||||
//将产生的数字通过length次承载到sb中
|
||||
sb.append(str.charAt(number));
|
||||
}
|
||||
//将承载的字符转换成字符串
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(random(6));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue