源码获取:俺的博客首页 "资源" 里下载!
项目介绍
基于SSM的小区失物招领
角色:管理员、物业、失主
小区失物招领网站的主要使用者分为管理员;个人中心、业主管理、失主管理、物品类型管理、失物展示管理、失物认领管理、在线投诉管理、论坛交流、系统管理,
业主;个人中心、失物展示管理、失物认领管理、在线投诉管理、我的收藏管理,前台首页;首页、失物展示、论坛信息、新闻资讯、我的、跳转到后台、客服,
失主;个人中心、失物认领管理、我的收藏管理等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.是否Maven项目: 否;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目
6.数据库:MySql 5.7/8.0等版本均可;
技术栈
后端:SSM(Spring+SpringMVC+Mybatis)
前端:JSP+CSS+JS+JQUERY+Layui
使用说明
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;
3. 将项目中db.xml配置文件中的数据库配置改为自己的配置,然后运行;
![](https://i-blog.csdnimg.cn/blog_migrate/85afd0ba324e9d4b7a0cf479730bce36.png)
![](https://i-blog.csdnimg.cn/blog_migrate/932c6db7bacf90deb907741e0532782c.png)
![](https://i-blog.csdnimg.cn/blog_migrate/ffc3ae5b19a98c7495cc8036e3790ad7.png)
![](https://i-blog.csdnimg.cn/blog_migrate/b7e307010a726c670b4b89315e271acf.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e9262df690962b063880345aa5a2891b.png)
用户管理控制层:
@Controller
@RequestMapping("/user")
public class UserCenterController {
@Autowired
private UserCenterService userCenterService;
@RequestMapping("/centerUI")
public String centerUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("user", user);
return "center/user-center";
}
@RequestMapping("/centerEditUI")
public String centerEditUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("user", user);
return "center/user-center-edit";
}
@RequestMapping("/centerEdit")
@ResponseBody
public Result centerEdit(Model model, User user) {
return userCenterService.centerEdit(user);
}
@RequestMapping("/centerEditPWUI")
public String centerEditPWUI(Model model, HttpServletRequest request) {
User user = userCenterService.getUser(request);
model.addAttribute("id", user.getId());
return "center/user-center-editpw";
}
@RequestMapping("/centerEditPW")
@ResponseBody
public Result centerEditPW(HttpServletRequest request, HttpServletResponse response, Model model, @RequestParam("id") String id, @RequestParam("oldPassword") String oldPassword, @RequestParam("newPassword") String newPassword) {
return userCenterService.centerEditPW(request, response, id, oldPassword, newPassword);
}
}
系统管理控制层:
@Controller
@RequestMapping("/system")
public class SystemController {
@Autowired
private SystemService systemService;
@RequestMapping("")
public String loginUI() {
return "system/login/login";
}
@RequestMapping("/login")
@ResponseBody
public Result login(SysUser sysUser, HttpServletResponse response) {
return systemService.login(sysUser,response);
}
@RequestMapping("/userListUI")
public String userListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<User> page = systemService.getUserPage(pageable);
model.addAttribute("page",page);
return "system/user/list";
}
@RequestMapping("/saveUser")
@ResponseBody
public Result saveUser(User user) {
return systemService.saveUser(user);
}
@RequestMapping("/getUserById")
@ResponseBody
public Result getUserById(String id) {
return ResultGenerator.genSuccessResult(systemService.getUserById(id));
}
@RequestMapping("/logout")
public String logout(HttpServletRequest request, HttpServletResponse response) {
systemService.logout(request,response);
return "redirect:/system";
}
@RequestMapping("/hotelListUI")
public String hotelListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<Hotel> page = systemService.getHotelPage(pageable);
model.addAttribute("page", page);
return "system/hotel/list";
}
@RequestMapping("/saveHotel")
@ResponseBody
public Result saveHotel(Hotel hotel) {
return systemService.saveHotel(hotel);
}
@RequestMapping("/updateStatus")
@ResponseBody
public Result updateStatus(String id) {
return systemService.updateStatus(id);
}
@RequestMapping("/getHotelById")
@ResponseBody
public Result getHotelById(String id) {
return ResultGenerator.genSuccessResult(systemService.getHotelById(id));
}
@RequestMapping("/attractionsListUI")
public String attractionsListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<Attractions> page = systemService.getAttractionsPage(pageable);
model.addAttribute("page", page);
return "system/attractions/list";
}
@RequestMapping("/getAttractionsById")
@ResponseBody
public Result getAttractionsById(String id) {
return ResultGenerator.genSuccessResult(systemService.getAttractionsById(id));
}
@RequestMapping("/updateAttractionsStatus")
@ResponseBody
public Result updateAttractionsStatus(String id) {
return systemService.updateAttractionsStatus(id);
}
@RequestMapping("/saveAttractions")
@ResponseBody
public Result saveAttractions(Attractions attractions) {
return systemService.saveAttractions(attractions);
}
@RequestMapping("/travelRouteListUI")
public String travelRouteListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<TravelRoute> page = systemService.getTravelRoutePage(pageable);
model.addAttribute("page", page);
return "system/route/list";
}
@RequestMapping("/getTravelRouteById")
@ResponseBody
public Result getTravelRouteById(String id) {
return ResultGenerator.genSuccessResult(systemService.getTravelRouteById(id));
}
@RequestMapping("/updateTravelRouteStatus")
@ResponseBody
public Result updateTravelRouteStatus(String id) {
return systemService.updateTravelRouteStatus(id);
}
@RequestMapping("/saveTravelRoute")
@ResponseBody
public Result saveTravelRoute(TravelRoute travelRoute) {
return systemService.saveTravelRoute(travelRoute);
}
@RequestMapping("/travelStrategyListUI")
public String travelStrategyListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
Page<TravelStrategy> page = systemService.getTravelStrategyPage(pageable);
model.addAttribute("page", page);
return "system/strategy/list";
}
@RequestMapping("/getTravelStrategyById")
@ResponseBody
public Result getTravelStrategyById(String id) {
return ResultGenerator.genSuccessResult(systemService.getTravelStrategyById(id));
}
@RequestMapping("/updateTravelStrategyStatus")
@ResponseBody
public Result updateTravelStrategyStatus(String id) {
return systemService.updateTravelStrategyStatus(id);
}
@RequestMapping("/saveTravelStrategy")
@ResponseBody
public Result saveTravelStrategy(HttpServletRequest request,TravelStrategy travelStrategy) {
return systemService.saveTravelStrategy(request,travelStrategy);
}
}
登录管理控制层:
@Controller
public class LoginController {
@Autowired
private LoginService loginService;
@RequestMapping("/loginUI")
public String loginUI() {
return "login/index-login";
}
@RequestMapping("/login")
@ResponseBody
public Result login(Model model, User user, HttpServletResponse response) {
return loginService.login(user, response);
}
@RequestMapping("/logout")
public String logout(HttpServletRequest request, HttpServletResponse response) {
loginService.logout(request, response);
//SpringMVC重定向
return "redirect:/";
}
@RequestMapping("/registerUI")
public String registerUI() {
return "login/index-register";
}
@RequestMapping("/register")
@ResponseBody
public Result register(Model model, User user) {
return loginService.register(user);
}
}