package com.ssm.web.controller; import java.util.Date; import java.util.List; import javax.servlet.http.HttpSession; import org.springframework.beasn.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.srpingframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.ssm.po.Role; import com.ssm.po.User; import com.ssm.service.RoleService; import com.ssm.service.UserService; /* *用户控制类 */ @Controller public class UserController{ //依赖注入 @Autowired private UserService userService; @Autowired private RoleService roleService; //查询所有用户状态的用户集合(用户列表) @RequestMapping(value="/findUserList.action") public String findUserList(String keywords,Integer userListRoleId,Model model){ //获取角色列表 List<Role> roleList = roleService.findRoleList(); model.addAttribute("userList",userList); model.addAttribute("keywords",keywords); model.addAttribute("userListRoleId",userListRoleId); return "user/user_list"; } //转向添加用户 @RequestMapping(vaule="/toAddUser.action") public String toAddUser(Model model){ //获取角色列表,用于添加用户页面中的用户角色下拉列表 List<Role> roleList = roleService.findRoleList(); model.addAttribute("roleList",roleList); return "user/add_user"; } //判断登录账号是否已存在 @RequestMapping(vulue="/checkLoginName.action") @ResponseBody public User checkLoginName(@RequestBody User user,Model modle){ User checkUSer = userService.getUserByLoginName(user.getLoginName()); } }
【Spring Boot】Controller类--UserController
张天龙2024-06-20 9:04
相关推荐
怒放吧德德4 小时前
Spring Boot 实战:RSA+AES 接口全链路加解密(防篡改 / 防重放)李慕婉学姐8 小时前
Springboot智慧社区系统设计与开发6n99s526(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。QQ5110082859 小时前
python+springboot+django/flask的校园资料分享系统WeiXin_DZbishe9 小时前
基于django在线音乐数据采集的设计与实现-计算机毕设 附源码 22647追风筝的人er9 小时前
企业管理系统如何实现自定义首页与千人千面?RuoYi Office 给出了完整方案Java水解11 小时前
你真的会打印日志吗?基于 Spring Boot 的全方位日志指南Java水解11 小时前
Spring Boot 实战:MyBatis 操作数据库(上)手握风云-17 小时前
JavaEE 进阶第二十期:Spring Boot 中的横切逻辑统一治理方案RunsenLIu17 小时前
基于 Spring Boot 3 与 Vue 3 的汽车租赁系统