Skip to content

Commit

Permalink
Merge pull request #19 from ufcg-lsd/fix-get-requests
Browse files Browse the repository at this point in the history
Fix get requests
  • Loading branch information
joaovitorsl authored Sep 9, 2024
2 parents b746ee9 + 86ee3a9 commit de22248
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 44 deletions.
40 changes: 20 additions & 20 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
Expand All @@ -43,7 +43,7 @@
</dependency>
<!-- Springboot Starter security dependency -->

<!-- Hibernate OGM MongoDB dependency -->
<!-- Hibernate OGM MongoDB dependency -->
<dependency>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-mongodb</artifactId>
Expand All @@ -60,7 +60,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>1.5.2.RELEASE</version>
<version>3.3.0</version>
</dependency>
<!-- Spring Security confing dependency -->

Expand Down Expand Up @@ -90,31 +90,31 @@
</dependency>
<!-- Starter-Mail -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.30.2</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>

<dependency>
<dependency>
<groupId>net.htmlparser.jericho</groupId>
<artifactId>jericho-html</artifactId>
<version>3.1</version>
Expand Down Expand Up @@ -164,4 +164,4 @@
</build>


</project>
</project>
18 changes: 9 additions & 9 deletions backend/src/main/java/springboot/model/ListaQuestoes.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.TextIndexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.TextScore;
// import org.springframework.data.mongodb.core.mapping.TextScore;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand All @@ -28,8 +28,8 @@ public class ListaQuestoes{

private List<String> questoes;

@TextScore
private Float score;
// @TextScore
// private Float score;

public ListaQuestoes(String nomeLista, String autor, List<String> questoes) {
this.nomeLista = nomeLista;
Expand Down Expand Up @@ -73,11 +73,11 @@ public void setQuestoes(List<String> questoes) {
this.questoes = questoes;
}

public Float getScore() {
return score;
}
// public Float getScore() {
// return score;
// }

public void setScore(Float score) {
this.score = score;
}
// public void setScore(Float score) {
// this.score = score;
// }
}
18 changes: 9 additions & 9 deletions backend/src/main/java/springboot/model/Questao.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.springframework.data.mongodb.core.index.TextIndexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.TextScore;
// import org.springframework.data.mongodb.core.mapping.TextScore;

import com.fasterxml.jackson.annotation.JsonProperty;

Expand Down Expand Up @@ -63,8 +63,8 @@ public class Questao {

private EstadoQuestao estado;

@TextScore
private Float score;
// @TextScore
// private Float score;

/**
* Cria uma Questão com tipo, enunciado, fonte, autor e imagem.
Expand Down Expand Up @@ -226,13 +226,13 @@ public void setCompetenciasClassificador(Set<CompetenciaType> competenciasClassi
this.competenciasClassificador = competenciasClassificador;
}

public Float getScore() {
return score;
}
// public Float getScore() {
// return score;
// }

public void setScore(Float score) {
this.score = score;
}
// public void setScore(Float score) {
// this.score = score;
// }


public Integer getQtdAvaliacoes() {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/java/springboot/model/Usuario.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Usuario(String nome, int idade, String nomeInstituicao, String cargo, Str
this.email = email;
this.ativo = ativo;
this.permissoes = new ArrayList<>();
if (email.equals("joao.medeiros@ccc.ufcg.edu.br") || email.equals("[email protected]")) {
if (email.equals("joao.luciano@ccc.ufcg.edu.br") || email.equals("[email protected]")) {
permissoes.add(PermissaoType.ADMIN);
permissoes.add(PermissaoType.JUDGE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ public ListaQuestoes getById(String id) {
public Page<ListaQuestoes> getByUser(Usuario user, int page, int size) {


Sort sort = Sort.by(
Sort.Order.desc("score"));
// Sort sort = Sort.by(
// Sort.Order.desc("score"));

Pageable pageable = PageRequest.of(page, size, sort);
Pageable pageable = PageRequest.of(page, size);

Page<ListaQuestoes> pagina = listaQuestoesRepository.getByAutor(user.getEmail(),pageable);

Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/java/springboot/service/QuestaoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ else if (competencias.contains("COMP_TODAS"))
parametros.clear();
arrayQuery.clear();

Sort sort = Sort.by(Sort.Order.desc("score"));
// Sort sort = Sort.by(Sort.Order.desc("score"));

Pageable pageable = PageRequest.of(page, size, sort);
Pageable pageable = PageRequest.of(page, size);

Aggregation agg = Aggregation.newAggregation(aggList);
List<Questao> results = mongoTemplate.aggregate(agg, "questao", Questao.class).getMappedResults();
Expand Down

0 comments on commit de22248

Please sign in to comment.