94 |
95 |
96 |
100 |
101 |
102 |
103 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/ETAPA-02/TemplateCodigosEArquivos-02/resources/templates/vaga/formVaga.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
108 |
109 |
113 |
114 |
115 |
116 |
117 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/ETAPA-02/TemplateCodigosEArquivos-02/resources/templates/vaga/listaVaga.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
107 |
108 |
112 |
113 |
114 |
115 |
116 |
117 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/ETAPA-03/AppRH/AppRH/src/main/resources/templates/funcionario/listaFuncionario.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
64 |
65 |
Lista interna de funcionários
66 |
67 |
68 |
69 |
70 |
71 |
72 | Nome:
73 | Data de nascimento:
74 | E-mail:
75 |
76 | Ação
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | Excluir
88 | Editar
89 |
90 | Adicionar
91 | dependente
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
104 |
105 |
106 |
107 |
108 |
109 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/ETAPA-03/AppRH/AppRH/src/main/resources/templates/funcionario/update-funcionario.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
App RH
11 |
12 |
13 |
14 |
18 |
19 |
20 |
21 |
25 |
26 |
| App RH - UC 12 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
App RH
37 |
39 |
40 |
41 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
114 |
115 |
116 |
117 |
118 |
119 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/ETAPA-03/AppRH/AppRH/src/main/resources/templates/mensagemValidacao.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
| App RH - UC 12 |
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ETAPA-03/AppRH/AppRH/src/main/resources/templates/vaga/formVaga.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
| App RH - UC 12 |
10 |
11 |
12 |
13 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
App RH
28 |
30 |
31 |
32 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
Cadastrar vaga
58 |
59 |
60 |
61 |
62 |
63 |
64 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
117 |
118 |
119 |
120 |
121 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/ETAPA-03/AppRH/AppRH/src/main/resources/templates/vaga/listaVaga.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
| App RH - UC 12 |
11 |
12 |
13 |
14 |
18 |
19 |
20 |
21 |
25 |
26 |
VagasApp
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
App RH
39 |
41 |
42 |
43 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
Lista de vagas cadastradas
67 |
68 |
69 |
70 |
71 |
72 |
73 | Nome da vaga:
74 | Descrição:
75 | Salário:
76 | Expira:
77 |
78 | Ações:
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | R$
88 |
89 | Excluir
91 | Editar
93 | Adicionar candidato
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
106 |
107 |
108 |
109 |
110 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/ETAPA-03/AppRH/AppRH/src/test/java/com/AppRH/AppRH/AppRhApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class AppRhApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/ETAPA-03/TemplateCodigosEArquivos-03/resources/static/bootstrap/css/bootstrap-reboot.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/)
3 | * Copyright 2011-2018 The Bootstrap Authors
4 | * Copyright 2011-2018 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FilosoDev/Spring-Boot-tutorial-AppRh/43ae5345f910fb96f5dca47e4417056bece0d335/ETAPA-04/AppRH/AppRH/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
3 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | org.springframework.boot
8 | spring-boot-starter-parent
9 | 2.6.1
10 |
11 |
12 | com.AppRH
13 | AppRH
14 | 0.0.1-SNAPSHOT
15 | AppRH
16 | Projeto AppRH
17 |
18 | 11
19 |
20 |
21 |
22 | org.springframework.boot
23 | spring-boot-starter-security
24 |
25 |
26 | org.thymeleaf.extras
27 | thymeleaf-extras-springsecurity5
28 |
29 |
30 | org.springframework.boot
31 | spring-boot-starter-test
32 | test
33 |
34 |
35 | org.springframework.security
36 | spring-security-test
37 | test
38 |
39 |
40 |
41 | org.springframework.boot
42 | spring-boot-starter-data-jpa
43 |
44 |
45 | org.springframework.boot
46 | spring-boot-starter-thymeleaf
47 |
48 |
49 | org.springframework.boot
50 | spring-boot-starter-web
51 |
52 |
53 |
54 | org.springframework.boot
55 | spring-boot-devtools
56 | runtime
57 | true
58 |
59 |
60 | org.springframework.boot
61 | spring-boot-starter-test
62 | test
63 |
64 |
65 |
66 | mysql
67 | mysql-connector-java
68 | runtime
69 |
70 |
71 |
72 | org.springframework.boot
73 | spring-boot-starter-validation
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | org.springframework.boot
83 | spring-boot-maven-plugin
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/AppRhApplication.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class AppRhApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(AppRhApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/DataConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH;
2 |
3 | import javax.sql.DataSource;
4 |
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 | import org.springframework.jdbc.datasource.DriverManagerDataSource;
8 | import org.springframework.orm.jpa.JpaVendorAdapter;
9 | import org.springframework.orm.jpa.vendor.Database;
10 | import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
11 |
12 | @Configuration
13 | public class DataConfiguration {
14 |
15 | @Bean
16 | public DataSource dataSource() {
17 | DriverManagerDataSource dataSource = new DriverManagerDataSource();
18 | dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
19 | dataSource.setUrl("jdbc:mysql://localhost:3306/AppRH?useTimezone=true&serverTimezone=UTC");
20 | dataSource.setUsername("root"); // usuário do SEU banco de dados
21 | dataSource.setPassword("admin"); // senha do SEU banco de dados
22 | return dataSource;
23 | }
24 |
25 | @Bean
26 | public JpaVendorAdapter jpaVendorAdapter() {
27 | HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
28 | adapter.setDatabase(Database.MYSQL);
29 | adapter.setShowSql(true); // mostra execução do sql
30 | adapter.setGenerateDdl(true);
31 | adapter.setDatabasePlatform("org.hibernate.dialect.MariaDBDialect");
32 | adapter.setPrepareConnection(true);
33 | return adapter;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/WebConfig.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
6 | import org.springframework.security.config.annotation.web.builders.HttpSecurity;
7 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
8 |
9 | @Configuration
10 | public class WebConfig extends WebSecurityConfigurerAdapter {
11 |
12 | // Método que configura usuários e escopo de atuação no sistema
13 | @Autowired
14 | public void configureGlobal(AuthenticationManagerBuilder builder)throws Exception{
15 |
16 | builder
17 | .inMemoryAuthentication()
18 | .withUser("arthur").password("{noop}arthur").roles("USER")
19 | .and().withUser("root").password("{noop}root").roles("ADMIN");
20 |
21 | }
22 |
23 | // Método que configura quais seções do site podem ser acessadas com e sem login
24 | protected void configure(HttpSecurity http) throws Exception{
25 |
26 | http
27 | .authorizeRequests().antMatchers("/").permitAll()
28 | .antMatchers("/vagas**").permitAll()
29 | .antMatchers("/home**").permitAll().anyRequest()
30 | .authenticated().and().formLogin().permitAll()
31 | .and().logout().permitAll()
32 | .and().csrf().disable();
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/controllers/BuscaController.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.controllers;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.stereotype.Controller;
5 | import org.springframework.web.bind.annotation.RequestAttribute;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RequestMethod;
8 | import org.springframework.web.bind.annotation.RequestParam;
9 | import org.springframework.web.servlet.ModelAndView;
10 |
11 | import com.AppRH.AppRH.models.Candidato;
12 | import com.AppRH.AppRH.models.Dependente;
13 | import com.AppRH.AppRH.models.Funcionario;
14 | import com.AppRH.AppRH.models.Vaga;
15 |
16 | import com.AppRH.AppRH.repository.FuncionarioRepository;
17 | import com.AppRH.AppRH.repository.VagaRepository;
18 | import com.AppRH.AppRH.repository.DependenteRepository;
19 | import com.AppRH.AppRH.repository.CandidatoRepository;
20 |
21 | @Controller
22 | public class BuscaController {
23 |
24 | @Autowired
25 | private FuncionarioRepository fr;
26 |
27 | @Autowired
28 | private VagaRepository vr;
29 |
30 | @Autowired
31 | private DependenteRepository dr;
32 |
33 | @Autowired
34 | private CandidatoRepository cr;
35 |
36 | //GET
37 | @RequestMapping("/")
38 | public ModelAndView abrirIndex() {
39 | ModelAndView mv = new ModelAndView("index");
40 | return mv;
41 | }
42 |
43 | //POST
44 | @RequestMapping(value = "/", method = RequestMethod.POST)
45 | public ModelAndView buscarIndex(@RequestParam("buscar") String buscar, @RequestParam("nome") String nome) {
46 |
47 | ModelAndView mv = new ModelAndView("index");
48 | String mensagem = "Resultados da busca por " + buscar;
49 |
50 | if(nome.equals("nomefuncionario")) {
51 | mv.addObject("funcionarios", fr.findByNomes(buscar));
52 |
53 | }else if(nome.equals("nomedependente")) {
54 | mv.addObject("dependentes", dr.findByNomesDependentes(buscar));
55 |
56 | }else if(nome.equals("nomecandidato")) {
57 | mv.addObject("candidatos", cr.findByNomesCandidatos(buscar));
58 |
59 | }else if(nome.equals("titulovaga")) {
60 | mv.addObject("vagas", vr.findByNomesVaga(buscar));
61 |
62 | }else {
63 | mv.addObject("funcionarios", fr.findByNomes(buscar));
64 | mv.addObject("dependentes", dr.findByNomesDependentes(buscar));
65 | mv.addObject("candidatos", cr.findByNomesCandidatos(buscar));
66 | mv.addObject("vagas", vr.findByNomesVaga(buscar));
67 | }
68 |
69 | mv.addObject("mensagem", mensagem);
70 |
71 | return mv;
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/models/Candidato.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.models;
2 |
3 | import javax.persistence.Column;
4 | import javax.persistence.Entity;
5 | import javax.persistence.GeneratedValue;
6 | import javax.persistence.GenerationType;
7 | import javax.persistence.Id;
8 | import javax.persistence.ManyToOne;
9 | import javax.validation.constraints.NotEmpty;
10 |
11 | @Entity
12 | public class Candidato {
13 |
14 | @Id
15 | @GeneratedValue(strategy = GenerationType.IDENTITY)
16 | private long id;
17 |
18 | @Column(unique = true)
19 | private String rg;
20 |
21 | @NotEmpty
22 | private String nomeCandidato;
23 |
24 | @NotEmpty
25 | private String email;
26 |
27 | @ManyToOne
28 | private Vaga vaga;
29 |
30 | public String getRg() {
31 | return rg;
32 | }
33 |
34 | public void setRg(String rg) {
35 | this.rg = rg;
36 | }
37 |
38 | public String getNomeCandidato() {
39 | return nomeCandidato;
40 | }
41 |
42 | public void setNomeCandidato(String nomeCandidato) {
43 | this.nomeCandidato = nomeCandidato;
44 | }
45 |
46 | public String getEmail() {
47 | return email;
48 | }
49 |
50 | public void setEmail(String email) {
51 | this.email = email;
52 | }
53 |
54 | public Vaga getVaga() {
55 | return vaga;
56 | }
57 |
58 | public void setVaga(Vaga vaga) {
59 | this.vaga = vaga;
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/models/Dependente.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.models;
2 |
3 | import javax.persistence.Id;
4 | import javax.persistence.GeneratedValue;
5 | import javax.persistence.GenerationType;
6 | import javax.persistence.Entity;
7 | import javax.persistence.Column;
8 | import javax.persistence.ManyToOne;
9 |
10 |
11 | @Entity
12 | public class Dependente {
13 |
14 | @Id
15 | @GeneratedValue(strategy = GenerationType.IDENTITY)
16 | private long id;
17 |
18 | @Column(unique = true)
19 | private String cpf;
20 |
21 | private String nome;
22 | private String datanascimento;
23 |
24 | @ManyToOne
25 | private Funcionario funcionario;
26 |
27 | public String getCpf() {
28 | return cpf;
29 | }
30 |
31 | public void setCpf(String cpf) {
32 | this.cpf = cpf;
33 | }
34 |
35 | public String getNome() {
36 | return nome;
37 | }
38 |
39 | public void setNome(String nome) {
40 | this.nome = nome;
41 | }
42 |
43 | public String getDatanascimento() {
44 | return datanascimento;
45 | }
46 |
47 | public void setDatanascimento(String datanascimento) {
48 | this.datanascimento = datanascimento;
49 | }
50 |
51 | public Funcionario getFuncionario() {
52 | return funcionario;
53 | }
54 |
55 | public void setFuncionario(Funcionario funcionario) {
56 | this.funcionario = funcionario;
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/models/Funcionario.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.models;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | import javax.persistence.CascadeType;
7 | import javax.persistence.Entity;
8 | import javax.persistence.GeneratedValue;
9 | import javax.persistence.GenerationType;
10 | import javax.persistence.Id;
11 | import javax.persistence.OneToMany;
12 |
13 |
14 | @Entity
15 | public class Funcionario implements Serializable {
16 |
17 | private static final long serialVersionUID = 1L;
18 |
19 | @Id
20 | @GeneratedValue(strategy = GenerationType.IDENTITY)
21 | private long id;
22 |
23 | private String nome;
24 | private String data;
25 | private String email;
26 |
27 | @OneToMany(mappedBy = "funcionario", cascade = CascadeType.REMOVE)
28 | private List
dependentes;
29 |
30 | public long getId() {
31 | return id;
32 | }
33 |
34 | public void setId(long id) {
35 | this.id = id;
36 | }
37 |
38 | public String getNome() {
39 | return nome;
40 | }
41 |
42 | public void setNome(String nome) {
43 | this.nome = nome;
44 | }
45 |
46 | public String getData() {
47 | return data;
48 | }
49 |
50 | public void setData(String data) {
51 | this.data = data;
52 | }
53 |
54 | public String getEmail() {
55 | return email;
56 | }
57 |
58 | public void setEmail(String email) {
59 | this.email = email;
60 | }
61 |
62 | public List getDependentes() {
63 | return dependentes;
64 | }
65 |
66 | public void setDependentes(List dependentes) {
67 | this.dependentes = dependentes;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/models/Vaga.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.models;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 | import javax.persistence.CascadeType;
6 | import javax.persistence.Entity;
7 | import javax.persistence.GeneratedValue;
8 | import javax.persistence.GenerationType;
9 | import javax.persistence.Id;
10 | import javax.persistence.OneToMany;
11 |
12 | import javax.validation.constraints.NotEmpty;
13 |
14 | @Entity
15 | public class Vaga implements Serializable {
16 |
17 | private static final long serialVersionUID = 1L;
18 |
19 | @Id
20 | @GeneratedValue(strategy = GenerationType.IDENTITY)
21 | private long codigo;
22 |
23 | @NotEmpty
24 | private String nome;
25 |
26 | @NotEmpty
27 | private String descricao;
28 |
29 | @NotEmpty
30 | private String data;
31 |
32 | @NotEmpty
33 | private String salario;
34 |
35 | @OneToMany(mappedBy = "vaga", cascade = CascadeType.REMOVE)
36 | private List candidatos;
37 |
38 | public long getCodigo() {
39 | return codigo;
40 | }
41 |
42 | public void setCodigo(long codigo) {
43 | this.codigo = codigo;
44 | }
45 |
46 | public String getNome() {
47 | return nome;
48 | }
49 |
50 | public void setNome(String nome) {
51 | this.nome = nome;
52 | }
53 |
54 | public String getDescricao() {
55 | return descricao;
56 | }
57 |
58 | public void setDescricao(String descricao) {
59 | this.descricao = descricao;
60 | }
61 |
62 | public String getData() {
63 | return data;
64 | }
65 |
66 | public void setData(String data) {
67 | this.data = data;
68 | }
69 |
70 | public String getSalario() {
71 | return salario;
72 | }
73 |
74 | public void setSalario(String salario) {
75 | this.salario = salario;
76 | }
77 |
78 | public List getCandidatos() {
79 | return candidatos;
80 | }
81 |
82 | public void setCandidatos(List candidatos) {
83 | this.candidatos = candidatos;
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/repository/CandidatoRepository.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.repository;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.data.jpa.repository.Query;
6 | import org.springframework.data.repository.CrudRepository;
7 | import com.AppRH.AppRH.models.Candidato;
8 | import com.AppRH.AppRH.models.Vaga;
9 |
10 | public interface CandidatoRepository extends CrudRepository {
11 |
12 | Iterable findByVaga(Vaga vaga);
13 |
14 | // para deletar pelo RG
15 | Candidato findByRg(String rg);
16 |
17 | Candidato findById(long id);
18 |
19 | // Query para a busca
20 | @Query(value = "select u from Candidato u where u.nomeCandidato like %?1%")
21 | List findByNomesCandidatos(String nomeCandidato);
22 | }
23 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/repository/DependenteRepository.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.repository;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.data.jpa.repository.Query;
6 | import org.springframework.data.repository.CrudRepository;
7 |
8 | import com.AppRH.AppRH.models.Dependente;
9 | import com.AppRH.AppRH.models.Funcionario;
10 |
11 | public interface DependenteRepository extends CrudRepository {
12 |
13 | Iterable findByFuncionario(Funcionario funcionario);
14 |
15 | // para o método delete por CPF
16 | Dependente findByCpf(String cpf);
17 |
18 | Dependente findById(long id);
19 | List findByNome(String nome);
20 |
21 | // Query para a busca
22 | @Query(value = "select u from Dependente u where u.nome like %?1%")
23 | List findByNomesDependentes(String nome);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/repository/FuncionarioRepository.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.repository;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.data.jpa.repository.Query;
6 | import org.springframework.data.repository.CrudRepository;
7 |
8 | import com.AppRH.AppRH.models.Funcionario;
9 |
10 | public interface FuncionarioRepository extends CrudRepository{
11 |
12 | Funcionario findById(long id);
13 | Funcionario findByNome(String nome);
14 |
15 | // Query para a busca
16 | @Query(value = "select u from Funcionario u where u.nome like %?1%")
17 | ListfindByNomes(String nome);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/java/com/AppRH/AppRH/repository/VagaRepository.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH.repository;
2 |
3 | import java.util.List;
4 | import org.springframework.data.jpa.repository.Query;
5 | import org.springframework.data.repository.CrudRepository;
6 |
7 | import com.AppRH.AppRH.models.Vaga;
8 |
9 | public interface VagaRepository extends CrudRepository {
10 | Vaga findByCodigo(long codigo);
11 |
12 | List findByNome(String nome);
13 |
14 | // Query para a busca
15 | @Query(value = "select u from Vaga u where u.nome like %?1%")
16 | List findByNomesVaga(String nome);
17 | }
18 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 |
2 | spring.datasource.url=jdbc:mysql://localhost:3306/apprh
3 | spring.datasource.username=root
4 | spring.datasource.password=admin
5 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
6 | spring.jpa.database-platform = org.hibernate.dialect.MariaDBDialect
7 | spring.jpa.generate-ddl=true
8 | spring.jpa.hibernate.ddl-auto = update
9 |
10 | #spring.security.user.name=admin
11 | #spring.security.user.password=admin
12 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/resources/static/bootstrap/css/bootstrap-reboot.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/)
3 | * Copyright 2011-2018 The Bootstrap Authors
4 | * Copyright 2011-2018 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/resources/templates/funcionario/form-funcionario.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | | App RH - UC 12 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
App RH
36 |
40 |
41 |
42 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
Cadastro de Funcionário
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | Nome:
79 | * Nome completo.
80 |
81 |
82 |
83 |
84 |
85 |
86 | Data de nascimento:
88 | * Dia/Mês/Ano.
89 |
90 |
91 |
92 | E-mail:
95 |
96 |
97 |
98 | Adicionar
99 | Funcionário
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
118 |
119 |
120 |
121 |
122 |
123 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/main/resources/templates/mensagem-validacao.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
| App RH - UC 12 |
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ETAPA-04/AppRH/AppRH/src/test/java/com/AppRH/AppRH/AppRhApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.AppRH.AppRH;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class AppRhApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/ETAPA-04/Tutorial Seguranca de Spring Security.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FilosoDev/Spring-Boot-tutorial-AppRh/43ae5345f910fb96f5dca47e4417056bece0d335/ETAPA-04/Tutorial Seguranca de Spring Security.docx
--------------------------------------------------------------------------------
/ETAPA-04/dados_funcionarios_vagas.sql:
--------------------------------------------------------------------------------
1 | USE apprh;
2 |
3 | -- INSERÇÃO DE VAGAS
4 | INSERT INTO `vaga` VALUES
5 | (1,'2021-11-13','Profissional que tenha atuação FullStack em programação com a linguagem C .NET, Banco de Dados SQL Server, Arquitetura MVC e Microserviços (WebAPIs). Vivência com Front end e Back end. Experiência com .NET Core, metodologia Ágil Scrum, WEB Forms.','Programador - Desenvolvedor C# Net','12000'),
6 | (2,'2021-12-11','Sólida experiência com DevOps; Experiência em soluções e arquitetura Cloud, AWS, Kubernetes, Docker, Banco de Dados, Jenkins; Conhecimento em estratégias e técnicas de monitoramento; Experiência com padrões de arquitetura: SOA, MVC etc.','Analista Devops','5000'),
7 | (3,'2021-12-11','Net Core, Vue.js/React/Angular.','Desenvolvedor FullStack Pleno/Sênior','9000'),
8 | (4,'2022-12-11','Área e especialização profissional: Informática, TI, Telecomunicações - Montagem e Manutenção de Micros. Teste, manutenção e montagem de servidores, switches, blade server, storage, roteadores.','Técnico De Hardware - Montagem E Manutenção','5000'),
9 | (5,'2022-12-04','Tomar a frente das equipes de TI, Operações e Marketing da empresa.\r\nElaborar projetos e campanhas, afim de atender as metas e indicadores.','Gerente De Ecommerce','9000'),
10 | (6,'2022-11-26','Apoiar no desenvolvimento de sites, hotsites, desenvolvimento de identidade visual de sistemas, atuar na criação de artes para empresas, tratamento de imagem, criação de logotipo, editoração, ilustração, folder, web, desenvolver anúncios etc.','Estagiário de Web Design','7000'),
11 | (7,'2022-12-10','Realizar o desenvolvimento em ADVPL, TOTVS DevStudio e demais ferramentas da plataforma; SQL Server e linguagem SQL. ','Analista Desenvolvedor Protheus','8000'),
12 | (8,'2022-11-27','ASP.NET Developer / Research + Development at BD. We are looking for outstanding ASP.NET Developers to join BD Research & Development Team (R&D).','Asp.Net Developer / Research + Development - Remote Work ','7000'),
13 | (9,'2022-11-27','Organizar as informações, criar diretórios e subdiretórios, cuidar da segurança dos arquivos, gerenciar as licenças e determinar quem tem acesso a cada tipo de arquivo e fazer backup do servidor.','Administrador de banco de dados','5000'),
14 | (10,'2022-11-27','Mobile NativeScript Developer Senior at BD.','Mobile Nativescript Developer Senior - Remote Work ','9000'),
15 | (11,'2022-11-27','Gerenciar toda a área TI da empresa, que está subdividida em três partes: sistemas; infraestrutura e segurança.','Gerente de TI','9000');
16 |
17 | -- INSERÇÃO DE FUNCIONÁRIOS
18 | INSERT INTO `funcionario` VALUES
19 | (1,'1955-10-28','bill@microsoft.com','William Henry Gates III'),
20 | (2,'1815-12-10','ada@ada.language.com','Ada Lovelace'),
21 | (3,'1969-12-28','torvalds@osdl.org','Linus Torvalds'),
22 | (4,'1906-12-09','grace.hopper@cobol.com','Grace Hopper'),
23 | (5,'1953-03-16','rms@gnu.org','Richard Stallman'),
24 | (6,'1955-01-01','carol@atari.games.com','Carol Shaw'),
25 | (7,'1950-08-11','teamwoz@woz.org','Steve Wozniak'),
26 | (8,'1932-08-04','f.allen@parallel.computing.com','Frances Allen'),
27 | (9,'1955-05-19','jamesgosling@gmail.com','James Gosling'),
28 | (10,'1977-06-16','larry.ellison@oracle.com','Larry Ellison'),
29 | (11,'1961-07-04','brendan@mozilla.com','Brendan Eich'),
30 | (12,'1918-08-26','k.apolo11@nasa.us','Katherine Johnson'),
31 | (13,'1941-09-09','ritchie@clanguage.com','Dennis Ritchie'),
32 | (14,'2009-01-01','bitcoin@bitcoin.com','Satoshi Nakamoto'),
33 | (15,'1912-06-23','a.turing@godofrbots.com','Alan Turing');
34 |
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Arthur A. Ferreira
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # App RH *versão 1.0* para estudos na UC 12
2 | ## Java com SPRING-BOOT
3 |
4 | Sistema de RH desenvolvido no tutorial (YouTube) sobre Spring Boot.
5 |
6 | **1ª Fase** - Criação do projeto e módulo *Vagas/Candidatos* :heavy_check_mark:
7 |
8 | [Playlist da Etapa 01 no YouTube](https://youtube.com/playlist?list=PLvtOeOw_Op8k8p6vw-ADaHcKavUnZaGk8)
9 |
10 |
11 |
12 | **2ª Fase** - Módulo *Funcionários/Dependentes* :heavy_check_mark:
13 |
14 | [Playlist da Etapa 02 no YouTube](https://youtube.com/playlist?list=PLvtOeOw_Op8kOkDWzFNb-N4gevX4e3l5J)
15 |
16 |
17 |
18 | **3ª Fase** - Implementação do *Formulário de Busca* na página inicial. :heavy_check_mark:
19 |
20 | [Playlist da Etapa 03 no YouTube](https://youtube.com/playlist?list=PLvtOeOw_Op8kQfcjW0Om23Z0GWBbOMfj5)
21 |
22 |
23 |
24 | **4ª Fase** - Implementação do *Security* no sistema e outros extras. :heavy_check_mark:
25 |
26 | [Playlist da Etapa 04 no YouTube](https://youtube.com/playlist?list=PLvtOeOw_Op8kRaARemNCorEhy2kpi2LQU)
27 |
28 |
29 |
30 |
31 | ### Instruções de instalação e uso:
32 |
33 | 1º No MySQL criar um banco com o nome **AppRH**;
34 |
35 | 2º No Eclipse, ir em *file*, *importar*, escolher opção *Maven*, *Existing Maven Projects*, *next*, selecione a pasta do seu projeto em *browser*, marque a opção em Projects *seuProjeto.jar* e *finish*;
36 |
37 | 4º Ainda no Eclipse, acessar o arquivo DataConfiguration.java e mudar usuário e senha de acordo com o seu banco de dados. Fazer a mesma coisa no arquivo application.properties que está na pasta src/main/resources;
38 |
39 | 5º Para executar o projeto no Eclipse, escolher *Run RhappApplication* e executar como uma aplicação Java;
40 |
41 | 6º Acessar em: http://localhost:8080/
42 |
43 |
44 | Obs.: O projeto *não funciona* se não existir um banco (vazio) chamado AppRH no MySQL.
45 |
46 |
47 |
--------------------------------------------------------------------------------