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
相关推荐
vx_Biye_Design2 小时前
springboot高校选课系统82776-计算机课程设计、毕业设计专业程序开发源4 小时前
SSM校园拍摄交流服务平台36936-计算机课程设计、毕业设计AI人工智能+电脑小能手5 小时前
Java 企业级工具类全家桶-74-JSON序列化工具类ZealSinger6 小时前
Boot4升级PostConstruct不跑了专业程序开发源7 小时前
django新闻推荐系统70655-计算机课程设计、毕业设计vx_Biye_Design7 小时前
springboot一站式旅游管理平台81037-计算机课程设计、毕业设计vx_Biye_Design7 小时前
springboot宠物寄养服务预约与监管系统82684-计算机课程设计、毕业设计程序员小杰@7 小时前
Spring Boot 常用注解分类速记vx_Biye_Design7 小时前
springboot小学生英语学习APP62773-计算机课程设计、毕业设计9624568 小时前
餐饮 SaaS 优惠券系统架构演进(三):优惠计算引擎——商品级计价、冲突策略与优惠分摊