提交 b200bc0c authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 ccb44fc4
package com.zrqx.core.util;
import java.util.UUID;
import com.zrqx.core.exception.BaseException;
public class UUIDUtil {
/**
* 获得指定数目的UUID
*
* @param number
* int 需要获得的UUID数量
* @return String[] UUID数组
*/
public static String[] getUUID(int number) {
if (number < 1) {
return null;
}
String[] retArray = new String[number];
for (int i = 0; i < number; i++) {
retArray[i] = getUUID();
}
return retArray;
}
/**
* 获得一个UUID
*
* @return String UUID
*/
public static String getUUID() {
String uuid = UUID.randomUUID().toString();
// 去掉“-”符号
return uuid.replaceAll("-", "");
}
/**
* 有序生成代号
* @param code
* @return
*/
public static String newCode(String code){
if(code != null){
Integer numCode = Integer.parseInt(code.substring(code.length()-2, code.length()));
numCode+=1;
code = code.substring(0, code.length()-2);
if((numCode+"").length()==2){
return code + "" + numCode;
}else{
return code + "0" + numCode + "";
}
}else{
throw new BaseException("同级子分类 分类编号 为空,无法自动生成分类编号。");
}
}
}
...@@ -3,7 +3,6 @@ package com.zrqx.file.controller; ...@@ -3,7 +3,6 @@ package com.zrqx.file.controller;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.beans.Encoder;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.File; import java.io.File;
import java.io.FileFilter; import java.io.FileFilter;
......
...@@ -3,7 +3,7 @@ server: ...@@ -3,7 +3,7 @@ server:
spring: spring:
cloud: cloud:
config: config:
uri: http://localhost:8688 #配置中心地址 uri: http://localhost:8188 #配置中心地址
name: file name: file
profile: prod profile: prod
label: master label: master
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论