-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat : rewrite with best practices * fix : spotless format * fix : tests and polish code * fix : mapping issues * feat : delombok * fix format issue * Update maven-wrapper.properties
- Loading branch information
1 parent
c4ef459
commit bd960e6
Showing
19 changed files
with
339 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 54 additions & 3 deletions
57
...elcache-sample/src/main/java/com/example/hibernatecache/config/ApplicationProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,72 @@ | ||
package com.example.hibernatecache.config; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.context.properties.NestedConfigurationProperty; | ||
|
||
@Data | ||
@ConfigurationProperties("application") | ||
public class ApplicationProperties { | ||
|
||
@NestedConfigurationProperty private Cors cors = new Cors(); | ||
|
||
@Data | ||
public static class Cors { | ||
private String pathPattern = "/api/**"; | ||
private String allowedMethods = "*"; | ||
private String allowedHeaders = "*"; | ||
private String allowedOriginPatterns = "*"; | ||
private boolean allowCredentials = true; | ||
|
||
public String getPathPattern() { | ||
return pathPattern; | ||
} | ||
|
||
public Cors setPathPattern(String pathPattern) { | ||
this.pathPattern = pathPattern; | ||
return this; | ||
} | ||
|
||
public String getAllowedMethods() { | ||
return allowedMethods; | ||
} | ||
|
||
public Cors setAllowedMethods(String allowedMethods) { | ||
this.allowedMethods = allowedMethods; | ||
return this; | ||
} | ||
|
||
public String getAllowedHeaders() { | ||
return allowedHeaders; | ||
} | ||
|
||
public Cors setAllowedHeaders(String allowedHeaders) { | ||
this.allowedHeaders = allowedHeaders; | ||
return this; | ||
} | ||
|
||
public String getAllowedOriginPatterns() { | ||
return allowedOriginPatterns; | ||
} | ||
|
||
public Cors setAllowedOriginPatterns(String allowedOriginPatterns) { | ||
this.allowedOriginPatterns = allowedOriginPatterns; | ||
return this; | ||
} | ||
|
||
public boolean isAllowCredentials() { | ||
return allowCredentials; | ||
} | ||
|
||
public Cors setAllowCredentials(boolean allowCredentials) { | ||
this.allowCredentials = allowCredentials; | ||
return this; | ||
} | ||
} | ||
|
||
public Cors getCors() { | ||
return cors; | ||
} | ||
|
||
public ApplicationProperties setCors(Cors cors) { | ||
this.cors = cors; | ||
return this; | ||
} | ||
} |
12 changes: 8 additions & 4 deletions
12
...nate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/config/Initializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...ate2ndlevelcache-sample/src/main/java/com/example/hibernatecache/config/WebMvcConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.