Add commons-lib
This commit is contained in:
parent
eaf275dd39
commit
fa387f6f40
7 changed files with 45 additions and 4 deletions
16
hd-commons-lib/pom.xml
Normal file
16
hd-commons-lib/pom.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>br.com.rayan</groupId>
|
||||
<artifactId>hd-commons-lib</artifactId>
|
||||
<version>1.0.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
26
hd-commons-lib/src/main/java/models.enums/ProfileEnum.java
Normal file
26
hd-commons-lib/src/main/java/models.enums/ProfileEnum.java
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package main.java.models.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public enum ProfileEnum {
|
||||
ROLE_ADMIN("ROLE_ADMIN"),
|
||||
ROLE_CUSTOMER("ROLE_CUSTOMER"),
|
||||
ROLE_TECHNICIAN("ROLE_TECHNICIAN");
|
||||
|
||||
private final String description;
|
||||
|
||||
ProfileEnum(String string) {
|
||||
this.description = string;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static ProfileEnum toEnum(final String description) {
|
||||
return Arrays.stream(ProfileEnum.values())
|
||||
.filter(profile -> profile.getDescription().equals(description))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new IllegalArgumentException("Invalid description: " + description));
|
||||
}
|
||||
}
|
||||
|
|
@ -8,18 +8,17 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
|
||||
|
||||
// Starter para desenvolvimento de aplicativos web com Spring Boot
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
|
||||
// Starter para configuração do Spring Cloud Config
|
||||
// Starter para configuração do Spring Cloud Config
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-config'
|
||||
|
||||
// Starter para configuração do Spring Cloud
|
||||
// Starter para configuração do Spring Cloud
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
|
||||
|
||||
// Starter para integração com o Eureka Discovery Client
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
||||
// implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
||||
|
||||
// Starter para acesso a dados com o MongoDB
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue