Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusPimentel committed Dec 3, 2018
2 parents b6369e6 + ae50dc5 commit 55bb773
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 208 deletions.
177 changes: 66 additions & 111 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@Entity
@Table(name = "anuncio", schema = "public")
public class Anuncio implements Serializable {
public static final long serialVersionUID = 1L;

@Id
@Column(name = "id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@Entity
@Table(name = "endereco", schema = "public")
public class Endereco implements Serializable {
public static final long serialVersionUID = 1L;

@Id
@Column(name = "id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@Entity
@Table(name = "favorito", schema = "public")
public class Favorito implements Serializable {
public static final long serialVersionUID = 1L;

@Id
@Column(name = "id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
@Entity
@Table(name = "imagem", schema = "public")
public class Imagem implements Serializable {
public static final long serialVersionUID = 1L;

@Id
@Column(name = "id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@Entity
@Table(name = "usuario", schema = "public")
public class Usuario implements Serializable {
public static final long serialVersionUID = 1L;

@Id
@Column(name = "id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@Entity
@Table(name = "crashlytics", schema = "public")
public class Crashlytics implements Serializable {
public static final long serialVersionUID = 1L;

@Id
@Column(name = "id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@Entity
@Table(name = "header", schema = "public")
public class Header implements Serializable {
public static final long serialVersionUID = 1L;

@Id
@Column(name = "id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.springframework.validation.BindingResult;

import java.util.List;
import java.util.Locale;

/**
* casa-facil-imoveis
Expand Down Expand Up @@ -74,9 +75,9 @@ public ResponseEntity buscarTodos(Integer id, Integer page, Integer size) {
@Override
public ResponseEntity buscaTodosAutoComplete(String text) {
if (text != null && !text.isEmpty() && text.length() > 2) {
List<String> cidades = enderecoRepository.findCidadesAutoComplete(text.toLowerCase());
List<String> bairros = enderecoRepository.findBairroAutoComplete(text.toLowerCase());
List<String> enderecos = enderecoRepository.findEnderecoAutoComplete(text.toLowerCase());
List<String> cidades = enderecoRepository.findCidadesAutoComplete(text.toLowerCase(Locale.getDefault()));
List<String> bairros = enderecoRepository.findBairroAutoComplete(text.toLowerCase(Locale.getDefault()));
List<String> enderecos = enderecoRepository.findEnderecoAutoComplete(text.toLowerCase(Locale.getDefault()));
return ResponseEntity.ok(SugestaoAutoComplete.criaSugestaoAutoComplete(cidades, bairros, enderecos));
} else return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@Service
public class EmailServiceImpl implements EmailService {

private static Logger LOGGER = LoggerFactory.getLogger(EmailServiceImpl.class);
private static final Logger LOGGER = LoggerFactory.getLogger(EmailServiceImpl.class);

@Autowired
private AnuncioRepository anuncioRepository;
Expand Down Expand Up @@ -84,13 +84,11 @@ public ResponseEntity sendEmailContato(ContatoAnunciante contato, Integer idAnun
try {
mailSender.send(message);
return ResponseEntity.ok().build();
} catch (MailParseException ex) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
} catch (Exception e) {
e.printStackTrace();
if (e instanceof MailParseException) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
} else {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
}
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
}
} else {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
Expand Down
Loading

0 comments on commit 55bb773

Please sign in to comment.