-
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.
- Loading branch information
1 parent
be49cb4
commit aff01a2
Showing
7 changed files
with
123 additions
and
39 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
51 changes: 48 additions & 3 deletions
51
...-boot-jpa-sample/src/main/java/com/example/bootbatchjpa/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,66 @@ | ||
package com.example.bootbatchjpa.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 Cors getCors() { | ||
return cors; | ||
} | ||
|
||
public void setCors(Cors cors) { | ||
this.cors = cors; | ||
} | ||
|
||
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 void setPathPattern(String pathPattern) { | ||
this.pathPattern = pathPattern; | ||
} | ||
|
||
public String getAllowedMethods() { | ||
return allowedMethods; | ||
} | ||
|
||
public void setAllowedMethods(String allowedMethods) { | ||
this.allowedMethods = allowedMethods; | ||
} | ||
|
||
public String getAllowedHeaders() { | ||
return allowedHeaders; | ||
} | ||
|
||
public void setAllowedHeaders(String allowedHeaders) { | ||
this.allowedHeaders = allowedHeaders; | ||
} | ||
|
||
public String getAllowedOriginPatterns() { | ||
return allowedOriginPatterns; | ||
} | ||
|
||
public void setAllowedOriginPatterns(String allowedOriginPatterns) { | ||
this.allowedOriginPatterns = allowedOriginPatterns; | ||
} | ||
|
||
public boolean isAllowCredentials() { | ||
return allowCredentials; | ||
} | ||
|
||
public void setAllowCredentials(boolean allowCredentials) { | ||
this.allowCredentials = allowCredentials; | ||
} | ||
} | ||
} |
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
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