• Java项目:失物招领管理系统(java+SSM+HTML+JavaScript+jsp+mysql)


    源码获取:俺的博客首页 "资源" 里下载!

    项目介绍

    主要功能包括:
    用户发布失物,或者招领失物,管理员对用户,失物信息进行增删改查。

    环境需要

    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.数据库:MySql 5.7版本;


    技术栈

    1. 后端:Spring+SpringMVC+Mybatis
    2. 前端:HTML+CSS+JavaScript+jsp


    使用说明

    1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
    2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
    3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
    4. 运行项目,输入localhost:8080/ 登录

     

     

     

     

     

    用户管理控制层:

    1. @Controller
    2. @RequestMapping("/user")
    3. public class UserCenterController {
    4. @Autowired
    5. private UserCenterService userCenterService;
    6. @RequestMapping("/centerUI")
    7. public String centerUI(Model model, HttpServletRequest request) {
    8. User user = userCenterService.getUser(request);
    9. model.addAttribute("user", user);
    10. return "center/user-center";
    11. }
    12. @RequestMapping("/centerEditUI")
    13. public String centerEditUI(Model model, HttpServletRequest request) {
    14. User user = userCenterService.getUser(request);
    15. model.addAttribute("user", user);
    16. return "center/user-center-edit";
    17. }
    18. @RequestMapping("/centerEdit")
    19. @ResponseBody
    20. public Result centerEdit(Model model, User user) {
    21. return userCenterService.centerEdit(user);
    22. }
    23. @RequestMapping("/centerEditPWUI")
    24. public String centerEditPWUI(Model model, HttpServletRequest request) {
    25. User user = userCenterService.getUser(request);
    26. model.addAttribute("id", user.getId());
    27. return "center/user-center-editpw";
    28. }
    29. @RequestMapping("/centerEditPW")
    30. @ResponseBody
    31. public Result centerEditPW(HttpServletRequest request, HttpServletResponse response, Model model, @RequestParam("id") String id, @RequestParam("oldPassword") String oldPassword, @RequestParam("newPassword") String newPassword) {
    32. return userCenterService.centerEditPW(request, response, id, oldPassword, newPassword);
    33. }
    34. }

    系统管理控制层:

    1. @Controller
    2. @RequestMapping("/system")
    3. public class SystemController {
    4. @Autowired
    5. private SystemService systemService;
    6. @RequestMapping("")
    7. public String loginUI() {
    8. return "system/login/login";
    9. }
    10. @RequestMapping("/login")
    11. @ResponseBody
    12. public Result login(SysUser sysUser, HttpServletResponse response) {
    13. return systemService.login(sysUser,response);
    14. }
    15. @RequestMapping("/userListUI")
    16. public String userListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
    17. Page<User> page = systemService.getUserPage(pageable);
    18. model.addAttribute("page",page);
    19. return "system/user/list";
    20. }
    21. @RequestMapping("/saveUser")
    22. @ResponseBody
    23. public Result saveUser(User user) {
    24. return systemService.saveUser(user);
    25. }
    26. @RequestMapping("/getUserById")
    27. @ResponseBody
    28. public Result getUserById(String id) {
    29. return ResultGenerator.genSuccessResult(systemService.getUserById(id));
    30. }
    31. @RequestMapping("/logout")
    32. public String logout(HttpServletRequest request, HttpServletResponse response) {
    33. systemService.logout(request,response);
    34. return "redirect:/system";
    35. }
    36. @RequestMapping("/hotelListUI")
    37. public String hotelListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
    38. Page<Hotel> page = systemService.getHotelPage(pageable);
    39. model.addAttribute("page", page);
    40. return "system/hotel/list";
    41. }
    42. @RequestMapping("/saveHotel")
    43. @ResponseBody
    44. public Result saveHotel(Hotel hotel) {
    45. return systemService.saveHotel(hotel);
    46. }
    47. @RequestMapping("/updateStatus")
    48. @ResponseBody
    49. public Result updateStatus(String id) {
    50. return systemService.updateStatus(id);
    51. }
    52. @RequestMapping("/getHotelById")
    53. @ResponseBody
    54. public Result getHotelById(String id) {
    55. return ResultGenerator.genSuccessResult(systemService.getHotelById(id));
    56. }
    57. @RequestMapping("/attractionsListUI")
    58. public String attractionsListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
    59. Page<Attractions> page = systemService.getAttractionsPage(pageable);
    60. model.addAttribute("page", page);
    61. return "system/attractions/list";
    62. }
    63. @RequestMapping("/getAttractionsById")
    64. @ResponseBody
    65. public Result getAttractionsById(String id) {
    66. return ResultGenerator.genSuccessResult(systemService.getAttractionsById(id));
    67. }
    68. @RequestMapping("/updateAttractionsStatus")
    69. @ResponseBody
    70. public Result updateAttractionsStatus(String id) {
    71. return systemService.updateAttractionsStatus(id);
    72. }
    73. @RequestMapping("/saveAttractions")
    74. @ResponseBody
    75. public Result saveAttractions(Attractions attractions) {
    76. return systemService.saveAttractions(attractions);
    77. }
    78. @RequestMapping("/travelRouteListUI")
    79. public String travelRouteListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
    80. Page<TravelRoute> page = systemService.getTravelRoutePage(pageable);
    81. model.addAttribute("page", page);
    82. return "system/route/list";
    83. }
    84. @RequestMapping("/getTravelRouteById")
    85. @ResponseBody
    86. public Result getTravelRouteById(String id) {
    87. return ResultGenerator.genSuccessResult(systemService.getTravelRouteById(id));
    88. }
    89. @RequestMapping("/updateTravelRouteStatus")
    90. @ResponseBody
    91. public Result updateTravelRouteStatus(String id) {
    92. return systemService.updateTravelRouteStatus(id);
    93. }
    94. @RequestMapping("/saveTravelRoute")
    95. @ResponseBody
    96. public Result saveTravelRoute(TravelRoute travelRoute) {
    97. return systemService.saveTravelRoute(travelRoute);
    98. }
    99. @RequestMapping("/travelStrategyListUI")
    100. public String travelStrategyListUI(Model model, @PageableDefault(size = 10) Pageable pageable) {
    101. Page<TravelStrategy> page = systemService.getTravelStrategyPage(pageable);
    102. model.addAttribute("page", page);
    103. return "system/strategy/list";
    104. }
    105. @RequestMapping("/getTravelStrategyById")
    106. @ResponseBody
    107. public Result getTravelStrategyById(String id) {
    108. return ResultGenerator.genSuccessResult(systemService.getTravelStrategyById(id));
    109. }
    110. @RequestMapping("/updateTravelStrategyStatus")
    111. @ResponseBody
    112. public Result updateTravelStrategyStatus(String id) {
    113. return systemService.updateTravelStrategyStatus(id);
    114. }
    115. @RequestMapping("/saveTravelStrategy")
    116. @ResponseBody
    117. public Result saveTravelStrategy(HttpServletRequest request,TravelStrategy travelStrategy) {
    118. return systemService.saveTravelStrategy(request,travelStrategy);
    119. }
    120. }

    登录管理控制层:

    1. @Controller
    2. public class LoginController {
    3. @Autowired
    4. private LoginService loginService;
    5. @RequestMapping("/loginUI")
    6. public String loginUI() {
    7. return "login/index-login";
    8. }
    9. @RequestMapping("/login")
    10. @ResponseBody
    11. public Result login(Model model, User user, HttpServletResponse response) {
    12. return loginService.login(user, response);
    13. }
    14. @RequestMapping("/logout")
    15. public String logout(HttpServletRequest request, HttpServletResponse response) {
    16. loginService.logout(request, response);
    17. //SpringMVC重定向
    18. return "redirect:/";
    19. }
    20. @RequestMapping("/registerUI")
    21. public String registerUI() {
    22. return "login/index-register";
    23. }
    24. @RequestMapping("/register")
    25. @ResponseBody
    26. public Result register(Model model, User user) {
    27. return loginService.register(user);
    28. }
    29. }

    源码获取:俺的博客首页 "资源" 里下载! 

  • 相关阅读:
    一篇文章教你Pytest快速入门和基础讲解,一定要看
    Nacos究竟是什么
    第十一章 Windows特权升级
    Docker安装MySQL详细步骤
    你把 vite打包 玩明白
    SRS视频服务器-docker部署srs4.0:带SRT功能
    阿帽的小狗
    JavaScript函数的使用
    什么是自动化决策
    AI新能量!FortiGate NGFW面向数据中心全面集成FortiGuard AI 安全服务
  • 原文地址:https://blog.csdn.net/m0_66863468/article/details/124877636