diff --git a/src/main/java/com/mewhz/paste/controller/ListController.java b/src/main/java/com/mewhz/paste/controller/ListController.java index 60cfaa7..60b8fb1 100644 --- a/src/main/java/com/mewhz/paste/controller/ListController.java +++ b/src/main/java/com/mewhz/paste/controller/ListController.java @@ -16,74 +16,8 @@ @RestController public class ListController { - - @RequestMapping(value = "/list") - public String list(@RequestParam(value = "id", required = false) String id ){ - - if (id == null || "".equals(id)) { - return "

未输入标识码

"; - } - - String htmlBegin = "\n" + - "\n" + - "\n" + - " \n" + - " 贴代码\n" + - " \n" + - "\n" + - ""; - String summaryBegin = "
\n" + - " "; - String summaryEnd = "\n" + - "
\n" +
-                "      \n" +
-                "  
\n"; - String htmlEnd = " \n" + - " \n" + - " \n" + - " \n" + - "\n" + - ""; - StringBuilder html = new StringBuilder(htmlBegin); - - CodeSQL codeSQL = new CodeSQL(); - - List list = codeSQL.findIdentifyingCode(id); - - if (list.size() == 0) { - return "

未找到该识别码

"; - } - - for (Entity e : list){ - html.append(summaryBegin); - html.append(e.get("date")); - html.append(" "); - html.append(e.get("time_id")); - html.append(" "); - html.append(e.get("remark")); - html.append(summaryEnd); - html.append(e.get("type")); - html.append("\">"); - - String text = (String) e.get("text"); - - text = text.replaceAll("<", "<"); - text = text.replaceAll(">", ">"); - text = text.replaceAll("\n", "
"); - text = text.replaceAll(" ", " "); - - html.append(text); - html.append(detailsEnd); - } - html.append(htmlEnd); - - return html.toString(); - } - - - @RequestMapping("/lists") + + @RequestMapping("/list") public ModelAndView lists(@RequestParam(value = "id", required = false) String id ){ ModelAndView mav = new ModelAndView("/list.html");