package com.withstars.controller; import com.withstars.domain.Tab; import com.withstars.service.impl.ReplyServiceImpl; import com.withstars.service.impl.TabServiceImpl; import com.withstars.service.impl.TopicServiceImpl; import com.withstars.service.impl.UserServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import javax.jws.WebParam; import java.util.List; /** * 主控制类 */ @Controller public class MainController { @Autowired public TopicServiceImpl topicService; @Autowired public ReplyServiceImpl replyService; @Autowired public UserServiceImpl userService; @Autowired public TabServiceImpl tabService; /** * 进入登录页面. */ @RequestMapping(value = {"/signin"}) public ModelAndView signin(){ ModelAndView signinPage=new ModelAndView("signin"); //获取统计信息 int topicsNum=topicService.getTopicsNum(); int usersNum=userService.getUserCount(); signinPage.addObject("topicsNum",topicsNum); signinPage.addObject("usersNum",usersNum); return signinPage; } /** * 进入注册页面. */ @RequestMapping("/signup") public ModelAndView signup(){ ModelAndView signupPage=new ModelAndView("signup"); //获取统计信息 int topicsNum=topicService.getTopicsNum(); int usersNum=userService.getUserCount(); signupPage.addObject("topicsNum",topicsNum); signupPage.addObject("usersNum",usersNum); return signupPage; } /** * 进入新建主题页面 */ @RequestMapping(value = {"/new"}) public ModelAndView newTopic(){ ModelAndView newTopicPage=new ModelAndView("new"); List<Tab> tabs=tabService.getAllTabs(); //获取统计信息 int topicsNum=topicService.getTopicsNum(); int usersNum=userService.getUserCount(); newTopicPage.addObject("tabs",tabs); newTopicPage.addObject("topicsNum",topicsNum); newTopicPage.addObject("usersNum",usersNum); return newTopicPage; } /** * 配置404页面 */ @RequestMapping("*") public String notFind(){ return "404"; } }
最近下载更多
2131234536546 LV7
3月31日
xiaopengzep LV1
3月24日
wanglinddad LV55
3月11日
qq573914838 LV5
3月5日
THyper LV2
3月1日
罗清晨 LV12
2月21日
lovelyy LV11
2月1日
qwe6002 LV9
1月11日
XiaoSong888 LV2
1月10日
lilong007 LV20
2023年12月30日
最近浏览更多
来一杯西瓜冰咩 LV1
5月6日
之额着 LV3
4月23日
getset LV8
4月20日
tassel_2024
4月14日
暂无贡献等级
微信网友_6444139264921600 LV6
4月13日
玖零定制问题修复 LV34
4月4日
wddq123
4月2日
暂无贡献等级
2131234536546 LV7
3月31日
xiaopengzep LV1
3月24日
953558449
3月22日
暂无贡献等级