Merge branches 'PAN-16' and 'master' of https://github.com/atusa17/ptp into PAN-16
# Conflicts: # services/build.gradle
This commit is contained in:
@@ -4,18 +4,9 @@ import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
public static void main(final String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package edu.msudenver.tsp.website.controller;
|
||||
|
||||
import edu.msudenver.tsp.website.controller.forms.Theorem;
|
||||
import edu.msudenver.tsp.website.forms.TheoremForm;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -9,7 +9,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Slf4j
|
||||
@@ -18,16 +17,16 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
@RequestMapping("/theorem")
|
||||
public class TheoremEntryController {
|
||||
@GetMapping({"/",""})
|
||||
public ModelAndView enterTheoremPage()
|
||||
{
|
||||
public ModelAndView enterTheoremPage() {
|
||||
LOG.info("Received request to display the theorem entry page: returning model with name 'Theorem'");
|
||||
return new ModelAndView("Theorem");
|
||||
}
|
||||
|
||||
@PostMapping({"/",""})
|
||||
public String saveTheorem(@Validated Theorem theorem, Model model) {
|
||||
|
||||
model.addAttribute("theromName1", theorem.getTheoremName1());
|
||||
model.addAttribute("theromName2", theorem.getTheoremName2());
|
||||
public String saveTheorem(@Validated final TheoremForm theoremForm, final Model model) {
|
||||
model.addAttribute("theoremName", theoremForm.getTheoremName());
|
||||
model.addAttribute("theorem", theoremForm.getTheorem());
|
||||
LOG.info("Saving theorem {}...", theoremForm);
|
||||
|
||||
return "success";
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package edu.msudenver.tsp.website.controller.forms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class Theorem {
|
||||
private String theoremName1 ;
|
||||
private String theoremName2 ;
|
||||
@NotBlank(message = "Theorem name must not be blank") private String theoremName;
|
||||
private String theorem;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package edu.msudenver.tsp.website.forms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class TheoremForm {
|
||||
private String theoremName;
|
||||
private String theorem;
|
||||
}
|
||||
Reference in New Issue
Block a user