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
相关推荐
摇滚侠22 分钟前
在 SpringBoot 项目中,开发工具使用 IDEA,.idea 目录下的文件需要提交吗打工的小王2 小时前
Spring Boot(三)Spring Boot整合SpringMVC毕设源码-赖学姐2 小时前
【开题答辩全过程】以 高校体育场馆管理系统为例,包含答辩的问题和答案vx_Biye_Design2 小时前
【关注可免费领取源码】房屋出租系统的设计与实现--毕设附源码40805翱翔-蓝天2 小时前
为什么“看起来很规范”的后端项目反而臃肿且性能下降80530单词突击赢3 小时前
JavaWeb进阶:SpringBoot核心与Bean管理long3164 小时前
Aho-Corasick 模式搜索算法独断万古他化4 小时前
【SSM开发实战:博客系统】(三)核心业务功能开发与安全加密实现rannn_1115 小时前
【苍穹外卖|Day4】套餐页面开发(新增套餐、分页查询、删除套餐、修改套餐、起售停售)qq_12498707535 小时前
基于JavaWeb的大学生房屋租赁系统(源码+论文+部署+安装)