Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Tássio Auad tassioauad

🎯
Focusing
Block or report user

Report or block tassioauad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Property.java
public class Property {
private PropertyType type;
public PropertyType getType() {
return type;
}
}
View pom.xml
<?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.tassioauad</groupId>
<artifactId>springbootjersey</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
View JerseyConfig.java
@Configuration
@ApplicationPath("v1")
public class JerseyConfig extends ResourceConfig {
public JerseyConfig() {
}
@PostConstruct
public void setUp() {
register(HelloWorldResource.class);
View HelloWorldResource.java
@Component
@Path("hello")
public class HelloWorldResource {
@GET
@Produces("application/json")
public String hello() {
return "Hello, world";
}
View return.json
{
"_embedded" : {
"persons" : [ ]
},
"_links" : {
"self" : {
"href" : "http://localhost:9000/person{?page,size,sort}",
"templated" : true
},
"profile" : {
View PersonRepository.java
@RepositoryRestResource(path = "person")
public interface PersonRepository extends PagingAndSortingRepository<Person, Long> {
}
View person.java
@Entity
@Table(name = "person")
public class Person {
@Id
@Column(name = "id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "name", nullable = false, length = 100)
private String name;
@tassioauad
tassioauad / application.properties
Created Apr 4, 2018
arquivo de configuração spring boot
View application.properties
server.port= 9000
#-----H2
spring.h2.datasource.url=jdbc:h2:file:~/myh2
spring.h2.datasource.username=sa
spring.h2.datasource.password=
spring.h2.datasource.driver-class-name=org.h2.Driver
spring.jpa.show-sql=true
@tassioauad
tassioauad / pom.xml
Last active Apr 4, 2018
simples pom.xml
View pom.xml
<?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.tassioauad</groupId>
<artifactId>myrest</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
View HTML1.html
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<title>Real Detective</title>
</head>
<body>
<header>
<h1>Real Detective</h1>
</header>
You can’t perform that action at this time.