PAN-52 Fixed issue with the Theorems API
This commit is contained in:
@@ -26,6 +26,7 @@ version int default 1
|
|||||||
create table theorems (
|
create table theorems (
|
||||||
id int not null auto_increment primary key unique,
|
id int not null auto_increment primary key unique,
|
||||||
name varchar(512) not null,
|
name varchar(512) not null,
|
||||||
|
theorem varchar(1024) not null,
|
||||||
theorem_type enum ('THEOREM', 'PROPOSITION', 'LEMMA', 'COROLLARY') not null,
|
theorem_type enum ('THEOREM', 'PROPOSITION', 'LEMMA', 'COROLLARY') not null,
|
||||||
branch varchar(512) not null,
|
branch varchar(512) not null,
|
||||||
referenced_definitions json,
|
referenced_definitions json,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import java.util.List;
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class Theorem extends BaseDto implements Serializable {
|
public class Theorem extends BaseDto implements Serializable {
|
||||||
@NotBlank(groups = Insert.class) @Size(min = 1, max = 512, message = "theorem name must be between 1 and 512 characters") private String name;
|
@NotBlank(groups = Insert.class) @Size(min = 1, max = 512, message = "theorem name must be between 1 and 512 characters") private String name;
|
||||||
|
@NotNull(groups = Insert.class) @Size(min = 1, max = 1024, message = "theorem must be between 1 and 1024 characters") private String theorem;
|
||||||
@NotNull(groups = Insert.class) @Column(name = "theorem_type") private TheoremType theoremType;
|
@NotNull(groups = Insert.class) @Column(name = "theorem_type") private TheoremType theoremType;
|
||||||
@NotNull(groups = Insert.class, message = "a branch of mathematics that this theorem is associated with must be specified") private String branch;
|
@NotNull(groups = Insert.class, message = "a branch of mathematics that this theorem is associated with must be specified") private String branch;
|
||||||
@Type(type = "json") @Column(name = "referenced_definitions", columnDefinition = "jsonb") private List<String> referencedDefinitions;
|
@Type(type = "json") @Column(name = "referenced_definitions", columnDefinition = "jsonb") private List<String> referencedDefinitions;
|
||||||
|
|||||||
+1
@@ -352,6 +352,7 @@ public class TheoremControllerTest {
|
|||||||
|
|
||||||
final Theorem theorem = new Theorem();
|
final Theorem theorem = new Theorem();
|
||||||
theorem.setName("Test theorem");
|
theorem.setName("Test theorem");
|
||||||
|
theorem.setTheorem("test theorem thing here");
|
||||||
theorem.setBranch("Test branch");
|
theorem.setBranch("Test branch");
|
||||||
theorem.setProvenStatus(true);
|
theorem.setProvenStatus(true);
|
||||||
theorem.setTheoremType(TheoremType.THEOREM);
|
theorem.setTheoremType(TheoremType.THEOREM);
|
||||||
|
|||||||
Reference in New Issue
Block a user