File tree 5 files changed +26
-25
lines changed
configuration-property-validation
5 files changed +26
-25
lines changed Original file line number Diff line number Diff line change 1
1
plugins {
2
- id ' java'
3
- id ' org.springframework.boot' version ' 3.2.5'
4
- id ' io.spring.dependency-management' version ' 1.1.4'
2
+ id ' java'
3
+ id ' org.springframework.boot' version ' 3.2.5'
4
+ id ' io.spring.dependency-management' version ' 1.1.4'
5
5
}
6
6
7
7
group = ' com.stacktips'
8
8
version = ' 0.0.1-SNAPSHOT'
9
9
10
10
java {
11
- sourceCompatibility = ' 17'
11
+ sourceCompatibility = ' 17'
12
12
}
13
13
14
14
configurations {
15
- compileOnly {
16
- extendsFrom annotationProcessor
17
- }
15
+ compileOnly {
16
+ extendsFrom annotationProcessor
17
+ }
18
18
}
19
19
20
20
repositories {
21
- mavenCentral()
21
+ mavenCentral()
22
22
}
23
23
24
24
dependencies {
25
- implementation ' org.springframework.boot:spring-boot-starter-web'
26
- compileOnly ' org.projectlombok:lombok'
27
- annotationProcessor ' org.projectlombok:lombok'
28
-
29
- testImplementation ' org.springframework.boot:spring-boot-starter-test'
30
- implementation ' org.springframework.boot:spring-boot-starter-validation:3.2.4'
25
+ implementation ' org.springframework.boot:spring-boot-starter-web'
26
+ implementation ' org.springframework.boot:spring-boot-starter-validation'
27
+ compileOnly ' org.projectlombok:lombok'
28
+ annotationProcessor ' org.projectlombok:lombok'
29
+ testImplementation ' org.springframework.boot:spring-boot-starter-test'
31
30
}
32
31
33
32
tasks. named(' test' ) {
34
- useJUnitPlatform()
33
+ useJUnitPlatform()
35
34
}
Original file line number Diff line number Diff line change 1
1
package com .stacktips .app ;
2
2
3
- import com .stacktips .app .service .ImportService ;
4
- import lombok .AllArgsConstructor ;
3
+ import com .stacktips .app .service .ImporterService ;
5
4
import lombok .RequiredArgsConstructor ;
6
5
import org .springframework .boot .CommandLineRunner ;
7
6
import org .springframework .boot .SpringApplication ;
11
10
@ SpringBootApplication
12
11
public class ConfigurationPropertyValidationApplication implements CommandLineRunner {
13
12
14
- private final ImportService service ;
13
+ private final ImporterService service ;
15
14
16
15
public static void main (String [] args ) {
17
16
SpringApplication .run (ConfigurationPropertyValidationApplication .class , args );
Original file line number Diff line number Diff line change 1
1
package com .stacktips .app .config ;
2
2
3
- import jakarta .validation .constraints .*;
3
+ import jakarta .validation .constraints .Max ;
4
+ import jakarta .validation .constraints .NotEmpty ;
5
+ import jakarta .validation .constraints .Pattern ;
6
+ import jakarta .validation .constraints .Positive ;
4
7
import lombok .Getter ;
5
8
import lombok .Setter ;
6
9
import lombok .ToString ;
16
19
@ ConfigurationProperties (prefix = "importer.service" )
17
20
public class ImporterConfig {
18
21
19
- @ NotNull
22
+ @ NotEmpty
20
23
String filePath ;
21
24
22
- @ NotNull
23
- @ Pattern (regexp = "\\ .csv$|\\ .txt" )
25
+ @ NotEmpty
26
+ @ Pattern (regexp = "\\ .csv$|\\ .txt$ " )
24
27
String fileType ;
25
28
26
29
@ Positive
Original file line number Diff line number Diff line change 8
8
@ Slf4j
9
9
@ Service
10
10
@ RequiredArgsConstructor
11
- public class ImportService {
11
+ public class ImporterService {
12
12
13
13
private final ImporterConfig importerConfig ;
14
14
Original file line number Diff line number Diff line change 5
5
importer :
6
6
service :
7
7
filePath : /nfs/files
8
- fileType : ' .md '
9
- threadPoolSize : 3
8
+ fileType : ' .docx '
9
+ threadPoolSize : 30
You can’t perform that action at this time.
0 commit comments