Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'lucas' of https://github.com/lucas0headshot/GS-SENAC in…
Browse files Browse the repository at this point in the history
…to lucas
  • Loading branch information
lucas0headshot committed Mar 20, 2024
2 parents 9c11a26 + 8d37d67 commit 1f748ab
Show file tree
Hide file tree
Showing 53 changed files with 824 additions and 212 deletions.
14 changes: 13 additions & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<name>gestao-curso</name>
<description>projeto semestral da matéria de backend para gestão de cursos</description>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
</properties>
<dependencies>
<dependency>
Expand All @@ -36,6 +36,18 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>7.0.2.Final</version>
</dependency>

<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.senac.gestaocurso.enterprise.exception;



import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;



@ResponseStatus(HttpStatus.CONFLICT)
public class BusinessException extends RuntimeException {
public BusinessException(String msg) {
super(msg);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.senac.gestaocurso.enterprise.exception;



import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;



@ResponseStatus(HttpStatus.UNPROCESSABLE_ENTITY)
public class ValidationException extends RuntimeException {
public ValidationException(String msg) {
super(msg);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.senac.gestaocurso.health;



import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
public class HealthCheckController {
@GetMapping("/health")
public String healthCheck() {
return "Aplicação está rodando";
}
}
13 changes: 13 additions & 0 deletions backend/src/main/java/com/senac/gestaocurso/models/Aula.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ public class Aula extends EntityID {
@JoinColumn(name = "materia_id")
private Materia materia;

@Column
private LocalDate dia;

@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "professor_id")
private Funcionario professor;



public Aula(){}
Expand All @@ -38,6 +43,14 @@ public void setDia(LocalDate dia) {
this.dia = dia;
}

public Funcionario getProfessor() {
return professor;
}

public void setProfessor(Funcionario professor) {
this.professor = professor;
}



@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@


import jakarta.persistence.*;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.time.LocalDate;


Expand All @@ -18,10 +19,15 @@ public class Avaliacao extends EntityID {
@JoinColumn(name = "aluno_id")
private Inscricao aluno;

@Column
private String nome;

@Column
@Min(value = 0, message = "A nota deve ser no mínimo 0")
@Max(value = 10, message = "A nota deve ser no máximo 10")
private Integer nota;

@Column
private LocalDate data;


Expand Down
3 changes: 3 additions & 0 deletions backend/src/main/java/com/senac/gestaocurso/models/Cargo.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

@Entity
public class Cargo extends EntityID {
@Column
private String descricao;

@Column
private String nivel;

@Column
private Boolean comissionado;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@

@Entity
public class Certificacoes extends EntityID {

@Column
private String nome;

@Column
private Integer cargaHoraria;

@Column
private LocalDate dataEmissao;

@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "funcionario_id")
private Funcionario funcionario;



public Certificacoes() {
}


public Funcionario getFuncionario() {
return funcionario;
}
Expand All @@ -28,12 +36,6 @@ public void setFuncionario(Funcionario funcionario) {
this.funcionario = funcionario;
}


public Certificacoes() {
}



public String getNome() {
return nome;
}
Expand Down
9 changes: 5 additions & 4 deletions backend/src/main/java/com/senac/gestaocurso/models/Curso.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@

import jakarta.persistence.*;

import java.util.List;



@Entity
public class Curso extends EntityID {

@Column
private String nome;

@Column
private String descricao;


@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "coordenador_id")
private Funcionario coordenador;

@Column
private Integer cargaHorariaTotal;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,28 @@

@Entity
public class DadosBancarios extends EntityID {
@Column
private String banco;

@Column
private String agencia;

@Column
private String conta;

@Enumerated(EnumType.STRING)
private TipoContaBancaria tipoContaBancaria;

@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "funcionario_id")
private Funcionario funcionario;



public DadosBancarios() {
}


public Funcionario getFuncionario() {
return funcionario;
}
Expand All @@ -28,12 +38,6 @@ public void setFuncionario(Funcionario funcionario) {
this.funcionario = funcionario;
}


public DadosBancarios() {
}



public String getBanco() {
return banco;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@
import com.senac.gestaocurso.enums.Escolaridade;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;

import java.time.LocalDate;



@Entity
public class Dependentes extends EntityID {
@Column
private String nome;

@Enumerated(EnumType.STRING)
private Escolaridade escolaridade;

@Column
private LocalDate dataNasc;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@ public class ExpAnterior extends EntityID {
@JoinColumn(name = "cargo_id")
private Cargo cargo;

@Column
private LocalDate periodoFinal;

@Column
private LocalDate peridoInicial;

@ManyToOne
@JoinColumn(name = "funcionario_id")
private Funcionario funcionario;



public ExpAnterior() {
}



public Funcionario getFuncionario() {
return funcionario;
}
Expand All @@ -35,12 +44,6 @@ public void setFuncionario(Funcionario funcionario) {
this.funcionario = funcionario;
}


public ExpAnterior() {
}



public String getDescricao() {
return descricao;
}
Expand Down
18 changes: 15 additions & 3 deletions backend/src/main/java/com/senac/gestaocurso/models/Feedback.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
package com.senac.gestaocurso.models;


import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.*;

import java.time.LocalDate;


@Entity
public class Feedback extends EntityID {
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "autor_id")
private Funcionario autor;

@Column
private String feedback;

@Column
private Integer nota;

@Column
private LocalDate data;

@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "avaliado_id")
private Curso avaliado;


public Feedback() {

}




public Funcionario getAutor() {
return autor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@

@Entity
public class Filiacao extends EntityID {
@Column
private String nomePai;

@Column
private String telefonePai;

@Column
private String nomeMae;

@Column
private String telefoneMae;


Expand Down
Loading

0 comments on commit 1f748ab

Please sign in to comment.