基于SSM开发餐饮业点餐系统java源码

基于SSM开发餐饮业点餐系统java源码

基于SSM开发餐饮业点餐系统


开发环境: Windows操作系统
开发工具: MyEclipse+Jdk+Tomcat+MySql数据库

运行效果图

 

 

 

 

 

 

 

 

 

 

 

 

 

@ResponseBody
@RequestMapping(value = "/checkUsername")
public String checkUsername(String username){
User user=userService.findByUsername(username);

if(user==null){
//允许注册
return "1";
}else{
//不允许注册
return "0";
}

}

/**
* 保存用户
* @return
*/
@RequestMapping(value = "/saveUser")
public ModelAndView saveUser(User user,HttpServletRequest request) {
ModelAndView view = new ModelAndView();
boolean flag=userService.saveUser(user);
request.getSession().setAttribute("user", user);
if(flag==true){
//允许注册
if(user.getStatus()==1){
view.setViewName("user/empInfoRegister");
}else{
view.setViewName("user/comInfoRegister");
}

}else{
//不允许注册
view.setViewName("user/comRegister");
}


return view;
}
@ResponseBody
@RequestMapping(value = "/updateUserInfo")
public String updateUserInfo(User user){
boolean flag=userService.updateUser(user);

if(flag){
Subject currentUser = SecurityUtils.getSubject();
currentUser.getSession().setAttribute("user", user);
return "1";
}else{
//不允许注册
return "0";
}


}

 

 

 

 

 

源码及原文链接:https://javadao.xyz/forum.php?mod=viewthread&tid=74