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
相关推荐
啊啊啊迈 旋棍8 小时前
生态整合与实战篇:Spring Boot 整合 RocketMQ 完全指南减瓦9 小时前
Jackson 使用指南旺仔学长 哈哈10 小时前
基于SpringBoot的在线招聘测评系统的设计与实现----附源码35253+数据库文档万亿少女的梦16810 小时前
基于Spring Boot的乐助在线助农系统设计与实现码农学院21 小时前
基于Spring Boot的跨境电商多语言订单管理系统架构设计whyfail1 天前
前端学 Spring Boot(5):从“你是谁”到“服务真的上线了”2601_953824611 天前
【计算机毕业设计】基于Spring Boot的画师接稿平台设计与实现稚南城才子,乌衣巷风流1 天前
Spring Boot 中的 @Lazy 注解:延迟加载的深入解析与实践hexu_blog1 天前
springboot3集成shardingsphere4.0 分表分库乐观的Terry1 天前
9、发布系统-Webhook自动发布