Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PotierMarques committed Feb 12, 2022
1 parent ac48c9b commit 17a62b4
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 391 deletions.
76 changes: 74 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
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.6.3</version>
<version>2.6.4-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>br.com</groupId>
Expand All @@ -15,6 +15,7 @@
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<spring-cloud.version>2021.0.1-SNAPSHOT</spring-cloud.version>
</properties>
<dependencies>
<dependency>
Expand All @@ -25,6 +26,30 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.5</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -48,6 +73,17 @@
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
Expand All @@ -57,5 +93,41 @@
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>

</project>
107 changes: 0 additions & 107 deletions src/main/java/br/com/sigaBemApi/DTO/Request/Carga.java
Original file line number Diff line number Diff line change
@@ -1,110 +1,3 @@
package br.com.sigaBemApi.DTO.Request;

import javax.persistence.Entity;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.time.LocalDate;

@Entity
public class Carga {
@javax.persistence.Id
private Long Id;

@NotEmpty(message = "Campo com preenchimento obrigatório!")
@Size(max = 55, message = "Nome deve conter menos de 55 caracteres!")
private String nomeDestinatario;

@NotEmpty(message = "Campo com preenchimento obrigatório!")
@Size(min = 8, max = 8, message = "CEP deve conter 8 digitos!")
private String cepOrigem;

@NotEmpty(message = "Campo com preenchimento obrigatório!")
@Size(min = 8, max = 8, message = "CEP deve conter 8 digitos!")
private String cepDestino;

@NotEmpty(message = "Campo com preenchimento obrigatório!")
@Size(min = 0, message = "Peso deve ser maior que zero!")
public Double peso;

public Double vlTotalFrete;

public LocalDate dataPrevistaEntrega;

public LocalDate dataConsulta;


public Carga() {

}
//
public Carga(String cepOrigem, String cepDestino, LocalDate dataPrevistaEntrega, Double vlTotalFrete) {
this.cepOrigem = cepOrigem;
this.cepDestino = cepDestino;
this.dataPrevistaEntrega = dataPrevistaEntrega;
this.vlTotalFrete = vlTotalFrete;
}

public Long getId() {
return Id;
}

public void setId(Long id) {
Id = id;
}

public String getNomeDestinatario() {
return nomeDestinatario;
}

public void setNomeDestinatario(String nomeDestinatario) {
this.nomeDestinatario = nomeDestinatario;
}

public String getCepOrigem() {
return cepOrigem;
}

public void setCepOrigem(String cepOrigem) {
this.cepOrigem = cepOrigem;
}

public String getCepDestino() {
return cepDestino;
}

public void setCepDestino(String cepDestino) {
this.cepDestino = cepDestino;
}

public Double getPeso() {
return peso;
}

public void setPeso(Double peso) {
this.peso = peso;
}

public Double getVlTotalFrete() {
return vlTotalFrete;
}

public void setVlTotalFrete(Double vlTotalFrete) {
this.vlTotalFrete = vlTotalFrete;
}

public LocalDate getDataPrevistaEntrega() {
return dataPrevistaEntrega;
}

public void setDataPrevistaEntrega(LocalDate dataPrevistaEntrega) {
this.dataPrevistaEntrega = dataPrevistaEntrega;
}

public LocalDate getDataConsulta() {
return dataConsulta;
}

public void setDataConsulta(LocalDate dataConsulta) {
this.dataConsulta = dataConsulta;
}
}
37 changes: 3 additions & 34 deletions src/main/java/br/com/sigaBemApi/DTO/Response/AnaliseResponse.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package br.com.sigaBemApi.DTO.Response;

import br.com.sigaBemApi.entity.DAO.Analise;
import com.fasterxml.jackson.annotation.JsonAutoDetect;

import javax.validation.Valid;
import java.time.LocalDate;

Expand All @@ -11,19 +9,16 @@ public class AnaliseResponse {
/*
ATTRIBUTES
*/

private Long id;
private String cepOrigem;
private String cepDestino;
private LocalDate dataPrevistaEntrega;
private Double vlTotalFrete;
private Long peso;
private String nomeDestinatario;

/*
CONSTRUCTORS
*/

public AnaliseResponse(String id, Long peso, String cepOrigem, String cepDestino, LocalDate dataPrevistaEntrega, Double vlTotalFrete) {
this.id = Long.valueOf(id);
this.cepOrigem = cepOrigem;
Expand All @@ -32,77 +27,51 @@ public AnaliseResponse(String id, Long peso, String cepOrigem, String cepDestino
this.vlTotalFrete = vlTotalFrete;
this.peso = peso;
this.nomeDestinatario = nomeDestinatario;

}
//EDITAR
public AnaliseResponse() {

}


/*
GETTER'S AND SETTER'S
*/

public String getCepOrigem() {
return cepOrigem;
}

public void setCepOrigem(String cepOrigem) {
this.cepOrigem = cepOrigem;
}

public String getCepDestino() {
return cepDestino;
}

public void setCepDestino(String cepDestino) {
this.cepDestino = cepDestino;
}

public LocalDate getDataPrevistaEntrega() {
return dataPrevistaEntrega;
}

public void setDataPrevistaEntrega(LocalDate dataPrevistaEntrega) {
this.dataPrevistaEntrega = dataPrevistaEntrega;
}

this.dataPrevistaEntrega = dataPrevistaEntrega;}
public Double getVlTotalFrete() {
return vlTotalFrete;
}

public Double setVlTotalFrete(Double vlTotalFrete) {
return vlTotalFrete;

}

public AnaliseResponse save(Analise analise) {
// TODO Auto-generated method stub
return null;
}

public Double setVlTotalFrete(Double vlTotalFrete) {return vlTotalFrete;}
public Long getId() {
return id;
}

public void setId(@Valid Long id) {
this.id = id;
}

public Long getPeso() {
return peso;
}

public void setPeso(Long peso) {
this.peso = peso;
}

public String getNomeDestinatario() {
return nomeDestinatario;
}

public void setNomeDestinatario(String nomeDestinatario) {
this.nomeDestinatario = nomeDestinatario;
}
}
}
2 changes: 0 additions & 2 deletions src/main/java/br/com/sigaBemApi/Util/PostalNotFound.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package br.com.sigaBemApi.Util;

@SuppressWarnings("serial")
public class PostalNotFound extends RuntimeException{
public PostalNotFound(String postal) {
super("CEP: "+postal+" inválido");

}
}
Loading

0 comments on commit 17a62b4

Please sign in to comment.