Compare commits
14 Commits
970eb892fb
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02fc799149 | ||
|
|
e462d36108 | ||
|
|
088c012862 | ||
|
|
77b6d2cc91 | ||
|
|
5e4360d4fc | ||
|
|
f121b5de53 | ||
|
|
351fb4299b | ||
|
|
83d1c800c7 | ||
|
|
cd20eb30a0 | ||
|
|
8eb297d7ad | ||
|
|
52c4bdf958 | ||
|
|
7c331dfe89 | ||
|
|
9d693d3254 | ||
|
|
75be93a629 |
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.yanghuanglin</groupId>
|
<groupId>com.yanghuanglin</groupId>
|
||||||
<artifactId>seq</artifactId>
|
<artifactId>seq</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.7.2</version>
|
||||||
<name>seq</name>
|
<name>seq</name>
|
||||||
<description>seq</description>
|
<description>seq</description>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -21,12 +21,6 @@
|
|||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>8.0.28</version>
|
<version>8.0.28</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.12</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
BIN
lib/seq-1.7.2-sources.jar
Normal file
BIN
lib/seq-1.7.2-sources.jar
Normal file
Binary file not shown.
BIN
lib/seq-1.7.2.jar
Normal file
BIN
lib/seq-1.7.2.jar
Normal file
Binary file not shown.
10
pom.xml
10
pom.xml
@@ -39,7 +39,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yanghuanglin</groupId>
|
<groupId>com.yanghuanglin</groupId>
|
||||||
<artifactId>seq</artifactId>
|
<artifactId>seq</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.7.2</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@@ -92,13 +92,13 @@
|
|||||||
<goal>install-file</goal>
|
<goal>install-file</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<file>${project.basedir}/lib/seq-1.0.0.jar</file>
|
<file>${project.basedir}/lib/seq-1.7.2.jar</file>
|
||||||
<pomFile>${pom.basedir}/lib/seq-1.0.0-pom.xml</pomFile>
|
<pomFile>${project.basedir}/lib/seq-1.7.2-pom.xml</pomFile>
|
||||||
<sources>${project.basedir}/lib/seq-1.0.0-sources.jar</sources>
|
<sources>${project.basedir}/lib/seq-1.7.2-sources.jar</sources>
|
||||||
<repositoryLayout>default</repositoryLayout>
|
<repositoryLayout>default</repositoryLayout>
|
||||||
<groupId>com.yanghuanglin</groupId>
|
<groupId>com.yanghuanglin</groupId>
|
||||||
<artifactId>seq</artifactId>
|
<artifactId>seq</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.7.2</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<generatePom>true</generatePom>
|
<generatePom>true</generatePom>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.yanghuanglin.seq.generator.Generator;
|
|||||||
import com.yanghuanglin.seq.generator.impl.SequencesGenerator;
|
import com.yanghuanglin.seq.generator.impl.SequencesGenerator;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.DependsOn;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.transaction.support.TransactionTemplate;
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
|
|
||||||
@@ -21,22 +22,27 @@ public class SeqGeneratorConfig {
|
|||||||
@Bean
|
@Bean
|
||||||
public TableConfig tableConfig() {
|
public TableConfig tableConfig() {
|
||||||
TableConfig tableConfig = new TableConfig();
|
TableConfig tableConfig = new TableConfig();
|
||||||
// tableConfig.setTable("sequences");
|
tableConfig.setTable("sequences");
|
||||||
// tableConfig.setKeyColumn("SEQUENCE_KEY");
|
tableConfig.setKeyColumn("SEQUENCE_KEY");
|
||||||
// tableConfig.setTypeColumn("SEQUENCE_TYPE");
|
tableConfig.setTypeColumn("SEQUENCE_TYPE");
|
||||||
// tableConfig.setSeqColumn("SEQUENCE_NEXT_ID");
|
tableConfig.setSeqColumn("CURRENT");
|
||||||
return tableConfig;
|
return tableConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DependsOn("tableConfig")
|
||||||
@Bean
|
@Bean
|
||||||
public GeneratorConfig generatorConfig(TableConfig tableConfig) {
|
public GeneratorConfig generatorConfig(TableConfig tableConfig) {
|
||||||
GeneratorConfig generatorConfig = new GeneratorConfig();
|
GeneratorConfig generatorConfig = new GeneratorConfig();
|
||||||
generatorConfig.setJdbcTemplate(jdbcTemplate);
|
generatorConfig.setJdbcTemplate(jdbcTemplate);
|
||||||
generatorConfig.setTransactionTemplate(transactionTemplate);
|
generatorConfig.setTransactionTemplate(transactionTemplate);
|
||||||
generatorConfig.setTableConfig(tableConfig);
|
generatorConfig.setTableConfig(tableConfig);
|
||||||
|
generatorConfig.setStep(1);
|
||||||
|
generatorConfig.setType("MISSION");
|
||||||
|
generatorConfig.setMinLength(6);
|
||||||
return generatorConfig;
|
return generatorConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DependsOn("generatorConfig")
|
||||||
@Bean
|
@Bean
|
||||||
public Generator generator(GeneratorConfig generatorConfig) {
|
public Generator generator(GeneratorConfig generatorConfig) {
|
||||||
return new SequencesGenerator(generatorConfig);
|
return new SequencesGenerator(generatorConfig);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class Startup implements ApplicationRunner {
|
|||||||
for (int i = 0; i < 200; i++) {
|
for (int i = 0; i < 200; i++) {
|
||||||
threadPoolExecutor.execute(() -> {
|
threadPoolExecutor.execute(() -> {
|
||||||
Sequences sequences = generator.generate("SNT", "MISSION");
|
Sequences sequences = generator.generate("SNT", "MISSION");
|
||||||
String formattedSeq = generator.format(sequences.getSeq(), 5, "处〔#year#〕10801#seq#");
|
String formattedSeq = generator.format(sequences.getSeq(), "处〔#year#〕10801#seq#");
|
||||||
generator.lock(sequences);
|
generator.lock(sequences);
|
||||||
set.add(formattedSeq);
|
set.add(formattedSeq);
|
||||||
System.out.println(formattedSeq);
|
System.out.println(formattedSeq);
|
||||||
|
|||||||
Reference in New Issue
Block a user