计算机毕业设计 智能推荐旅游平台 Java+SpringBoot+Vue 前后端分离 文档报告 代码讲解 安装调试

news2024/9/20 18:26:22

🍊作者:计算机编程-吉哥
🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。
🍊心愿:点赞 👍 收藏 ⭐评论 📝
🍅 文末获取源码联系

👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
Java毕业设计项目~热门选题推荐《1000套》

目录

1.技术选型

2.开发工具

3.功能

3.1【角色】

3.2【前端功能模块】

3.3【后端功能模块】

4.项目演示截图

4.1 首页

4.2 景点信息

4.3 景点详情

4.4 注册

4.5 旅游路线

4.6 建议反馈

4.7 景点信息管理

4.8 旅游路线管理

5.核心代码

5.1拦截器

5.2分页工具类

5.3文件上传下载

5.4前端请求

6.LW文档大纲参考


背景意义介绍:

在旅游行业快速发展的今天,智能推荐旅游平台作为一种新兴的旅游服务模式,对于满足个性化旅游需求、提升旅游体验、优化旅游资源配置具有重要的现实意义。

本文介绍的智能推荐旅游平台,采用Java作为后端开发语言,结合SpringBoot框架,确保了服务端应用的高效性和稳定性。前端则利用Vue.js技术,为用户提供了直观、易用的交互界面。平台服务于管理员和用户两种角色,提供了全面的服务和管理功能。用户可以通过平台查看景点信息、旅游路线推荐,并在个人中心管理收藏和反馈建议。管理员则可以通过系统进行用户管理、景点信息管理、旅游路线管理和建议反馈管理。

后端管理模块为管理员提供了包括系统用户管理、系统管理、景点信息管理、旅游路线管理等在内的强大工具集。这些功能的实现,不仅提高了旅游服务的组织和执行效率,也为用户带来了便捷的旅游规划体验。

智能推荐旅游平台的实现,有助于构建一个个性化、智能化的旅游服务环境,促进旅游资源的有效利用,同时通过数据分析和用户反馈机制,持续优化旅游服务。总之,该平台对于推动旅游行业的创新发展、提升旅游服务的质量和效率具有重要的战略意义。

1.技术选型

springboot、mybatisplus、vue、elementui、html、css、js、mysql、jdk1.8

2.开发工具

idea、navicat

3.功能

3.1【角色】

管理员、用户

3.2【前端功能模块】

  • 登录
  • 注册
  • 首页
  • 景点信息
  • 旅游路线
  • 个人中心(个人中心、修改密码、我的收藏管理、反馈建议管理)

3.3【后端功能模块】

  • 登录
  • 系统用户管理(管理员、用户)
  • 系统管理(轮播图、网站介绍)
  • 景点信息管理
  • 旅游路线管理
  • 建议反馈管理

4.项目演示截图

4.1 首页

4.2 景点信息

4.3 景点详情

4.4 注册

4.5 旅游路线

4.6 建议反馈

4.7 景点信息管理

4.8 旅游路线管理

5.核心代码

5.1拦截器

package com.interceptor;
 
import com.alibaba.fastjson.JSONObject;
import com.annotation.IgnoreAuth;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.R;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
 
/**
 * 权限(Token)验证
 */
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
 
    public static final String LOGIN_TOKEN_KEY = "Token";
 
    @Autowired
    private TokenService tokenService;
    
	@Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
 
		//支持跨域请求
        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
        response.setHeader("Access-Control-Max-Age", "3600");
        response.setHeader("Access-Control-Allow-Credentials", "true");
        response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
        response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
	// 跨域时会首先发送一个OPTIONS请求,这里我们给OPTIONS请求直接返回正常状态
	if (request.getMethod().equals(RequestMethod.OPTIONS.name())) {
        	response.setStatus(HttpStatus.OK.value());
            return false;
        }
        
        IgnoreAuth annotation;
        if (handler instanceof HandlerMethod) {
            annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
        } else {
            return true;
        }
 
        //从header中获取token
        String token = request.getHeader(LOGIN_TOKEN_KEY);
        
        /**
         * 不需要验证权限的方法直接放过
         */
        if(annotation!=null) {
        	return true;
        }
        
        TokenEntity tokenEntity = null;
        if(StringUtils.isNotBlank(token)) {
        	tokenEntity = tokenService.getTokenEntity(token);
        }
        
        if(tokenEntity != null) {
        	request.getSession().setAttribute("userId", tokenEntity.getUserid());
        	request.getSession().setAttribute("role", tokenEntity.getRole());
        	request.getSession().setAttribute("tableName", tokenEntity.getTablename());
        	request.getSession().setAttribute("username", tokenEntity.getUsername());
        	return true;
        }
        
		PrintWriter writer = null;
		response.setCharacterEncoding("UTF-8");
		response.setContentType("application/json; charset=utf-8");
		try {
		    writer = response.getWriter();
		    writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
		} finally {
		    if(writer != null){
		        writer.close();
		    }
		}
		return false;
    }
}

5.2分页工具类

 
package com.utils;
 
import java.io.Serializable;
import java.util.List;
import java.util.Map;
 
import com.baomidou.mybatisplus.plugins.Page;
 
/**
 * 分页工具类
 */
public class PageUtils implements Serializable {
	private static final long serialVersionUID = 1L;
	//总记录数
	private long total;
	//每页记录数
	private int pageSize;
	//总页数
	private long totalPage;
	//当前页数
	private int currPage;
	//列表数据
	private List<?> list;
	
	/**
	 * 分页
	 * @param list        列表数据
	 * @param totalCount  总记录数
	 * @param pageSize    每页记录数
	 * @param currPage    当前页数
	 */
	public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) {
		this.list = list;
		this.total = totalCount;
		this.pageSize = pageSize;
		this.currPage = currPage;
		this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
	}
 
	/**
	 * 分页
	 */
	public PageUtils(Page<?> page) {
		this.list = page.getRecords();
		this.total = page.getTotal();
		this.pageSize = page.getSize();
		this.currPage = page.getCurrent();
		this.totalPage = page.getPages();
	}
	
	/*
	 * 空数据的分页
	 */
	public PageUtils(Map<String, Object> params) {
 		Page page =new Query(params).getPage();
		new PageUtils(page);
	}
 
	 
	public int getPageSize() {
		return pageSize;
	}
 
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
 
	public int getCurrPage() {
		return currPage;
	}
 
	public void setCurrPage(int currPage) {
		this.currPage = currPage;
	}
 
	public List<?> getList() {
		return list;
	}
 
	public void setList(List<?> list) {
		this.list = list;
	}
 
	public long getTotalPage() {
		return totalPage;
	}
 
	public void setTotalPage(long totalPage) {
		this.totalPage = totalPage;
	}
 
	public long getTotal() {
		return total;
	}
 
	public void setTotal(long total) {
		this.total = total;
	}
	
}

5.3文件上传下载

package com.controller;
 
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
 
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
 
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;
 
/**
 * 上传文件映射表
 */
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	/**
	 * 上传文件
	 */
	@RequestMapping("/upload")
    @IgnoreAuth
	public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
		File path = new File(ResourceUtils.getURL("classpath:static").getPath());
		if(!path.exists()) {
		    path = new File("");
		}
		File upload = new File(path.getAbsolutePath(),"/upload/");
		if(!upload.exists()) {
		    upload.mkdirs();
		}
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(upload.getAbsolutePath()+"/"+fileName);
		file.transferTo(dest);
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
			if(configEntity==null) {
				configEntity = new ConfigEntity();
				configEntity.setName("faceFile");
				configEntity.setValue(fileName);
			} else {
				configEntity.setValue(fileName);
			}
			configService.insertOrUpdate(configEntity);
		}
		return R.ok().put("file", fileName);
	}
	
	/**
	 * 下载文件
	 */
	@IgnoreAuth
	@RequestMapping("/download")
	public ResponseEntity<byte[]> download(@RequestParam String fileName) {
		try {
			File path = new File(ResourceUtils.getURL("classpath:static").getPath());
			if(!path.exists()) {
			    path = new File("");
			}
			File upload = new File(path.getAbsolutePath(),"/upload/");
			if(!upload.exists()) {
			    upload.mkdirs();
			}
			File file = new File(upload.getAbsolutePath()+"/"+fileName);
			if(file.exists()){
 
				HttpHeaders headers = new HttpHeaders();
			    headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    
			    headers.setContentDispositionFormData("attachment", fileName);    
			    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
	}
	
}

5.4前端请求

import axios from 'axios'
import router from '@/router/router-static'
import storage from '@/utils/storage'
 
const http = axios.create({
    timeout: 1000 * 86400,
    withCredentials: true,
    baseURL: '/furniture',
    headers: {
        'Content-Type': 'application/json; charset=utf-8'
    }
})
// 请求拦截
http.interceptors.request.use(config => {
    config.headers['Token'] = storage.get('Token') // 请求头带上token
    return config
}, error => {
    return Promise.reject(error)
})
// 响应拦截
http.interceptors.response.use(response => {
    if (response.data && response.data.code === 401) { // 401, token失效
        router.push({ name: 'login' })
    }
    return response
}, error => {
    return Promise.reject(error)
})
export default http

6.LW文档大纲参考

 具体LW如何写法,可以咨询博主,耐心分享!

你可能还有感兴趣的项目👇🏻👇🏻👇🏻

更多项目推荐:计算机毕业设计项目

如果大家有任何疑虑,请在下方咨询或评论

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2123812.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Java 每日一刊(第3期):Hello World

文章目录 前言Hello World程序是如何执行的Hello World 里有什么本期小知识 阳光洒进窗台&#xff0c;花香伴着书香&#xff0c;静谧而温暖&#xff0c;仿佛时光停驻。 前言 这里是分享 Java 相关内容的专刊&#xff0c;每日一更。 本期将为大家带来以下内容&#xff1a; “…

MFC工控项目实例之十三从文件读写板卡信号名称

承接专栏《MFC工控项目实例之十二板卡测试信号输出界面》 1、在BoardTest.h文件中添加代码 class CBoardTest : public CDialog {public:CBoardTest(CWnd* pParent NULL); // standard constructor... CString NO_Combox[16]; CString strTemp[16];//数据项名称 CString st…

Sentinel 使用案例详细教程

文章目录 一、Sentinel 使用1.1 Sentinel 客户端1.2 Sentinel 控制台1.3 客户端和控制台的通信所需依赖 二、测试 Sentinel 限流规则2.1 启动配置2.2 定义限流资源2.3 配置流量控制规则2.4 运行项目 三、 测试 Sentinel 熔断降级规则3.1 定义资源3.2 配置熔断降级规则3.3 运行项…

[Postman]接口自动化测试入门

文章大多用作个人学习分享&#xff0c;如果大家觉得有不足或错漏的地方欢迎评论指出或补充 此文章将完整的走一遍一个web页面的接口测试流程 大致路径为&#xff1a; 创建集合->调用接口登录获取token->保存token->带着token去完成其他接口的自动化测试->断言-&g…

信息架构的战略视角:驱动数字化转型的设计原则与实践创新

在数字经济快速发展的今天&#xff0c;企业的成功越来越依赖于其信息架构的稳健性和灵活性 数字化转型不仅要求技术创新&#xff0c;更需要架构设计上的深思熟虑。《信息架构&#xff1a;商业智能&分析与元数据管理参考模型》作为信息架构领域的权威指南&#xff0c;为企业…

走心式精密数控车床

当然&#xff0c;让我来为您深入解析一下“走心式精密数控车床”这一话题。一、定义与概述 走心式精密数控车床&#xff0c;也被称为走心式数控车床或走心机&#xff0c;是一种高精度、高效率的金属加工设备。它以其独特的走心式加工方式和精密的数控技术&#xff0c;在精密机械…

基于JAVA+SpringBoot+Vue的中药实验管理系统

基于JAVASpringBootVue的中药实验管理系统 前言 ✌全网粉丝20W,csdn特邀作者、博客专家、CSDN[新星计划]导师、java领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ &#x1f345;文末附源码下载链接&#x1f345; 哈…

【2024】Math-Shepherd:无需人工注释即可逐步验证和强化法学硕士。

搜索词&#xff1a; Math-shepherd: Verify and reinforce llms step-by-step without human annotations P Wang, L Li, Z Shao, R Xu, D Dai, Y Li, D Chen, Y Wu, Z Sui Proceedings of the 62nd Annual Meeting of the Association for …, 2024•aclanthology.org 摘要…

Vue3.0项目实战(四)——大事件管理系统个人中心实现

目录 1. ChatGPT & Copilot 1.1 工具 Github Copilot 智能生成代码的使用 2. 个人中心项目实战 - 基本资料 2.1 静态结构 2.2 校验处理 2.3 封装接口&#xff0c;更新个人信息 3. 个人中心项目实战 - 更换头像 3.1 静态结构 3.2 选择预览图片 3.3 上传头像 4. 个…

国产化数据库挑战及发展趋势

非国产数据库如Oracle、MySQL和MSSQL等在某些领域占据重要地位&#xff0c;但国产数据库的市场份额正在逐步提升&#xff0c;特别是在政策支持和市场需求的双重推动下&#xff0c;国产数据库的替代进程正在加速。 一、国产数据库市场规模 2024年中国数据库市场规模预计为543.1亿…

Excel数据清洗工具:提高数据处理效率的利器

Excel数据清洗工具&#xff1a;提高数据处理效率的利器 引言 在当今的数据驱动时代&#xff0c;数据的质量直接影响着分析结果的可靠性和有效性。然而&#xff0c;在实际工作中&#xff0c;我们常常会遇到数据中的各种问题&#xff0c;如重复记录、缺失值、格式不一致等。为了…

NISP 一级 | 3.3 网络安全防护与实践

关注这个证书的其他相关笔记&#xff1a;NISP 一级 —— 考证笔记合集-CSDN博客 0x01&#xff1a;虚拟专用网络 VPN 概述 虚拟专用网络&#xff08;Virtual Private Network&#xff0c;VPN&#xff09;是在公用网络上建立专用网络的技术。整个 VPN 网络的任意两个节点之间的连…

Python | Leetcode Python题解之第397题整数替换

题目&#xff1a; 题解&#xff1a; class Solution:def integerReplacement(self, n: int) -> int:ans 0while n ! 1:if n % 2 0:ans 1n // 2elif n % 4 1:ans 2n // 2else:if n 3:ans 2n 1else:ans 2n n // 2 1return ans

游戏领域的AI革命:从静态世界到动态玩家体验

在当今的数字化时代,游戏已经成为连接虚拟与现实世界的桥梁。开放世界游戏以其无与伦比的自由度和沉浸感吸引了无数玩家,但同时也面临着对话重复、行为可预测和互动有限等问题。本文将探讨AI技术如何通过程序化生成、动态NPC、实时行为生成以及声音与音乐等方面的应用,为游戏…

Android 知识简记 快速回顾各种知识

2.Java 基础&容器&同步&设计模式 3.Java 虚拟机&内存结构&GC&类加载&四种引用&动态代理 4.Android 基础&性能优化&Framwork 5.Android 模块化&热修复&热更新&打包&混淆&压缩 6.音视频&FFmpeg&播放器 …

创游系列开心娱乐完整组件

别人分享的一套东西&#xff0c;是个不错的娱乐源码&#xff0c;里面包含了很多小游戏。可以创建房间。 没测试自行研究吧&#xff0c;内含搭建教程。 代码免费下载&#xff1a;百度网盘

Java | Leetcode Java题解之第397题整数替换

题目&#xff1a; 题解&#xff1a; class Solution {public int integerReplacement(int n) {int ans 0;while (n ! 1) {if (n % 2 0) {ans;n / 2;} else if (n % 4 1) {ans 2;n / 2;} else {if (n 3) {ans 2;n 1;} else {ans 2;n n / 2 1;}}}return ans;} }

3D Gaussian Splatting 论文学习

概述 目前比较常见的渲染方法大致可以分为2种&#xff1a; 将场景中的物体投影到渲染平面&#xff1a;传统的渲染管线就是这种方式&#xff0c;主要针对Mesh数据&#xff0c;可以将顶点直接投影成2D的形式&#xff0c;配合光栅化、深度测试、Alpha混合等就可以得到渲染的图像…

【Java基础】——深入理解Java异常

目录 1- 什么是异常概述&#xff08;What、Why&#xff09;1-1 什么是异常(What)1-2 为什么要有异常处理机制(Why) 2- ⭐异常体系结构图-总览2-1 分类2-2 异常体系结构小结 3- 五大运行时异常3-1 NullPointerException 空指针异常3-2 ArithmeticException 算数异常3-3 ArrayInd…

HPL 源码结构分析

文件夹结构&#xff1a; $ cd /home/hipper/ex_hpl_hpcg/ $ pwd $ mkdir ./openmpi $mkdir ./openblas $mkdir ./hpl $ tree 1. 安装openmpi 1.1.1 使用Makefile下载配置编译安装 openmpi Makefile&#xff1a; all:wget https://download.open-mpi.org/release/open-m…