-
Notifications
You must be signed in to change notification settings - Fork 0
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
150c52b
commit 26f6351
Showing
19 changed files
with
226 additions
and
141 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package br.com.nivlabs.cliniv.config.security; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Bean; | ||
|
@@ -21,9 +22,8 @@ | |
|
||
/** | ||
* Classe SecurityConfig.java | ||
* | ||
* | ||
* @author <a href="mailto:[email protected]">Vinícios Rodrigues</a> | ||
* | ||
* @since 15 de set de 2019 | ||
*/ | ||
@Configuration | ||
|
@@ -41,10 +41,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { | |
private UserRepository userDao; | ||
|
||
private static final String[] PUBLIC_MATCHES = {"/v2/**", | ||
"/webjars/**", | ||
"/swagger-ui/**", | ||
"/api-docs/**", | ||
"/swagger-resources/**"}; | ||
"/webjars/**", | ||
"/swagger-ui/**", | ||
"/api-docs/**", | ||
"/swagger-resources/**"}; | ||
|
||
private static final String[] PUBLIC_MATCHES_GET = {"/server/", "/server", "/actuator/**", "/status", "/dashboard"}; | ||
|
||
|
@@ -73,23 +73,23 @@ protected void configure(HttpSecurity http) throws Exception { | |
|
||
/** | ||
* Configura CORS | ||
* | ||
* | ||
* @return CorsConfigurationSource | ||
*/ | ||
@Bean | ||
public CorsConfigurationSource corsConfigurationSource() { | ||
final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); | ||
CorsConfiguration configCors = new CorsConfiguration().applyPermitDefaultValues(); | ||
configCors.setAllowedMethods(Arrays.asList("POST", "GET", "PUT", "DELETE", "OPTIONS")); | ||
configCors.setAllowedHeaders(Arrays.asList("*")); | ||
configCors.setAllowedOrigins(Arrays.asList("*")); | ||
configCors.setAllowedMethods(List.of("POST", "GET", "PUT", "DELETE", "OPTIONS")); | ||
configCors.setAllowedHeaders(List.of("*")); | ||
configCors.setAllowedOrigins(List.of("*")); | ||
source.registerCorsConfiguration("/**", configCors); | ||
return source; | ||
} | ||
|
||
/** | ||
* Define a estratégia de criptografia da API | ||
* | ||
* | ||
* @return BCryptPasswordEncoder | ||
*/ | ||
@Bean | ||
|
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
18 changes: 18 additions & 0 deletions
18
src/main/java/br/com/nivlabs/cliniv/controller/SupplierController.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package br.com.nivlabs.cliniv.controller; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.ApplicationEventPublisher; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import br.com.nivlabs.cliniv.service.supplier.SupplierService; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
|
||
@Tag(name = "Fornecedor", description = "Endpoint - Operações com Fornecedor") | ||
@RestController | ||
@RequestMapping(value = "/supplier") | ||
public class SupplierController extends BaseController<SupplierService> { | ||
|
||
@Autowired | ||
private ApplicationEventPublisher publisher; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/br/com/nivlabs/cliniv/enums/IntervalType.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package br.com.nivlabs.cliniv.enums; | ||
|
||
/** | ||
* Tipos de intervalos | ||
*/ | ||
public enum IntervalType { | ||
DAILY, | ||
WEEKLY, | ||
MONTHLY, | ||
YEARLY | ||
} |
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.