PAN-16 finished

This commit is contained in:
-
2019-03-14 16:58:17 -06:00
parent 2dda30753e
commit 139dc943c3
16 changed files with 275 additions and 327 deletions
@@ -1,23 +1,21 @@
package edu.msudenver.tsp.website;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import java.util.Arrays;
@Slf4j
//import lombok.extern.slf4j.Slf4j;
@SpringBootApplication
public class Application {
public static void main(final String[] args) {
SpringApplication.run(Application.class, args);
}
}
@Bean
/*@Bean
public CommandLineRunner commandLineRunner(final ApplicationContext ctx) {
return args -> {
@@ -28,6 +26,9 @@ public class Application {
for (final String beanName : beanNames) {
LOG.info(beanName);
}
};
}
}
}
*/
@@ -1,4 +1,5 @@
package edu.msudenver.tsp.website;
public class ProofsDriver {
//Business Logic will go here
}
@@ -0,0 +1,43 @@
package edu.msudenver.tsp.website;
import edu.msudenver.tsp.website.forms.Theorem;
import edu.msudenver.tsp.website.service.ProofDriver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class TheoremEntryController {
@Autowired
ProofDriver proofDriver;
@RequestMapping("/welcome")
public ModelAndView firstPage()
{
return new ModelAndView("welcome");
}
@RequestMapping("/theorem")
public ModelAndView theoremPage()
{
return new ModelAndView("Theorem");
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
public String saveTheorem(@Validated Theorem theorem, Model model) {
proofDriver.processProof(theorem.getTheoremName());
model.addAttribute("theromName", theorem.getTheoremName());
return "success";
}
}
@@ -0,0 +1,19 @@
package edu.msudenver.tsp.website.forms;
public class Theorem {
private String theoremName ;
public String getTheoremName() {
return theoremName;
}
public void setTheoremName(String theoremName) {
this.theoremName = theoremName;
}
}
@@ -0,0 +1,16 @@
package edu.msudenver.tsp.website.service;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class ProofDriver {
List<String> theromList = new ArrayList<String>();
public String processProof(String theoremName){
//Business Logic
return theoremName + "Accepted";
}
}