Skip to content

Commit

Permalink
(#7) - model
Browse files Browse the repository at this point in the history
  • Loading branch information
lipeacelino committed Feb 8, 2021
1 parent 62fcbc3 commit 5c9bac4
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ local.properties
.settings/
.loadpath
.recommenders
.classpath
.project

# External tool builders
.externalToolBuilders/
Expand Down Expand Up @@ -207,3 +209,4 @@ hs_err_pid*
*.code-workspace

# End of https://www.toptal.com/developers/gitignore/api/java,intellij,vscode,eclipse
/target/
21 changes: 17 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?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"
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>org.ayty</groupId>
<artifactId>hatcher-api</artifactId>
Expand All @@ -20,7 +21,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.4.2</version>
<version>2.4.2</version>
</dependency>

<dependency>
Expand All @@ -45,7 +46,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
<scope>provided</scope>
<version>1.4.200</version>
</dependency>

Expand Down Expand Up @@ -97,6 +98,18 @@
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>

<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.13.Final</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.ayty.hatcher.api.v1.competence.jpa;

import org.ayty.hatcher.api.v1.competence.model.Competence;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CompetenceRepository extends JpaRepository<Competence, Integer> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.ayty.hatcher.api.v1.competence.model;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

import lombok.Data;

@Data
@Entity
public class Competence {

@Id
private Long id;

@NotEmpty(message="O campo nome não pode estar vazio.")
@Size(min=10, max=200, message="O nome deve ter entre 10 e 200 caracteres.")
private String name;

@NotEmpty(message="O campo descrição não pode estar vazio.")
@Size(min=10, max=1000, message="A descrição deve ter entre 10 e 1000 caracteres.")
private String description;

@Enumerated(EnumType.STRING)
private Type type;

//falta o relacionamento com a entidade Projeto

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.ayty.hatcher.api.v1.competence.model;

public enum Type {

TECHNIC,
SOFT_SKILLS

}

0 comments on commit 5c9bac4

Please sign in to comment.