This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import br.com.smc.meurumo.domain.comercio.entity.Cnae | |
| import org.springframework.data.repository.Repository | |
| /** | |
| * Repositório de {@link Cnae}. | |
| */ | |
| interface CnaeRepository extends Repository<Cnae, Integer> { | |
| /** | |
| * Busca um {@link Cnae} baseado em ID. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import br.com.smc.meurumo.domain.seguranca.entity.TokenResetDeSenha | |
| import org.springframework.data.repository.CrudRepository | |
| interface TokenRepository extends CrudRepository<TokenResetDeSenha, Long> { | |
| TokenResetDeSenha findByHash(String hash) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import br.com.smc.meurumo.domain.seguranca.service.FacebookConnectionSignup | |
| import br.com.smc.meurumo.domain.seguranca.service.FacebookSignInAdapter | |
| import org.slf4j.Logger | |
| import org.slf4j.LoggerFactory | |
| import org.springframework.beans.factory.annotation.Autowired | |
| import org.springframework.context.annotation.Bean | |
| import org.springframework.context.annotation.Configuration | |
| import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder | |
| import org.springframework.security.config.annotation.web.builders.HttpSecurity | |
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import br.com.smc.meurumo.domain.seguranca.repository.UsuarioRepository | |
| import org.slf4j.LoggerFactory | |
| import org.springframework.beans.factory.annotation.Autowired | |
| import org.springframework.security.authentication.AuthenticationProvider | |
| import org.springframework.security.authentication.BadCredentialsException | |
| import org.springframework.security.authentication.UsernamePasswordAuthenticationToken | |
| import org.springframework.security.core.Authentication | |
| import org.springframework.security.core.AuthenticationException | |
| import org.springframework.security.core.authority.SimpleGrantedAuthority | |
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.context.annotation.Bean | |
| import org.springframework.context.annotation.Configuration | |
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder | |
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter | |
| @Configuration | |
| class ConfigWebMvc extends WebMvcConfigurerAdapter { | |
| @Bean | |
| BCryptPasswordEncoder passwordEncoder() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import br.com.smc.meurumo.domain.mailing.service.Mailer | |
| import br.com.smc.meurumo.domain.seguranca.dto.* | |
| import br.com.smc.meurumo.domain.seguranca.entity.Usuario | |
| import br.com.smc.meurumo.domain.seguranca.service.CadastradorPorFormulario | |
| import org.slf4j.Logger | |
| import org.slf4j.LoggerFactory | |
| import org.springframework.beans.factory.annotation.Autowired | |
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder | |
| import org.springframework.stereotype.Controller | |
| import org.springframework.ui.Model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private InsumosDeAnalise obterInsumos(Busca busca) { | |
| final def coordenada = new Coordenada(busca.latitude, busca.longitude) | |
| final def setoresCensitariosSelecionados = geografo.obterSetoresDentroDoRaio(coordenada, config.raioEmKm) | |
| final def cnaesSelecionados = comercial.obterAtividadesComerciais(busca.atividadeId) | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def destinario = config.nossoEmail ?: "[email protected]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bindResult.fieldErrors.each { erro -> | |
| erros.push("${erro.getField()}: ${erro.defaultMessage}") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def novoUsuario = new Usuario( | |
| email: form.email, | |
| nome: form.nome, | |
| senha: protetor.encode(form.senha), | |
| provedor: Provedor.FORM.name(), | |
| ativo: true, | |
| cadastro: new Date() | |
| ) |