Skip to content

Instantly share code, notes, and snippets.

View rog3r's full-sized avatar

Rogério Oliveira rog3r

View GitHub Profile
@rog3r
rog3r / ProofOfExistence.sol
Created April 10, 2018 19:45 — forked from ageyev/ProofOfExistence.sol
This smartcontract is used to store documents text on the Ethereum blockchain and to get the document by document's hash (sha256).
/*
This smartcontract is used to store documents text on the Ethereum blockchain
and to get the document by document's hash (sha256).
*/
contract ProofOfExistence{
/* ---- Public variables: */
string public created;
# \pom.xml Postgresql
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
# \src\main\resources\application.properties
## Database Properties
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/seu-banco-de-dados
spring.datasource.username=postgres
spring.datasource.password=senha-do-seu-postgres-user
package com.residencia18.springbootmanytomany.entity;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
package com.residencia18.springbootmanytomany.entity;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
package com.residencia18.springbootmanytomany.repository;
import com.residencia18.springbootmanytomany.entity.Employee;
import org.springframework.data.jpa.repository.JpaRepository;
public interface EmployeeRepository extends JpaRepository<Employee, Integer> {
}
package com.residencia18.springbootmanytomany.controller;
import java.util.HashSet;
import java.util.Set;
import com.residencia18.springbootmanytomany.entity.Employee;
import com.residencia18.springbootmanytomany.entity.Project;
import com.residencia18.springbootmanytomany.repository.EmployeeRepository;
import com.residencia18.springbootmanytomany.repository.ProjectRepository;
package com.raven.springbootmanytomany.repository;
import com.raven.springbootmanytomany.entity.Project;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ProjectRepository extends JpaRepository<Project, Integer> {
}
package com.residencia18.springbootmanytomany.controller;
import java.util.HashSet;
import java.util.Set;
import com.residencia18.springbootmanytomany.entity.Employee;
import com.residencia18.springbootmanytomany.entity.Project;
import com.residencia18.springbootmanytomany.repository.EmployeeRepository;
import com.residencia18.springbootmanytomany.repository.ProjectRepository;
Teste de APIs REST
Agora colocaremos essas APIs REST nos controladores de funcionários e projetos para teste.
# Criar funcionário
Para criar um novo funcionário, usaremos a seguinte URL no Postman:
http://localhost:8080/api/employee/createEmployee
# Criar projeto
Para criar um novo projeto, chamamos esta URL no Postman:
http://localhost:8080/api/project/createProject