Compare commits
2 Commits
1.1.0
...
54e2f9dffb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54e2f9dffb | ||
|
|
1a9a158126 |
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
使用方法:
|
使用方法:
|
||||||
|
|
||||||
+ 在项目中放置jar包的地方把seq-1.0.0.jar、seq-1.0.0-sources.jar、seq-1.0.0-pom.xml复制过去
|
+ 在项目中放置jar包的地方把seq-1.1.0.jar、seq-1.1.0-sources.jar、seq-1.1.0-pom.xml复制过去
|
||||||
+ 在pom.xml中增加以下内容,然后执行maven命令:mvn clean
|
+ 在pom.xml中增加以下内容,然后执行maven命令:mvn clean
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- ${project.basedir}表示当前项目的根目录 -->
|
<!-- ${project.basedir}表示当前项目的根目录 -->
|
||||||
<file>${project.basedir}/lib/seq-1.0.0.jar</file>
|
<file>${project.basedir}/lib/seq-1.1.0.jar</file>
|
||||||
<pomFile>${pom.basedir}/lib/seq-1.0.0-pom.xml</pomFile>
|
<pomFile>${pom.basedir}/lib/seq-1.1.0-pom.xml</pomFile>
|
||||||
<sources>${project.basedir}/lib/seq-1.0.0-sources.jar</sources>
|
<sources>${project.basedir}/lib/seq-1.1.0-sources.jar</sources>
|
||||||
<repositoryLayout>default</repositoryLayout>
|
<repositoryLayout>default</repositoryLayout>
|
||||||
<groupId>com.yanghuanglin</groupId>
|
<groupId>com.yanghuanglin</groupId>
|
||||||
<artifactId>seq</artifactId>
|
<artifactId>seq</artifactId>
|
||||||
|
|||||||
@@ -50,6 +50,16 @@ public interface Generator {
|
|||||||
*/
|
*/
|
||||||
String generate(String key, String type, Integer minLength);
|
String generate(String key, String type, Integer minLength);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将{@link #generate(String, String)}得到的序号对象格式化为补零后的序号字符串。实际上只会用到{@link Sequences#getSeq()}属性
|
||||||
|
*
|
||||||
|
* @param sequences 生成的序号对象
|
||||||
|
* @param minLength 序号数字最小长度
|
||||||
|
* @param pattern 格式
|
||||||
|
* @return 格式化后的字符串
|
||||||
|
*/
|
||||||
|
String format(Sequences sequences, Integer minLength, String pattern);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将生成的序号对象格式化为指定格式
|
* 将生成的序号对象格式化为指定格式
|
||||||
* <p/>
|
* <p/>
|
||||||
|
|||||||
@@ -132,6 +132,11 @@ public class SequencesGenerator implements Generator {
|
|||||||
return sequences.format(minLength);
|
return sequences.format(minLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String format(Sequences sequences, Integer minLength, String pattern) {
|
||||||
|
return format(sequences.getSeq(), minLength, pattern);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String format(Long seq, Integer minLength, String pattern) {
|
public String format(Long seq, Integer minLength, String pattern) {
|
||||||
return format(seq, null, minLength, pattern);
|
return format(seq, null, minLength, pattern);
|
||||||
|
|||||||
Reference in New Issue
Block a user