摘 要
信息化社会内需要与之针对性的信息获取途径,但是途径的扩展基本上为人们所努力的方向,由于站在的角度存在偏差,人们经常能够获得不同类型信息,这也是技术最为难以攻克的课题。针对旅游等问题,对旅游网站进行研究分析,然后开发设计出旅游网站以解决问题。
旅游网站主要功能模块包括个人中心、用户管理、景点信息、景点购票、酒店信息、酒店预订,采取面对对象的开发模式进行软件的开发和硬体的架设,能很好的满足实际使用的需求,完善了对应的软体架设以及程序编码的工作,采取Mysql作为后台数据的主要存储单元,采用ssm框架、Java技术进行业务系统的编码及其开发,实现了本系统的全部功能。本次报告,首先分析了研究的背景、作用、意义,为研究工作的合理性打下了基础。针对旅游网站的各项需求以及技术问题进行分析,证明了系统的必要性和技术可行性,然后对设计系统需要使用的技术软件以及设计思想做了基本的介绍,最后来实现旅游网站和部署运行使用它。
关键词:旅游网站;ssm框架;Mysql数据库
``
package com.power.travel.controller; import com.power.travel.core.Result; import com.power.travel.service.StrategyService; import com.power.travel.model.TravelStrategy; import com.power.travel.model.UserStrategy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.web.PageableDefault; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import java.util.List; @Controller @RequestMapping("/strategy") public class StrategyController { @Autowired private StrategyService strategyService; @RequestMapping("/travelStrategyListUI") public String travelStrategyListUI(Model model, @ModelAttribute("searchName") String searchName, @PageableDefault(size = 10) Pageable pageable) { Page<TravelStrategy> page = strategyService.TravelStrategyListUI(searchName, pageable); List<TravelStrategy> top10Strategy = strategyService.findTop10Strategy(); model.addAttribute("top10Strategy", top10Strategy); model.addAttribute("page", page); return "strategy/travelStrategy"; } @RequestMapping("/travelStrategyDetailsUI") public String travelStrategyDetailsUI(Model model, HttpServletRequest request, @RequestParam(name = "id") String id) { TravelStrategy travelStrategy = strategyService.findTravelStrategyById(id); //如果用户显示已经关注,就是查看关注列表 Boolean flag = strategyService.isStrategy(request, id); List<TravelStrategy> top10Strategy = strategyService.findTop10Strategy(); model.addAttribute("top10Strategy", top10Strategy); model.addAttribute("travelStrategy", travelStrategy); model.addAttribute("flag", flag); return "strategy/travelStrategy-details"; } @RequestMapping("/cancelTravelStrategyReserve") @ResponseBody public Result cancelTravelStrategyReserve(HttpServletRequest request, String id) { return strategyService.cancelTravelStrategyReserve(request, id); } @RequestMapping("/strategyManageUI") public String strategyManageUI(Model model, HttpServletRequest request) { List<UserStrategy> userStrategyList = strategyService.getTravelStrategyByUser(request); List<TravelStrategy> top10Strategy = strategyService.findTop10Strategy(); model.addAttribute("top10Strategy", top10Strategy); model.addAttribute("userStrategyList", userStrategyList); return "strategy/strategy-manage"; } @RequestMapping("/saveTravelStrategy") @ResponseBody public Result saveTravelStrategy(HttpServletRequest request, TravelStrategy travelStrategy) { return strategyService.saveTravelStrategy(request, travelStrategy); } @RequestMapping("/pushStrategyListUI") public String pushStrategyListUI(HttpServletRequest request, Model model, @ModelAttribute("searchName") String searchName, @PageableDefault(size = 10) Pageable pageable) { Page<TravelStrategy> page = strategyService.PushStrategyListUI(request,searchName, pageable); List<TravelStrategy> top10Strategy = strategyService.findTop10Strategy(); model.addAttribute("top10Strategy", top10Strategy); model.addAttribute("page", page); return "strategy/pushStrategy"; } } y); model.addAttribute("page", page); return "strategy/pushStrategy"; } }
开发工具:idea、Navicat
数据库:MySQL8.0
环境配置:jdk1.8 、Tomcat8.5