From d0f793c1070058d25b76e187f55862bb6de66c67 Mon Sep 17 00:00:00 2001 From: ptxkc5lo2 <2655184359@qq.com> Date: Thu, 30 Jun 2022 10:03:17 +0800 Subject: [PATCH] ADD file via upload --- BaseController.java | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 BaseController.java diff --git a/BaseController.java b/BaseController.java new file mode 100644 index 0000000..e0f88e7 --- /dev/null +++ b/BaseController.java @@ -0,0 +1,54 @@ +package com.yx.controller; + +import com.github.pagehelper.PageInfo; +import com.yx.po.Admin; +import com.yx.po.Notice; +import com.yx.service.AdminService; +import com.yx.service.NoticeService; +import com.yx.service.ReaderInfoService; +import com.yx.utils.DataInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +@Controller +public class BaseController { + + @Autowired + private NoticeService noticeService; + + /** + * 首页 + * @return + */ + @GetMapping("/index") + public String index(){ + return "index"; + } + + /** + * 欢迎页面跳转 + * @return + */ + @GetMapping("/welcome") + public String welcome(Model model){ + //提供公告信息 + PageInfo pageInfo = noticeService.queryAllNotice(null,1,5); + if (pageInfo!=null){ + List noticeList = pageInfo.getList(); + model.addAttribute("noticeList",noticeList); + } + return "welcome"; + } + + @GetMapping("/updatePassword") + public String updatePwd(){ + return "pwdUpdate/updatePwd"; + } + +}