Skip to content

Commit e647a97

Browse files
committed
resources path
1 parent eb229a8 commit e647a97

File tree

9 files changed

+34
-20
lines changed

9 files changed

+34
-20
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"time":"220","optionsQuestionsClicked":["Pouco clara, vaga ou difícil de entender.","Programa específico sem um trecho de código ou explicação adequada.","Muito difícil, muito específica ou muito extensa.","Problema de uma tecnologia proprietária.","Não é uma pergunta de programação.","Já possui a resposta na pergunta.","Resposta não é relevante ou necessária.","Pergunta de trabalhos acadêmicos.","Muita Curta."],"optionsQuestionsChosen":["Pergunta bem escrita.","Pergunta clara e objetiva.","Pergunta de uma tecnologia conhecida."],"steps":{"step1":{"head":"Passo 1","description":"Descrição do Passo 1"},"step2":{"head":"Passo 2","description":"Descrição do Passo 2"},"step3":{"head":"Passo 3","description":"Descrição do Passo 3"}}}
1+
{"time":"220","optionsQuestionsClicked":["Pouco clara, vaga ou difícil de entender.","Programa específico sem um trecho de código ou explicação adequada.","Muito difícil, muito específica ou muito extensa.","Problema de uma tecnologia proprietária.","Não é uma pergunta de programação.","Já possui a resposta na pergunta.","Resposta não é relevante ou necessária.","Pergunta de trabalhos acadêmicos.","Muita Curta."],"optionsQuestionsChosen":["Pergunta bem escrita.","Pergunta clara e objetiva.","Pergunta de uma tecnologia conhecida."],"steps":{"step1":{"head":"Passo 1","description":"Descrição do Passo 1"},"step2":{"head":"Passo 2","description":"Descrição do Passo 2"},"step3":{"head":"Passo 3","description":"Descrição do Passo 3"}},"suggestions":["Descreva melhor o título da pergunta.","O Título da pergunta parece não está coerente com a descrição.","Descreva seu problema de forma simples e direta.","Descrição curta.","Resuma a pergunta a um único problema.","Evite pergunta com muito código.","Seja Objetivo e deixe a pergunta mais evidente.","Adicione um trecho de código ou outro de tipo de exemplo na pergunta.","Detalhe mais o problema.","Use a norma culta da língua.","Seja educado.","Evite criar perguntas sobre trabalhos acadêmicos.","Evite descrição muito curta.","Seja mais objetivo e claro na formulação da pergunta"]}

AnalyzerQuestionsRESTful/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<artifactId>spring-boot-maven-plugin</artifactId>
134134
</plugin>
135135
</plugins>
136-
<resources>
136+
<!-- <resources>
137137
<resource>
138138
<directory>src/main/resources/static</directory>
139139
<filtering>true</filtering>
@@ -142,7 +142,7 @@
142142
<directory>src/main/resources/templates</directory>
143143
<filtering>true</filtering>
144144
</resource>
145-
</resources>
145+
</resources> -->
146146
</build>
147147

148148
</project>

AnalyzerQuestionsRESTful/src/main/java/br/edu/ifpb/ws/analyzerQuestionsRESTful/analyzers/QuestionAnalyzerMSG.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@
44
import java.util.List;
55

66
import br.edu.ifpb.ws.analyzerQuestionsRESTful.entities.MSG;
7+
import br.edu.ifpb.ws.analyzerQuestionsRESTful.entities.pojos.Config;
78
import br.edu.ifpb.ws.analyzerQuestionsRESTful.enumerations.Messages;
9+
import br.edu.ifpb.ws.analyzerQuestionsRESTful.util.JsonUtil;
810

911
public class QuestionAnalyzerMSG {
1012

1113
QuestionAnalyzerFinal qaf;
1214
List<String> messages;
1315
MSG msg;
14-
16+
17+
private List<String> getSuggestions(){
18+
Config config = JsonUtil.loadFromJSONGson("config.json");
19+
return config.getSuggestions();
20+
}
21+
1522
public QuestionAnalyzerMSG() {
1623
qaf = new QuestionAnalyzerFinal();
1724
}

AnalyzerQuestionsRESTful/src/main/java/br/edu/ifpb/ws/analyzerQuestionsRESTful/controllers/ConfigController.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package br.edu.ifpb.ws.analyzerQuestionsRESTful.controllers;
22

3+
import java.util.ArrayList;
34
import java.util.Arrays;
45
import java.util.List;
56

@@ -58,11 +59,15 @@ public ResponseEntity<String> getConfig() {
5859
* @return
5960
*/
6061
@RequestMapping(value="/suggestions", method=RequestMethod.GET)
61-
public ResponseEntity<List<Messages>> getSuggestions(){
62-
62+
public ResponseEntity<List<String>> getSuggestions(){
63+
List<String> values = new ArrayList<>();
6364
List<Messages> messages = Arrays.asList(Messages.values());
6465

65-
return new ResponseEntity<List<Messages>>(messages, HttpStatus.OK);
66+
for (Messages messages2 : messages) {
67+
values.add(messages2.getMsg());
68+
}
69+
70+
return new ResponseEntity<List<String>>(values, HttpStatus.OK);
6671
}
6772

6873
}

AnalyzerQuestionsRESTful/src/main/java/br/edu/ifpb/ws/analyzerQuestionsRESTful/entities/pojos/Config.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class Config {
88
private List<String> optionsQuestionsClicked;
99
private List<String> optionsQuestionsChosen;
1010
private Step steps;
11+
private List<String> suggestions;
1112

1213
public String getTime() {
1314
return time;
@@ -41,6 +42,14 @@ public void setSteps(Step steps) {
4142
this.steps = steps;
4243
}
4344

45+
public List<String> getSuggestions() {
46+
return suggestions;
47+
}
48+
49+
public void setSuggestions(List<String> suggestions) {
50+
this.suggestions = suggestions;
51+
}
52+
4453
@Override
4554
public String toString() {
4655
return "Config [time=" + time + ", optionsQuestionsClicked=" + optionsQuestionsClicked

AnalyzerQuestionsRESTful/src/main/resources/static/js/config/cronometer-config.js renamed to AnalyzerQuestionsRESTful/src/main/resources/static/js/config/config.js

File renamed without changes.

AnalyzerQuestionsRESTful/src/main/resources/static/js/controllers/config-controller.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ aqtApp.controller("configController", function($scope, aqtConfig, questionServic
111111
/**
112112
*
113113
*/
114-
$scope.getSuggestions = function() {
115-
aqtConfig.getSuggestions().then(function(response) {
116-
});
117-
};
114+
aqtConfig.getSuggestions().then(function(response) {
115+
$scope.config.suggestions = response.data;
116+
});
117+
118118

119119
/**
120120
*

AnalyzerQuestionsRESTful/src/main/resources/static/js/controllers/new-questions-controller.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @date 20-10-16.
77
*/
88
aqtApp.controller('newQuestionController', function($scope, userService, $http,
9-
$location, localStorageService, aqtConfig) {
9+
$location, localStorageService) {
1010

1111
var chosenSuggestions = [];
1212
$scope.suggestions = [];
@@ -32,17 +32,10 @@ aqtApp.controller('newQuestionController', function($scope, userService, $http,
3232
}).then(function onSucces(response) {
3333
$scope.suggestions = response.data;
3434
config.suggestions = response.data;
35-
$scope.update();
3635
}, function onError(response) {
3736
});
3837
};
3938

40-
$scope.update = function() {
41-
aqtConfig.updateTime(config).then(function(response) {
42-
43-
});
44-
};
45-
4639
/**
4740
* Controla as escolhas de sugestões feitas pelo user.
4841
*/

AnalyzerQuestionsRESTful/src/main/resources/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<script src="/js/config/loading-bar-config.js"></script>
4242
<script src="/js/config/local-store-config.js"></script>
4343
<script src="/js/config/growl-config.js"></script>
44-
<script src="/js/config/cronometer-config.js"></script>
44+
<script src="/js/config/config.js"></script>
4545
<script src="/js/config/datatables-config.js"></script>
4646

4747
<script src="/js/services/user-services.js"></script>

0 commit comments

Comments
 (0)