├── .gitignore ├── Implementando a edicao └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── LayoutPadrao.html │ │ ├── Mensagem.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── ajustes-responsivos └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ ├── repository │ │ │ ├── Titulos.java │ │ │ └── filter │ │ │ │ └── TituloFilter.java │ │ │ └── service │ │ │ └── CadastroTituloService.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── cadastrando-novo-titulo └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ └── bootstrap.min.js │ │ └── templates │ │ └── CadastroTitulo.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── camada-de-servico └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ ├── repository │ │ │ └── Titulos.java │ │ │ └── service │ │ │ └── CadastroTituloService.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── componente-tooltip └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── conectando-ao-mysql └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ └── bootstrap.min.js │ │ └── templates │ │ └── CadastroTitulo.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── context-path-no-tomcat-externo └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ ├── repository │ │ │ ├── Titulos.java │ │ │ └── filter │ │ │ │ └── TituloFilter.java │ │ │ └── service │ │ │ └── CadastroTituloService.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── corrigindo-bug-exclusao └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── enviando-dados-para-o-servidor └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ └── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ └── bootstrap.min.js │ │ └── templates │ │ └── CadastroTitulo.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── implementando-a-exclusao └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── implementando-a-pesquisa └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ ├── repository │ │ │ ├── Titulos.java │ │ │ └── filter │ │ │ │ └── TituloFilter.java │ │ │ └── service │ │ │ └── CadastroTituloService.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── listando-os-titulos └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── LayoutPadrao.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── mantendo-valores-no-formulario └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── LayoutPadrao.html │ │ ├── Mensagem.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── mascara-para-entrada-de-valores └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── montando-combo-dinamicamente └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ └── bootstrap.min.js │ │ └── templates │ │ └── CadastroTitulo.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── mostrando-mensagem-sucesso └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ └── bootstrap.min.js │ │ └── templates │ │ └── CadastroTitulo.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── plugin-para-calendario └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── prototipo-da-caixa-de-pesquisa └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ ├── repository │ │ │ └── Titulos.java │ │ │ └── service │ │ │ └── CadastroTituloService.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── prototipo-do-cadastro-de-titulo └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ └── controller │ │ │ └── TituloController.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ └── bootstrap.min.js │ │ └── templates │ │ └── CadastroTitulo.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── prototipo-pesquisa-titulos └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── CadastroTitulo.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── recebendo-titulo-com-ajax-parte-1 └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ ├── repository │ │ │ └── Titulos.java │ │ │ └── service │ │ │ └── CadastroTituloService.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── recebendo-titulo-com-ajax-parte-2 └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ ├── repository │ │ │ └── Titulos.java │ │ │ └── service │ │ │ └── CadastroTituloService.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── status-selecionado-na-edicao └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ ├── repository │ │ │ └── Titulos.java │ │ │ └── service │ │ │ └── CadastroTituloService.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap-datepicker.standalone.min.css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap-datepicker.min.js │ │ │ ├── bootstrap-datepicker.pt-BR.min.js │ │ │ ├── bootstrap.min.js │ │ │ ├── cobranca.js │ │ │ ├── jquery-2.1.4.min.js │ │ │ └── jquery.maskMoney.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── DialogoConfirmacaoExclusao.html │ │ ├── LayoutPadrao.html │ │ ├── MensagemErro.html │ │ ├── MensagemGeral.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java ├── template-com-thymeleaf └── cobranca │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── algaworks │ │ │ └── cobranca │ │ │ ├── CobrancaApplication.java │ │ │ ├── ServletInitializer.java │ │ │ ├── controller │ │ │ └── TituloController.java │ │ │ ├── model │ │ │ ├── StatusTitulo.java │ │ │ └── Titulo.java │ │ │ └── repository │ │ │ └── Titulos.java │ └── resources │ │ ├── application.properties │ │ ├── static │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ └── style.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── images │ │ │ └── logo-algaworks.png │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ └── jquery-2.1.4.min.js │ │ └── templates │ │ ├── Cabecalho.html │ │ ├── CadastroTitulo.html │ │ ├── LayoutPadrao.html │ │ └── PesquisaTitulos.html │ └── test │ └── java │ └── com │ └── algaworks │ └── cobranca │ └── CobrancaApplicationTests.java └── validacao-com-bean-validation └── cobranca ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── algaworks │ │ └── cobranca │ │ ├── CobrancaApplication.java │ │ ├── ServletInitializer.java │ │ ├── controller │ │ └── TituloController.java │ │ ├── model │ │ ├── StatusTitulo.java │ │ └── Titulo.java │ │ └── repository │ │ └── Titulos.java └── resources │ ├── application.properties │ ├── static │ ├── css │ │ ├── bootstrap.min.css │ │ └── style.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── images │ │ └── logo-algaworks.png │ └── js │ │ ├── bootstrap.min.js │ │ └── jquery-2.1.4.min.js │ └── templates │ ├── Cabecalho.html │ ├── CadastroTitulo.html │ ├── LayoutPadrao.html │ ├── Mensagem.html │ └── PesquisaTitulos.html └── test └── java └── com └── algaworks └── cobranca └── CobrancaApplicationTests.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | .DS_Store 3 | Servers/* 4 | .metadata 5 | .settings 6 | .classpath 7 | .project 8 | target/ 9 | bin/ 10 | rebel.xml 11 | .mvn* 12 | mvnw* 13 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/Implementando a edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/Implementando a edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/Implementando a edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/Implementando a edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/Implementando a edicao/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |

Conteúdo principal

17 |
18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/main/resources/templates/Mensagem.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 |
10 |
11 | 12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /Implementando a edicao/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.algaworks.cobranca.model.Titulo; 8 | 9 | public interface Titulos extends JpaRepository { 10 | 11 | public List findByDescricaoContaining(String descricao); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/java/com/algaworks/cobranca/repository/filter/TituloFilter.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository.filter; 2 | 3 | public class TituloFilter { 4 | 5 | private String descricao; 6 | 7 | public String getDescricao() { 8 | return descricao; 9 | } 10 | 11 | public void setDescricao(String descricao) { 12 | this.descricao = descricao; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | /* Tela grande */ 2 | @media (min-width: 768px) { 3 | .panel-default { 4 | margin-left: 10px; 5 | margin-right: 10px; 6 | } 7 | 8 | .alert { 9 | margin-left: 10px; 10 | margin-right: 10px; 11 | } 12 | } 13 | 14 | .navbar-brand { 15 | padding-top: 12px; 16 | } 17 | 18 | .aw-link-panel { 19 | float: right; 20 | padding: 0px; 21 | } 22 | 23 | .aw-titulo-panel { 24 | float: left; 25 | padding-top: 2px; 26 | } -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/ajustes-responsivos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/ajustes-responsivos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/ajustes-responsivos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/ajustes-responsivos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/ajustes-responsivos/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/templates/DialogoConfirmacaoExclusao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 28 | 29 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /ajustes-responsivos/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/java/com/algaworks/cobranca/controller/TituloController.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | 8 | import com.algaworks.cobranca.model.Titulo; 9 | import com.algaworks.cobranca.repository.Titulos; 10 | 11 | @Controller 12 | @RequestMapping("/titulos") 13 | public class TituloController { 14 | 15 | @Autowired 16 | private Titulos titulos; 17 | 18 | @RequestMapping("/novo") 19 | public String novo() { 20 | return "CadastroTitulo"; 21 | } 22 | 23 | @RequestMapping(method = RequestMethod.POST) 24 | public String salvar(Titulo titulo) { 25 | 26 | titulos.save(titulo); 27 | return "CadastroTitulo"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/cadastrando-novo-titulo/cobranca/src/main/resources/application.properties -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/cadastrando-novo-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/cadastrando-novo-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/cadastrando-novo-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/cadastrando-novo-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/cadastrando-novo-titulo/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /cadastrando-novo-titulo/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/java/com/algaworks/cobranca/service/CadastroTituloService.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.dao.DataIntegrityViolationException; 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.algaworks.cobranca.model.Titulo; 8 | import com.algaworks.cobranca.repository.Titulos; 9 | 10 | @Service 11 | public class CadastroTituloService { 12 | 13 | @Autowired 14 | private Titulos titulos; 15 | 16 | public void salvar(Titulo titulo) { 17 | try { 18 | titulos.save(titulo); 19 | } catch (DataIntegrityViolationException e) { 20 | throw new IllegalArgumentException("Formato de data inválido"); 21 | } 22 | } 23 | 24 | public void excluir(Long codigo) { 25 | titulos.delete(codigo); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/camada-de-servico/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/camada-de-servico/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/camada-de-servico/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/camada-de-servico/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/camada-de-servico/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/static/js/cobranca.js: -------------------------------------------------------------------------------- 1 | $('#confirmacaoExclusaoModal').on('show.bs.modal', function(event) { 2 | var button = $(event.relatedTarget); 3 | 4 | var codigoTitulo = button.data('codigo'); 5 | var descricaoTitulo = button.data('descricao'); 6 | 7 | var modal = $(this); 8 | var form = modal.find('form'); 9 | var action = form.data('url-base'); 10 | if (!action.endsWith('/')) { 11 | action += '/'; 12 | } 13 | form.attr('action', action + codigoTitulo); 14 | 15 | modal.find('.modal-body span').html('Tem certeza que deseja excluir o título ' + descricaoTitulo + '?'); 16 | }); 17 | 18 | $(function() { 19 | $('[rel="tooltip"]').tooltip(); 20 | $('.js-currency').maskMoney({decimal: ',', thousands: '.', allowZero: true}); 21 | }); -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/templates/DialogoConfirmacaoExclusao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 28 | 29 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 |

Conteúdo principal

18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /camada-de-servico/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/componente-tooltip/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/componente-tooltip/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/componente-tooltip/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/componente-tooltip/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/componente-tooltip/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/static/js/cobranca.js: -------------------------------------------------------------------------------- 1 | $('#confirmacaoExclusaoModal').on('show.bs.modal', function(event) { 2 | var button = $(event.relatedTarget); 3 | 4 | var codigoTitulo = button.data('codigo'); 5 | var descricaoTitulo = button.data('descricao'); 6 | 7 | var modal = $(this); 8 | var form = modal.find('form'); 9 | var action = form.data('url-base'); 10 | if (!action.endsWith('/')) { 11 | action += '/'; 12 | } 13 | form.attr('action', action + codigoTitulo); 14 | 15 | modal.find('.modal-body span').html('Tem certeza que deseja excluir o título ' + descricaoTitulo + '?'); 16 | }); 17 | 18 | $(function() { 19 | $('[rel="tooltip"]').tooltip(); 20 | }); -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/templates/DialogoConfirmacaoExclusao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 28 | 29 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |

Conteúdo principal

17 |
18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /componente-tooltip/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/conectando-ao-mysql/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/conectando-ao-mysql/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/conectando-ao-mysql/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/conectando-ao-mysql/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/conectando-ao-mysql/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /conectando-ao-mysql/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.algaworks.cobranca.model.Titulo; 8 | 9 | public interface Titulos extends JpaRepository { 10 | 11 | public List findByDescricaoContaining(String descricao); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/java/com/algaworks/cobranca/repository/filter/TituloFilter.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository.filter; 2 | 3 | public class TituloFilter { 4 | 5 | private String descricao; 6 | 7 | public String getDescricao() { 8 | return descricao; 9 | } 10 | 11 | public void setDescricao(String descricao) { 12 | this.descricao = descricao; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/context-path-no-tomcat-externo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/context-path-no-tomcat-externo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/context-path-no-tomcat-externo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/context-path-no-tomcat-externo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/context-path-no-tomcat-externo/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /context-path-no-tomcat-externo/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/corrigindo-bug-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/corrigindo-bug-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/corrigindo-bug-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/corrigindo-bug-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/corrigindo-bug-exclusao/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/static/js/cobranca.js: -------------------------------------------------------------------------------- 1 | $('#confirmacaoExclusaoModal').on('show.bs.modal', function(event) { 2 | var button = $(event.relatedTarget); 3 | 4 | var codigoTitulo = button.data('codigo'); 5 | var descricaoTitulo = button.data('descricao'); 6 | 7 | var modal = $(this); 8 | var form = modal.find('form'); 9 | var action = form.data('url-base'); 10 | if (!action.endsWith('/')) { 11 | action += '/'; 12 | } 13 | form.attr('action', action + codigoTitulo); 14 | 15 | modal.find('.modal-body span').html('Tem certeza que deseja excluir o título ' + descricaoTitulo + '?'); 16 | }); -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/templates/DialogoConfirmacaoExclusao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 28 | 29 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |

Conteúdo principal

17 |
18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /corrigindo-bug-exclusao/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CobrancaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(CobrancaApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/java/com/algaworks/cobranca/controller/TituloController.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | 7 | import com.algaworks.cobranca.model.Titulo; 8 | 9 | @Controller 10 | @RequestMapping("/titulos") 11 | public class TituloController { 12 | 13 | @RequestMapping("/novo") 14 | public String novo() { 15 | return "CadastroTitulo"; 16 | } 17 | 18 | @RequestMapping(method = RequestMethod.POST) 19 | public String salvar(Titulo titulo) { 20 | System.out.println(">>> " + titulo.getDescricao()); 21 | 22 | return "CadastroTitulo"; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/enviando-dados-para-o-servidor/cobranca/src/main/resources/application.properties -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/enviando-dados-para-o-servidor/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/enviando-dados-para-o-servidor/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/enviando-dados-para-o-servidor/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/enviando-dados-para-o-servidor/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/enviando-dados-para-o-servidor/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /enviando-dados-para-o-servidor/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-exclusao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-exclusao/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/static/js/cobranca.js: -------------------------------------------------------------------------------- 1 | $('#confirmacaoExclusaoModal').on('show.bs.modal', function(event) { 2 | var button = $(event.relatedTarget); 3 | 4 | var codigoTitulo = button.data('codigo'); 5 | var descricaoTitulo = button.data('descricao'); 6 | 7 | var modal = $(this); 8 | var form = modal.find('form'); 9 | var action = form.attr('action'); 10 | if (!action.endsWith('/')) { 11 | action += '/'; 12 | } 13 | form.attr('action', action + codigoTitulo); 14 | 15 | modal.find('.modal-body span').html('Tem certeza que deseja excluir o título ' + descricaoTitulo + '?'); 16 | }); -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/templates/DialogoConfirmacaoExclusao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 28 | 29 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |

Conteúdo principal

17 |
18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /implementando-a-exclusao/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.algaworks.cobranca.model.Titulo; 8 | 9 | public interface Titulos extends JpaRepository { 10 | 11 | public List findByDescricaoContaining(String descricao); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/repository/filter/TituloFilter.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository.filter; 2 | 3 | public class TituloFilter { 4 | 5 | private String descricao; 6 | 7 | public String getDescricao() { 8 | return descricao; 9 | } 10 | 11 | public void setDescricao(String descricao) { 12 | this.descricao = descricao; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/implementando-a-pesquisa/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /implementando-a-pesquisa/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/listando-os-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/listando-os-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/listando-os-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/listando-os-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/listando-os-titulos/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |

Conteúdo principal

17 |
18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /listando-os-titulos/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mantendo-valores-no-formulario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mantendo-valores-no-formulario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mantendo-valores-no-formulario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mantendo-valores-no-formulario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mantendo-valores-no-formulario/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |

Conteúdo principal

17 |
18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/main/resources/templates/Mensagem.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 |
10 |
11 | 12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /mantendo-valores-no-formulario/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mascara-para-entrada-de-valores/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mascara-para-entrada-de-valores/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mascara-para-entrada-de-valores/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mascara-para-entrada-de-valores/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mascara-para-entrada-de-valores/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/static/js/cobranca.js: -------------------------------------------------------------------------------- 1 | $('#confirmacaoExclusaoModal').on('show.bs.modal', function(event) { 2 | var button = $(event.relatedTarget); 3 | 4 | var codigoTitulo = button.data('codigo'); 5 | var descricaoTitulo = button.data('descricao'); 6 | 7 | var modal = $(this); 8 | var form = modal.find('form'); 9 | var action = form.data('url-base'); 10 | if (!action.endsWith('/')) { 11 | action += '/'; 12 | } 13 | form.attr('action', action + codigoTitulo); 14 | 15 | modal.find('.modal-body span').html('Tem certeza que deseja excluir o título ' + descricaoTitulo + '?'); 16 | }); 17 | 18 | $(function() { 19 | $('[rel="tooltip"]').tooltip(); 20 | $('.js-currency').maskMoney({decimal: ',', thousands: '.', allowZero: true}); 21 | }); -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /mascara-para-entrada-de-valores/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/montando-combo-dinamicamente/cobranca/src/main/resources/application.properties -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/montando-combo-dinamicamente/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/montando-combo-dinamicamente/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/montando-combo-dinamicamente/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/montando-combo-dinamicamente/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/montando-combo-dinamicamente/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /montando-combo-dinamicamente/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mostrando-mensagem-sucesso/cobranca/src/main/resources/application.properties -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mostrando-mensagem-sucesso/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mostrando-mensagem-sucesso/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mostrando-mensagem-sucesso/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mostrando-mensagem-sucesso/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/mostrando-mensagem-sucesso/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /mostrando-mensagem-sucesso/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/plugin-para-calendario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/plugin-para-calendario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/plugin-para-calendario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/plugin-para-calendario/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/plugin-para-calendario/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/static/js/cobranca.js: -------------------------------------------------------------------------------- 1 | $('#confirmacaoExclusaoModal').on('show.bs.modal', function(event) { 2 | var button = $(event.relatedTarget); 3 | 4 | var codigoTitulo = button.data('codigo'); 5 | var descricaoTitulo = button.data('descricao'); 6 | 7 | var modal = $(this); 8 | var form = modal.find('form'); 9 | var action = form.data('url-base'); 10 | if (!action.endsWith('/')) { 11 | action += '/'; 12 | } 13 | form.attr('action', action + codigoTitulo); 14 | 15 | modal.find('.modal-body span').html('Tem certeza que deseja excluir o título ' + descricaoTitulo + '?'); 16 | }); 17 | 18 | $(function() { 19 | $('[rel="tooltip"]').tooltip(); 20 | }); -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/templates/DialogoConfirmacaoExclusao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 28 | 29 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 |

Conteúdo principal

18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /plugin-para-calendario/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /prototipo-da-caixa-de-pesquisa/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CobrancaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(CobrancaApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/java/com/algaworks/cobranca/controller/TituloController.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class TituloController { 8 | 9 | @RequestMapping("/titulos/novo") 10 | public String novo() { 11 | return "CadastroTitulo"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/application.properties -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-do-cadastro-de-titulo/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /prototipo-do-cadastro-de-titulo/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-pesquisa-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-pesquisa-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-pesquisa-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-pesquisa-titulos/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/prototipo-pesquisa-titulos/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /prototipo-pesquisa-titulos/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/java/com/algaworks/cobranca/service/CadastroTituloService.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.dao.DataIntegrityViolationException; 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.algaworks.cobranca.model.Titulo; 8 | import com.algaworks.cobranca.repository.Titulos; 9 | 10 | @Service 11 | public class CadastroTituloService { 12 | 13 | @Autowired 14 | private Titulos titulos; 15 | 16 | public void salvar(Titulo titulo) { 17 | try { 18 | titulos.save(titulo); 19 | } catch (DataIntegrityViolationException e) { 20 | throw new IllegalArgumentException("Formato de data inválido"); 21 | } 22 | } 23 | 24 | public void excluir(Long codigo) { 25 | titulos.delete(codigo); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/static/js/cobranca.js: -------------------------------------------------------------------------------- 1 | $('#confirmacaoExclusaoModal').on('show.bs.modal', function(event) { 2 | var button = $(event.relatedTarget); 3 | 4 | var codigoTitulo = button.data('codigo'); 5 | var descricaoTitulo = button.data('descricao'); 6 | 7 | var modal = $(this); 8 | var form = modal.find('form'); 9 | var action = form.data('url-base'); 10 | if (!action.endsWith('/')) { 11 | action += '/'; 12 | } 13 | form.attr('action', action + codigoTitulo); 14 | 15 | modal.find('.modal-body span').html('Tem certeza que deseja excluir o título ' + descricaoTitulo + '?'); 16 | }); 17 | 18 | $(function() { 19 | $('[rel="tooltip"]').tooltip(); 20 | $('.js-currency').maskMoney({decimal: ',', thousands: '.', allowZero: true}); 21 | 22 | $('.js-atualizar-status').on('click', function(event) { 23 | event.preventDefault(); 24 | 25 | var botaoReceber = $(event.currentTarget); 26 | var urlReceber = botaoReceber.attr('href'); 27 | 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-1/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /recebendo-titulo-com-ajax-parte-2/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/status-selecionado-na-edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/status-selecionado-na-edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/status-selecionado-na-edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/status-selecionado-na-edicao/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/status-selecionado-na-edicao/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/static/js/bootstrap-datepicker.pt-BR.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/templates/MensagemErro.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/main/resources/templates/MensagemGeral.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 | 10 | -------------------------------------------------------------------------------- /status-selecionado-na-edicao/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/template-com-thymeleaf/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/template-com-thymeleaf/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/template-com-thymeleaf/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/template-com-thymeleaf/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/template-com-thymeleaf/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |

Conteúdo principal

17 |
18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /template-com-thymeleaf/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/java/com/algaworks/cobranca/CobrancaApplication.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import java.util.Locale; 4 | 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.web.servlet.LocaleResolver; 9 | import org.springframework.web.servlet.i18n.FixedLocaleResolver; 10 | 11 | @SpringBootApplication 12 | public class CobrancaApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(CobrancaApplication.class, args); 16 | } 17 | 18 | @Bean 19 | public LocaleResolver localeResolver() { 20 | return new FixedLocaleResolver(new Locale("pt", "BR")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/java/com/algaworks/cobranca/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.context.web.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(CobrancaApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/java/com/algaworks/cobranca/model/StatusTitulo.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.model; 2 | 3 | public enum StatusTitulo { 4 | 5 | PENDENTE("Pendente"), 6 | RECEBIDO("Recebido"); 7 | 8 | private String descricao; 9 | 10 | StatusTitulo(String descricao) { 11 | this.descricao = descricao; 12 | } 13 | 14 | public String getDescricao() { 15 | return descricao; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/java/com/algaworks/cobranca/repository/Titulos.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.algaworks.cobranca.model.Titulo; 6 | 7 | public interface Titulos extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost/cobranca 2 | spring.datasource.username=root 3 | spring.datasource.password=root 4 | 5 | spring.jpa.hibernate.ddl-auto=update 6 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | .navbar-brand { 2 | padding-top: 12px; 3 | } 4 | 5 | .panel-default { 6 | margin-left: 10px; 7 | margin-right: 10px; 8 | } 9 | 10 | .alert { 11 | margin-left: 10px; 12 | margin-right: 10px; 13 | } 14 | 15 | .aw-link-panel { 16 | float: right; 17 | padding: 0px; 18 | } 19 | 20 | .aw-titulo-panel { 21 | float: left; 22 | padding-top: 2px; 23 | } -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/validacao-com-bean-validation/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/validacao-com-bean-validation/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/validacao-com-bean-validation/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/validacao-com-bean-validation/cobranca/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/static/images/logo-algaworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algaworks/workshop-comecando-com-spring-mvc/3d2bd6d4fd0bd9e4b53415d617897bcd7396a32a/validacao-com-bean-validation/cobranca/src/main/resources/static/images/logo-algaworks.png -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/templates/Cabecalho.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/templates/LayoutPadrao.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Cobrança 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 |

Conteúdo principal

17 |
18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/main/resources/templates/Mensagem.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 | Título salvo com sucesso!!! 8 |
9 |
10 |
11 | 12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /validacao-com-bean-validation/cobranca/src/test/java/com/algaworks/cobranca/CobrancaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.algaworks.cobranca; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = CobrancaApplication.class) 11 | @WebAppConfiguration 12 | public class CobrancaApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | --------------------------------------------------------------------------------