Skip to content

Instantly share code, notes, and snippets.

:octocat:

Tássio Auad tassioauad

:octocat:
View GitHub Profile
View matriz_curricular.html
{% extends 'base.html' %}
{% block body %}
<nav class="navbar navbar-light bg-light">
<span class="navbar-text">
Matriz Curricular
</span>
<select class="custom-select col-md-2" id="periodo-list">
<option selected>Selecione um Período</option>
{% for periodo in periodo_list %}
<option value="{{periodo.get_id()}}">{{periodo.get_nome()}}</option>
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>
You can’t perform that action at this time.