Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e747dff
ChapterAssuntoTag removido, funciona com anotations em ChapterAssunto
lipesanmartin Oct 31, 2023
3b9b72b
fix: configs for build
felipebeser Oct 31, 2023
61b0384
Merge branch 'adssenacgit:main' into main
felipebeser Oct 31, 2023
773f5be
Merge branch 'felipebeser:main' into main
lipesanmartin Oct 31, 2023
f781b1c
filterChapterAssuntosByChapterId
felipebeser Nov 1, 2023
6d16a3d
Merge branch 'main' of https://github.com/felipebeser/aprendizagemBac…
felipebeser Nov 1, 2023
9610333
feat: professor controller endpoints
felipebeser Nov 2, 2023
0b6038c
feat: indicador de presenca do estudante em encontros
felipebeser Nov 3, 2023
e5fc77b
feat: obter progresso do estudante por grupo
felipebeser Nov 3, 2023
a66159b
feat: get participantes by grupoId
felipebeser Nov 3, 2023
c839ef1
feat: acompanhamento de objetos
felipebeser Nov 4, 2023
f9a4e4f
fix: progresso
felipebeser Nov 5, 2023
97d31e6
fix: gruposByPeriodoAtivoByProfessorId
felipebeser Nov 6, 2023
acb968c
Merge pull request #5 from lipesanmartin/main
felipebeser Nov 15, 2023
5ae4601
Acompanhamento ID auto
lipesanmartin Nov 15, 2023
556ddda
Merge remote-tracking branch 'origin/f.sanmartin' into f.sanmartin
lipesanmartin Nov 15, 2023
3497738
URL do banco trocada
lipesanmartin Nov 15, 2023
af96d33
Merge pull request #6 from lipesanmartin/f.sanmartin
felipebeser Nov 16, 2023
7dbf055
Endpoit para total de comentarios
lipesanmartin Nov 17, 2023
5dcee5c
array de comentarios na pergunta
lipesanmartin Nov 17, 2023
93f6f26
feat: filtrarSituacoesAprendizagemPorPlanejamentoUcId
felipebeser Nov 18, 2023
f5daff0
ChapterAssuntoDTO criado
lipesanmartin Nov 18, 2023
aeb7e91
DTOs criados - ainda em implementacao
lipesanmartin Nov 20, 2023
ad8a54b
feat: planejamentoUc service and repository
felipebeser Nov 20, 2023
b35fe73
Implementando curtidas e comentarios
lipesanmartin Nov 21, 2023
e007dbd
ChapterAssuntoComentarioDto criado
lipesanmartin Nov 22, 2023
eaf74b1
Merge branch 'felipebeser:main' into f.sanmartin
lipesanmartin Nov 22, 2023
ecedd23
Post de comentario funcionando pelo front
lipesanmartin Nov 23, 2023
ea679ab
Merge branch 'f.sanmartin' of https://github.com/lipesanmartin/aprend…
lipesanmartin Nov 23, 2023
7fb3141
Post de comentario funcionando pelo front
lipesanmartin Nov 23, 2023
4eeed00
Merge pull request #7 from lipesanmartin/f.sanmartin
felipebeser Nov 25, 2023
da6fb47
objetos recursos relationship
felipebeser Nov 27, 2023
846440e
chapter noticias added
lipesanmartin Dec 7, 2023
380600f
endpoint de trazer noticias
lipesanmartin Dec 8, 2023
792954b
Merge pull request #10 from lipesanmartin/f.sanmartin
felipebeser Dec 8, 2023
62fdad2
put situacao
felipebeser Dec 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ build/
.vscode/

### Application yml ###
.yml
.yml

## Mac OS ##
.DS_Store
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<version>2.7.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>br.com.empresa</groupId>
<groupId>br.com.aprendizagem</groupId>
<artifactId>api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>api</name>
<description>Projeto de rastreio de entregas</description>
<name>AprendizagemApi</name>
<description>Projeto integrador Aprendizagem</description>
<properties>
<java.version>11</java.version>
</properties>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/br/com/aprendizagem/api/ApiApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.CrossOrigin;
Expand All @@ -10,7 +11,7 @@
@EnableScheduling
@EnableAsync
@CrossOrigin(origins = "http://localhost:4200")
public class ApiApplication {
public class ApiApplication extends SpringBootServletInitializer {

public static void main(String[] args) {
SpringApplication.run(ApiApplication.class, args);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package br.com.aprendizagem.api.DTO;

import br.com.aprendizagem.api.entity.Curtida;
import br.com.aprendizagem.api.entity.Usuario;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.Set;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ChapterAssuntoComentarioDto {

private Long id;
private String texto;
private LocalDateTime data;
private Long paiId;
private Integer chapterAssuntoId;
private String usuarioId;
private Usuario usuario;
private Set<Curtida> curtidas;
}
50 changes: 50 additions & 0 deletions src/main/java/br/com/aprendizagem/api/DTO/ChapterAssuntoDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package br.com.aprendizagem.api.DTO;

import br.com.aprendizagem.api.entity.Chapter;
import br.com.aprendizagem.api.entity.ChapterTag;
import br.com.aprendizagem.api.entity.Usuario;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ChapterAssuntoDto {

private Integer id;

private LocalDateTime dataCadastro;

private String titulo;

private String descricao;

private byte[] imagem;

private Long contadorVisualizacao;

private Integer status;

private Integer verificacao;

private Integer chapterId;

private String chapterNome;

private Usuario usuario;

private String usuarioVerificacaoId;

private Set<ChapterTag> tags = new HashSet<>();

private Integer totalComentarios;


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package br.com.aprendizagem.api.DTO;

import br.com.aprendizagem.api.entity.ChapterAssunto;
import br.com.aprendizagem.api.entity.ChapterAssuntoComentario;
import br.com.aprendizagem.api.entity.Usuario;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ComentariosFilhosDto {

private Long id;
private String texto;
private ChapterAssuntoComentario comentarioPai;
private LocalDateTime data;
private Integer verificacao;
private ChapterAssunto chapterAssunto;
private String usuarioId;
private String usuarioVerificacaoId;

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package br.com.aprendizagem.api.controller;

import br.com.aprendizagem.api.entity.Acompanhamento;
import br.com.aprendizagem.api.request.AcompanhamentoRequest;
import br.com.aprendizagem.api.response.AcompanhamentoResponse;
import br.com.aprendizagem.api.service.AcompanhamentoService;
import lombok.AllArgsConstructor;
Expand All @@ -26,7 +27,7 @@ public ResponseEntity<Acompanhamento> getAcompanhamentoById(@PathVariable Long i
if (acompanhamento == null) {
return ResponseEntity.notFound().build();
}
return ResponseEntity.ok(acompanhamento);
return ResponseEntity.ok().body(acompanhamento);
}

@GetMapping("filtrarByGrupoIdByEstudanteId/{grupoId}/{estudanteId}")
Expand All @@ -53,4 +54,9 @@ public ResponseEntity<List<AcompanhamentoResponse>> getAcompanhamentoByGrupoIdBy
public ResponseEntity<Acompanhamento> postAcompanhamento(@RequestBody Acompanhamento acompanhamento) {
return ResponseEntity.ok(acompanhamentoService.postAcompanhamento(acompanhamento));
}

@PostMapping ("simple")
public ResponseEntity<Acompanhamento> createAcompanhamento(@RequestBody AcompanhamentoRequest acompanhamentoRequest) {
return acompanhamentoService.createAcompanhamento(acompanhamentoRequest);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package br.com.aprendizagem.api.controller;

import br.com.aprendizagem.api.DTO.ChapterAssuntoComentarioDto;
import br.com.aprendizagem.api.entity.ChapterAssuntoComentario;
import br.com.aprendizagem.api.service.ChapterAssuntoComentarioService;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("chapter-assunto-comentario")
@AllArgsConstructor
public class ChapterAssuntoComentarioController {

private final ChapterAssuntoComentarioService chapterAssuntoComentarioService;



@GetMapping()
public ResponseEntity<List<ChapterAssuntoComentarioDto>> getAllChapterAssuntoComentario() {
return ResponseEntity.ok().body(chapterAssuntoComentarioService.getAllChapterAssuntoComentarioDto());
}

@GetMapping("/comentarios-by-chapter-assunto-id/{chapterAssuntoId}")
public ResponseEntity<List<ChapterAssuntoComentarioDto>> getAllChapterAssuntoComentarioDtoByChapterAssuntoId(@PathVariable Integer chapterAssuntoId) {
return ResponseEntity.ok().body(chapterAssuntoComentarioService.getAllChapterAssuntoComentarioDtoByChapterAssuntoId(chapterAssuntoId));
}


@GetMapping("/{id}")
public ResponseEntity<ChapterAssuntoComentario> getChapterAssuntoComentarioById(@PathVariable Long id) {
ChapterAssuntoComentario chapterAssuntoComentario = chapterAssuntoComentarioService.getChapterAssuntoComentarioById(id);
if (chapterAssuntoComentario != null) {
return ResponseEntity.ok().body(chapterAssuntoComentario);
} else {
return ResponseEntity.notFound().build();
}
}

@PostMapping
public ResponseEntity<ChapterAssuntoComentario> postChapterAssuntoComentario(@RequestBody ChapterAssuntoComentarioDto chapterAssuntoComentario) {
return ResponseEntity.ok().body(chapterAssuntoComentarioService.postChapterAssuntoComentario(chapterAssuntoComentario));
}

@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteChapterAssuntoComentarioById(@PathVariable Integer id) {
chapterAssuntoComentarioService.deleteChapterAssuntoComentarioById(id);
return ResponseEntity.noContent().build();
}

}
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package br.com.aprendizagem.api.controller;

import br.com.aprendizagem.api.DTO.ChapterAssuntoDto;
import br.com.aprendizagem.api.entity.ChapterAssunto;
import br.com.aprendizagem.api.entity.ChapterTag;
import br.com.aprendizagem.api.service.ChapterAssuntoService;
import br.com.aprendizagem.api.service.ChapterTagService;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@RestController
Expand All @@ -21,21 +18,33 @@ public class ChapterAssuntoController {

private final ChapterAssuntoService chapterAssuntoService;

@GetMapping
public ResponseEntity<List<ChapterAssunto>> getAllChapterAssunto() {
return chapterAssuntoService.getAllChapterAssunto();

@GetMapping()
public ResponseEntity<List<ChapterAssuntoDto>> getAllChapterAssunto() {
return chapterAssuntoService.getAllChapterAssuntoDto();
}


@GetMapping("/{id}")
public ResponseEntity<ChapterAssunto> getChapterAssuntoWithTags(@PathVariable Integer id) {
ChapterAssunto chapterAssunto = chapterAssuntoService.getChapterAssuntoWithTags(id);
if (chapterAssunto != null) {
return ResponseEntity.ok(chapterAssunto);
public ResponseEntity<ChapterAssuntoDto> getChapterAssuntoById(@PathVariable Integer id) {
ChapterAssuntoDto chapterAssuntoDTO = chapterAssuntoService.getChapterAssuntoDtoById(id);
if (chapterAssuntoDTO != null) {
return ResponseEntity.ok().body(chapterAssuntoDTO);
} else {
return ResponseEntity.notFound().build();
}
}

@GetMapping("/noticias")
public ResponseEntity<List<ChapterAssunto>> getAllNoticias() {
return ResponseEntity.ok(chapterAssuntoService.getAllNoticias());
}

@GetMapping("/filtrar-chapter-assuntos-por-chapter-id/{chapterId}")
public ResponseEntity<List<ChapterAssunto>> filterChapterAssuntosByChapterId(@PathVariable Integer chapterId) {
return chapterAssuntoService.filterChapterAssuntosByChapterId(chapterId);
}

@PostMapping()
public ResponseEntity<ChapterAssunto> postChapterAssunto(@RequestBody ChapterAssunto chapterAssunto) {
try {
Expand All @@ -46,15 +55,5 @@ public ResponseEntity<ChapterAssunto> postChapterAssunto(@RequestBody ChapterAss
}
}

@PostMapping("{id}/associar-tags")
public ResponseEntity<Void> associarTagAAssunto(@PathVariable Integer id, @RequestBody List<Integer> tagIds) {
ChapterAssunto chapterAssunto = chapterAssuntoService.getChapterAssuntoWithTags(id);
if (chapterAssunto != null) {
chapterAssuntoService.associarTagAAssunto(chapterAssunto, tagIds);
return ResponseEntity.ok().build();
} else {
return ResponseEntity.notFound().build();
}

}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import br.com.aprendizagem.api.service.GrupoChapterService;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

import java.util.List;

Expand All @@ -20,15 +17,28 @@ public class ChapterController {
private final GrupoChapterService grupoChapterService;

@GetMapping
public ResponseEntity<List<Chapter>> getAllChapters() {
List<Chapter> chapters = chapterService.getAllChapters();
public ResponseEntity<List<Chapter>> getActiveChapters() {
List<Chapter> chapters = chapterService.getActiveChapters();
if(chapters.isEmpty())
return ResponseEntity.notFound().build();
return ResponseEntity.ok(chapters);
}

@GetMapping("/noticias")
public ResponseEntity<Chapter> getNoticiasChapter() {
Chapter chapter = chapterService.getNoticiasChapter();
if(chapter == null)
return ResponseEntity.notFound().build();
return ResponseEntity.ok(chapter);
}

@GetMapping("getChapterByGrupoId/{grupoId}")
public ResponseEntity<Chapter> getChapterByGrupoId(@PathVariable Long grupoId) {
return grupoChapterService.getChapterByGrupoId(grupoId);
}
}

@PostMapping
public ResponseEntity<Chapter> postChapter(@RequestBody Chapter chapter) {
return ResponseEntity.ok(chapterService.postChapter(chapter));
}
}
Loading