diff --git a/java/org/owasp/webgoat/lessons/model/Hint.java b/java/org/owasp/webgoat/lessons/model/Hint.java new file mode 100644 index 000000000..4ad2c4277 --- /dev/null +++ b/java/org/owasp/webgoat/lessons/model/Hint.java @@ -0,0 +1,60 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.owasp.webgoat.lessons.model; + +/** + * + * @author rlawson + */ +public class Hint { + + private String hint; + private String lesson; + private int number; + + /** + * @return the hint + */ + public String getHint() { + return hint; + } + + /** + * @param hint the hint to set + */ + public void setHint(String hint) { + this.hint = hint; + } + + /** + * @return the lesson + */ + public String getLesson() { + return lesson; + } + + /** + * @param lesson the lesson to set + */ + public void setLesson(String lesson) { + this.lesson = lesson; + } + + /** + * @return the number + */ + public int getNumber() { + return number; + } + + /** + * @param number the number to set + */ + public void setNumber(int number) { + this.number = number; + } + +} diff --git a/java/org/owasp/webgoat/service/HintService.java b/java/org/owasp/webgoat/service/HintService.java new file mode 100644 index 000000000..bf375c0f2 --- /dev/null +++ b/java/org/owasp/webgoat/service/HintService.java @@ -0,0 +1,29 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.owasp.webgoat.service; + +import org.owasp.webgoat.lessons.model.Hint; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * + * @author rlawson + */ +@Controller +public class HintService extends BaseService { + + @RequestMapping(value = "/hint.do", produces = "application/json") + public @ResponseBody + Hint showHint() { + Hint h = new Hint(); + h.setHint("This is a test hint"); + h.setLesson("Some lesson"); + h.setNumber(1); + return h; + } +}