1.SpringBoot实现养老院系统
个人网站:http://xiaocaoshare.com
1.需求分析
网站前台
注册、登录、系统首页、住宿环境浏览、选护理、热门活动、简介、热门活动、会员(订单管理、密码修改、老人信息添加、老人日常)
网站管理后台
用户订单管理、护理人员管理、级别管理、住宿环境管理、老人信息管理、老人日常活动管理、轮播图管理、资讯管理、聊天等功能
2.技术架构
springboot+mybatis+mysql+html+js+css
开发工具:
IDEA或eclipse
3.部分功能代码展示
@Controller
@RequestMapping("/admin")
@Scope(“prototype”)
public class AdminController {
private static final Logger logger = LoggerFactory.getLogger(AdminController.class);
private ReturnResult returnResult = new ReturnResult();
@Resource(name = "adminService")
private IAdminService adminService;
/**
* 管理员登录
* @param admin
* @param session
* @return
*/
@RequestMapping(value = "login", method = RequestMethod.POST)
@ResponseBody
public ReturnResult login(TAdmin admin, HttpSession session) {
returnResult.setStatus(ReturnCodeType.FAILURE);
try {
admin = adminService.login(admin);
if (admin != null) {
admin.setPassword(null);
session.setAttribute("admin", admin);
returnResult.setStatus(ReturnCodeType.SUCCESS);
}
} catch (Exception e) {
logger.error("登录失败:" + e);
}
return returnResult;
}
/**
* 从session获取管理员信息
* @param session
* @return
*/
@RequestMapping(value="getAdminInfo", method = RequestMethod.POST)
@ResponseBody
public ReturnResult getAdminInfo(HttpSession session) {
returnResult.setStatus(ReturnCodeType.FAILURE);
TAdmin admin = (TAdmin) session.getAttribute("admin");
if (admin != null) {
returnResult.setStatus(ReturnCodeType.SUCCESS).setData(admin);
} else {
logger.info("获取管理员信息失败:管理员未登录");
}
return returnResult;
}
/**
* 退出
* @param session
* @return
*/
@RequestMapping(value="logout", method = RequestMethod.POST)
@ResponseBody
public ReturnResult logout(HttpSession session) {
session.invalidate();
return returnResult.setStatus(ReturnCodeType.SUCCESS);
}
}
4.系统演示
链接:https://pan.baidu.com/s/1WvjBOQqFccC67EI5DI0oxw
提取码:s9jw