IndexController
2016-09-27 18:39:36 0 举报
IndexController是一个用于处理网站首页请求的控制器。它负责加载和显示网站的主要内容,如导航栏、轮播图、热门文章等。同时,IndexController还需要处理用户登录、注册、找回密码等功能。在实现这些功能时,IndexController通常会与其他控制器和服务进行交互,如用户服务、数据库服务等。此外,为了提高网站的可访问性和搜索引擎优化(SEO),IndexController还需要支持多种语言和响应式设计。总之,IndexController是网站架构中的关键组件,它为用户提供了友好的界面和丰富的功能。
作者其他创作
大纲/内容
package com.zt.note.core.index.web.controller;import com.zt.note.core.common.vo.Pagination;import com.zt.note.core.index.vo.NoteMenu;import com.zt.note.core.index.vo.TreeVo;import org.apache.commons.lang.StringUtils;import org.apache.log4j.Logger;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;import com.zt.note.core.common.utils.NoteResponse;import com.zt.note.core.index.service.itf.IndexService;import java.util.ArrayList;import java.util.List;import java.util.Map;@Controller@RequestMapping(\"/index\")public class IndexController { private static Logger logger = Logger.getLogger(IndexController.class); @Autowired private IndexService service;\t@ResponseBody\t@RequestMapping(\"/menu.do\")\tpublic NoteResponse findMenuList() {\t\ttry {\t\t\tlogger.info(\"findMenuList\");\t\t\tList notes = service.findMenuList();\t\t\tlogger.info(\"findMenuList notes=\"+notes);\t\t\treturn NoteResponse.success(notes);\t\t} catch (Exception e) {\t\t\tlogger.error(\"Exception when access findMenuList method!\
0 条评论
下一页