package controller; import bean.User; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import service.IUerService; import javax.annotation.Resource; import java.util.List; /** * @author 李正磊 * @createTime 2019-01-16 17:49 */ @Controller @RequestMapping("/user") public class UserController { @Resource private IUerService uerService; @RequestMapping("/query") public String query(Model model){ List<User> list = uerService.queryAll(); model.addAttribute("list",list); return "/home.jsp"; } @RequestMapping("/queryById") public String queryById(User user,Model model){ User u = uerService.queryById(user.getId()); System.out.println("ById的:"+u); model.addAttribute("user",u); return "/update.jsp"; } @RequestMapping("/update") public String update(User user){ uerService.update(user); return "query"; } @RequestMapping("/add") public String add(User user){ return "/update.jsp"; } @RequestMapping("/delete") public String delete(User user){ uerService.delete(user); System.out.println("delete的:"+user); return "query"; } }

2398164158 LV3
2023年9月24日
6389181 LV7
2023年5月31日
yeyuuu LV6
2023年5月18日
LITIANYU084414 LV11
2023年1月4日
微信网友_6248713511227392 LV11
2022年12月5日
mikyfx LV4
2022年11月30日
zxc131313 LV12
2022年11月18日
gypgyp LV10
2022年10月20日
980919 LV3
2022年9月25日
whfuai LV14
2022年8月4日

微信网友_7316199114199040
2024年12月28日
暂无贡献等级
taoshen95 LV16
2024年12月17日
微信网友_7298641844981760
2024年12月16日
暂无贡献等级
120_wu LV4
2024年12月2日
xin xie LV1
2024年6月13日
lsglsg9 LV23
2024年6月8日
2131234536546 LV7
2024年3月31日
1491713781 LV8
2024年3月5日
微信网友_6816301584912384 LV1
2024年1月10日
Camellia-while LV1
2024年1月2日