PAN-50 Fixed the .travis.yml file

This commit is contained in:
2019-03-03 19:03:48 -07:00
parent 4999227e1b
commit 3762c10359
5 changed files with 39 additions and 11 deletions
+1 -2
View File
@@ -13,8 +13,7 @@ addons:
- mysql-client
before_install:
- chmod +x pandamonium-theorem-prover/gradlew
- cd pandamonium-theorem-prover
- chmod +x gradlew
before_script:
- mysql_upgrade --force -uroot
@@ -20,7 +20,7 @@ import java.util.Optional;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping(path = "/definitions/")
@RequestMapping(path = "/definitions")
public class DefinitionController {
private final DefinitionRepository definitionRepository;
@@ -1,11 +1,42 @@
package edu.msudenver.tsp.persistence.controller;
import edu.msudenver.tsp.persistence.dto.TheoremDto;
import edu.msudenver.tsp.persistence.repository.TheoremRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StopWatch;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@Component
import java.util.List;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping(path = "/theorems")
public class TheoremController {
final private TheoremRepository theoremRepository;
private final TheoremRepository theoremRepository;
@GetMapping("/")
public @ResponseBody
ResponseEntity<Iterable<TheoremDto>> getAllTheorems() {
LOG.info("Received request to list all theorems");
LOG.debug("Querying for list of all theorems");
final StopWatch stopWatch = new StopWatch();
stopWatch.start();
final List<TheoremDto> listOfTheorems = theoremRepository.findAll();
stopWatch.stop();
LOG.debug("Successfully completed query. Query took " + stopWatch.getTotalTimeMillis() + "ms to complete");
LOG.info("Returning list of all theorems with size " + listOfTheorems.size());
return new ResponseEntity<>(listOfTheorems, HttpStatus.OK);
}
}
@@ -9,7 +9,6 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@@ -17,14 +16,13 @@ import java.io.Serializable;
import java.util.List;
@Entity(name = "theorems")
@Table(name = "theorems")
@EntityListeners(AuditingEntityListener.class)
@Data
@EqualsAndHashCode(callSuper = true)
public class TheoremDto extends BaseDto implements Serializable {
@NotBlank @Size(min = 1, max = 512, message = "theorem name must be between 1 and 512 characters") private String name;
@NotNull @JsonProperty("theorem_type") private TheoremType theoremType;
@NotNull private String branch;
@NotNull(message = "a branch of mathematics that this theorem is associated with must be specified") private String branch;
@Type(type = "json") @Column(columnDefinition = "jsonb") @JsonProperty("referenced_definitions") private List<String> referencedDefinitions;
@Type(type = "json") @Column(columnDefinition = "jsonb") @JsonProperty("referenced_theorems") private List<String> referencedTheorems;
@NotNull @JsonProperty("proven_status") private boolean provenStatus;
@@ -1,9 +1,9 @@
package edu.msudenver.tsp.persistence.repository;
import edu.msudenver.tsp.persistence.dto.BaseDto;
import edu.msudenver.tsp.persistence.dto.TheoremDto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface TheoremRepository extends JpaRepository<BaseDto, Long> {
public interface TheoremRepository extends JpaRepository<TheoremDto, Long> {
}