@@ -0,0 +1,1682 @@
+package com.lance.freemaker.web.system;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0A%0Aimport org.apache.commons.lang3.StringUtils;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.PathVariable;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0A%0Aimport com.lance.freemaker.domain.NewsInfo;%0Aimport com.lance.freemaker.domain.PageInfo;%0Aimport com.lance.freemaker.service.NewService;%0A%0A@Controller%0A@RequestMapping(%22system/admin/news/%22)%0Apublic class SystemNewController %7B%0A%09@Autowired%0A%09private NewService newService;%0A%0A%09/**%0A%09 * List Table%0A%09 * @param request%0A%09 * @return%0A%09 */%0A%09@RequestMapping(%22list%22)%0A%09public String list(HttpServletRequest request) %7B%0A%09%09String page = request.getParameter(%22page%22);%0A%09%09page = StringUtils.defaultIfBlank(page, %221%22);%0A%09%09int pageNumber = Integer.valueOf(page);%0A%09%09%0A%09%09int total = newService.findCount();%0A%09%09PageInfo%3CNewsInfo%3E pageInfo = new PageInfo%3C%3E(total, pageNumber);%0A%09%09pageInfo.setList(newService.findAll(pageInfo.getPageStart()));%0A%09%09%0A%09%09request.setAttribute(%22page%22, pageInfo);%0A%09%09return %22system/list.jsp%22;%0A%09%7D%0A%09%0A%09/**%0A%09 * GO Add%0A%09 * @return%0A%09 */%0A%09@RequestMapping(%22add%22)%0A%09public String add() %7B%0A%09%09return %22system/add.jsp%22; %0A%09%7D%0A%09%0A%09/**%0A%09 * Save%0A%09 * @return%0A%09 */%0A%09@RequestMapping(%22save%22)%0A%09public String save(NewsInfo info) %7B%0A%09%09newService.save(info);%0A%09%09return %22redirect:/system/admin/news/list%22; %0A%09%7D%0A%09%0A%09/**%0A%09 * Detail%0A%09 * @param id%0A%09 * @return%0A%09 */%0A%09@RequestMapping(%22detail/%7Bid%7D%22)%0A%09public String detail(@PathVariable int id, HttpServletRequest request) %7B%0A%09%09request.setAttribute(%22info%22, newService.findOne(id));%0A%09%09return %22system/detail.jsp%22; %0A%09%7D%0A%7D%0A

add resource