Merge branches 'PAN-15' and 'master' of https://github.com/atusa17/ptp into PAN-15
# Conflicts: # build.gradle # persistence/src/main/java/edu/msudenver/tsp/persistence/repository/AccountsRepository.java # persistence/src/test/java/edu/msudenver/tsp/persistence/controller/AccountControllerTest.java # services/src/main/java/edu/msudenver/tsp/services/RestService.java # services/src/main/java/edu/msudenver/tsp/services/dto/Account.java # services/src/main/java/edu/msudenver/tsp/services/factory/RequestFactory.java # services/src/main/java/edu/msudenver/tsp/services/parser/ParserService.java # services/src/test/java/edu/msudenver/tsp/services/parser/ParserServiceTest.java
This commit is contained in:
@@ -43,20 +43,20 @@ public class RestService {
|
||||
return send(requestFactory.post(uri, requestJson), null, connectionTimeout, socketTimeout, type);
|
||||
}
|
||||
|
||||
<T> Optional<T> patch(final String uri, final String requestJson, final TypeToken<T> type, final Integer connectionTimeout, final Integer socketTimeout) {
|
||||
LOG.info("Sending Patch {} with body: {}", uri, requestJson);
|
||||
return send(requestFactory.patch(uri, requestJson), null, connectionTimeout, socketTimeout, type);
|
||||
}
|
||||
Optional<HttpResponse> post(final String uri, final String requestJson, final Integer connectionTimeout, final Integer socketTimeout) {
|
||||
LOG.info("Sending POST {} with body: {}", uri, requestJson);
|
||||
return send(requestFactory.post(uri, requestJson), null, connectionTimeout, socketTimeout);
|
||||
}
|
||||
|
||||
<T> Optional<T> put(final String uri, final String requestJson, final TypeToken<T> type, final Integer connectionTimeout, final Integer socketTimeout) {
|
||||
<T> Optional<T> put(final String uri, final String requestJson, final TypeToken<T> type, final Integer connectionTimeout, final Integer socketTimeout, final String auth) {
|
||||
LOG.info("Sending PUT {} with body: {}", uri, requestJson);
|
||||
return send(requestFactory.put(uri, requestJson), null, connectionTimeout, socketTimeout, type);
|
||||
return send(requestFactory.put(uri, requestJson), auth, connectionTimeout, socketTimeout, type);
|
||||
}
|
||||
|
||||
<T> Optional<T> patch(final String uri, final String requestJson, final TypeToken<T> type, final Integer connectionTimeout, final Integer socketTimeout) {
|
||||
LOG.info("Sending PATCH {} with body: {}", uri, requestJson);
|
||||
return send(requestFactory.patch(uri, requestJson), null, connectionTimeout, socketTimeout, type);
|
||||
}
|
||||
|
||||
private <T> Optional<T> send(final Request request, final String auth, final Integer connectionTimeout, final Integer socketTimeout, final TypeToken<T> type) {
|
||||
try {
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
@@ -14,12 +15,11 @@ import java.util.Date;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Account extends BaseDto implements Serializable {
|
||||
@Size(max = 50) private String username;
|
||||
@Size(max = 256) private String password;
|
||||
@NotBlank(groups = edu.msudenver.tsp.persistence.dto.Account.Insert.class, message = "A username must be specified") @Size(max = 50) private String username;
|
||||
@NotBlank(groups = edu.msudenver.tsp.persistence.dto.Account.Insert.class, message = "A password must be specified") @Size(max = 256) private String password;
|
||||
@NotNull @SerializedName("administrator_status") private boolean administratorStatus;
|
||||
@Temporal(TemporalType.DATE) @SerializedName("last_login") private Date lastLogin;
|
||||
|
||||
private static final long serialVersionUID = 7095627971593953734L;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@ public class RequestFactory {
|
||||
}
|
||||
|
||||
public Request patch(final String uri, final String requestJson) {
|
||||
return StringUtils.isNotBlank(requestJson) ? Request.Patch(uri).bodyString(requestJson, ContentType.APPLICATION_JSON) : Request.Patch(uri);
|
||||
return StringUtils.isNotBlank(requestJson) ? Request.Put(uri).bodyString(requestJson, ContentType.APPLICATION_JSON) : Request.Patch(uri);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,24 @@
|
||||
package edu.msudenver.tsp.services.parser;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
class ParserService {
|
||||
private Node root;
|
||||
|
||||
public boolean parseUserInput(final String userInput)
|
||||
{
|
||||
try {
|
||||
final Node tree = parseRawInput(userInput);
|
||||
final List<String> statements = retrieveStatements(tree);
|
||||
retrieveStatements(tree);
|
||||
|
||||
return true;
|
||||
} catch(final Exception e) {
|
||||
e.printStackTrace();
|
||||
LOG.error(e.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -26,7 +27,7 @@ class ParserService {
|
||||
{
|
||||
input = input.toLowerCase();
|
||||
|
||||
root = new Node(input, null);
|
||||
final Node root = new Node(input, null);
|
||||
|
||||
if(input.equals(""))
|
||||
{
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package edu.msudenver.tsp.services.scoring;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan
|
||||
//@PropertySource("classpath:development.properties")
|
||||
public class ScoringConfig {
|
||||
|
||||
@Bean
|
||||
public TheoremScoringService theoremScoringService() {
|
||||
return new TheoremScoringService();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package edu.msudenver.tsp.services.scoring;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
class TheoremScoringService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user