基于SpringBoot+Bootstrap的旅游管理系统的设计与实现

目录

前言

 一、技术栈

二、系统功能介绍

登录模块的实现

景点信息管理界面

订票信息管理界面

用户评价管理界面

用户管理界面

景点资讯界面

系统主界面

用户注册界面

景点信息详情界面

订票信息界面

三、核心代码

1、登录模块

 2、文件上传模块

3、代码封装


前言

随着旅游业的迅速发展,传统的旅游信息查询方式,已经无法满足用户需求,因此,结合计算机技术的优势和普及,针对常州旅游,特开发了本基于Bootstrap的常州地方旅游管理系统。

本论文首先对常州地方旅游管理系统进行需求分析,从系统开发环境、系统目标、设计流程、功能设计等几个方面进行系统的总体设计,开发出本基于Bootstrap的常州地方旅游管理系统,主要实现了用户功能模块和管理员功能模块两大部分,用户可查看景点信息、景点资讯等,注册登录后可进行景点订票操作,同时管理员可进入系统后台对系统进行全面管理操作。通过对系统的功能进行测试,测试结果证明该系统界面友好、功能完善,有着较高的使用价值,具有庞大的潜在用户群体和较广阔的应用前景。

本常州地方旅游管理系统基于Springboot+Bootstrap框架、JAVA编程语言、MYSQL数据库开发完成,“操作简单,功能实用”这是本软件设计的核心理念,本系统力求创造最好的用户体验。

 一、技术栈

末尾获取源码
SpringBoot+Vue+JS+ jQuery+Ajax...

二、系统功能介绍

登录模块的实现

用户要想进入本系统,必须通过正确的用户名和密码,选择登录类型进行登录操作,在登录时系统会以用户名、密码和登录类型为参数进行登录信息的验证,信息正确则登录进入对应用户功能界面可进行功能处理,反之登录失败。

景点信息管理界面

管理员可添加、修改和删除景点信息信息。

 

订票信息管理界面

管理员可查看所有订票信息,并可的前进行修改和删除操作。

用户评价管理界面

管理员可查看用户评价信息,并可对其进行审核、修改和删除操作

 

用户管理界面

管理员可查看、添加、修改和删除用户信息

景点资讯界面

管理员可增删改查景点资讯信息

 

系统主界面

用户进入本系统可查看系统信息,包括网站首页、景点信息以及景点资讯等

用户注册界面

未有账号的用户可进入注册界面进行注册操作

 

景点信息详情界面

用户可选择景点信息查看景点信息详情信息,登录后可进行订票操作。

订票信息界面

用户可查看个人订票信息,并可选择进行支付或者评价操作。

 

三、核心代码

1、登录模块

 
package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

 2、文件上传模块

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{@Autowiredprivate ConfigService configService;/*** 上传文件*/@RequestMapping("/upload")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);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));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()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/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);}}

3、代码封装

package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回数据*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知异常,请联系管理员");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}

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

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

相关文章

【Go】rsrc不是内部或外部命令、无法将“rsrc”项识别为 cmdlet、函数、脚本文件或可运行程序的名称 解决方法

前言 想尝试用go创建一个桌面应用程序&#xff0c;然后查了下决定用 walk。 我们要先下载walk&#xff0c;这里 官方链接 按照官方文档&#xff0c;我们先用go get命令下载。 go get github.com/lxn/walk然后分别创建好了 main.go、main.manifest 文件&#xff0c;代码如下…

vue event bus 事件总线

vue event bus 事件总线 创建 工程&#xff1a; H:\java_work\java_springboot\vue_study ctrl按住不放 右键 悬着 powershell H:\java_work\java_springboot\js_study\Vue2_3入门到实战-配套资料\01-随堂代码素材\day04\准备代码\08-事件总线-扩展 vue --version vue crea…

uniapp 微信小程序之隐私协议开发

uniapp 微信小程序之隐私协议开发 官网通知&#xff1a;https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html 1、配置 __usePrivacyCheck__: true&#xff1b;位置 manifest.json : "mp-weixin":{"__usePrivacyCh…

Linux发行版X华为鲲鹏openEuler

前言 作为硬件和软件之间的桥梁&#xff0c;我接触的最多的就是Windows和Centos&#xff0c;还记得最初的鸟哥的Linux私房菜&#xff0c;而Centos即将停止维护更新&#xff08;Centos7维护到2024&#xff09;&#xff0c;对于个人学习来说没有任何影响&#xff0c;但是对于企业…

SEO方案尝试--Nuxtjs项目基础配置

Nuxtjs 最新版 Nuxt3 项目配置 安装nuxtjs 最新版 Nuxt3 参考官网安装安装插件安装ElementPlus页面怎么跳转&#xff0c;路由怎么实现404页面该怎么配置配置 网页的title 安装nuxtjs 最新版 Nuxt3 参考官网安装 安装插件 安装ElementPlus 安装 Element Plus 和图标库 # 首先&…

高效实时!麒麟信安操作系统(嵌入式版)V3来了,为工业领域数智化转型夯实安全底座

随着万物互联和工业领域数智化时代的到来&#xff0c;嵌入式应用日益广泛&#xff0c;嵌入式系统技术已成为促进智能制造快速发展的关键要素之一。麒麟信安作为国产操作系统领军企业&#xff0c;始终走在行业前列&#xff0c;本次发布的麒麟信安操作系统&#xff08;嵌入式版&a…

【小笔记】fasttext文本分类问题分析

【学而不思则罔&#xff0c;思维不学则怠】 2023.9.28 关于fasttext的原理及实战文章很多&#xff0c;我也尝试在自己的任务中进行使用&#xff0c;是一个典型的短文本分类任务&#xff0c;对知识图谱抽取的实体进行校验&#xff0c;判断实体类别是否正确&#xff0c;我构建了…

配置OSPFv3基本功能 华为笔记

1.1 实验介绍 1.1.1 关于本实验 OSPF协议是为IP协议提供路由功能的路由协议。OSPFv2&#xff08;OSPF版本2&#xff09;是支持IPv4的路由协议&#xff0c;为了让OSPF协议支持IPv6&#xff0c;技术人员开发了OSPFv3&#xff08;OSPF版本3&#xff09;。 无论是OSPFv2还是OSPFv…

AI项目十一:Swin Transformer训练

若该文为原创文章&#xff0c;转载请注明原文出处。 续上一篇&#xff0c;训练自己的数据集&#xff0c;并测试。 一、安装标注软件labelme # 安装labelme pip install labelme # 启动 labelme 这里数据集准本&#xff0c;标注图片数据过程自己探索。 最后文件结构如下&…

sentinel-dashboard-1.8.0.jar开机自启动脚本

启动阿里巴巴的流控组件控制面板需要运行一个jar包&#xff0c;通常需要运行如下命令&#xff1a; java -server -Xms4G -Xmx4G -Dserver.port8080 -Dcsp.sentinel.dashboard.server127.0.0.1:8080 -Dproject.namesentinel-dashboard -jar sentinel-dashboard-1.8.0.jar &…

HTML - input type=file 允许用户选择多个文件

效果 示例 <!DOCTYPE html> <html><head><meta charset"utf-8"><title></title></head><body><!-- When the multiple Boolean attribute is specified, the file input allows the user to select more than o…

再生之术:遗忘 Root 密码的 CentOS8 Stream 解决方案

文章目录 大魔头 RootGRUB 引导界面BootLoaderGRUB主要功能选择启动的操作系统编辑内核启动参数 进入GRUB 引导界面编辑内核启动参数单用户模式 进入内核编辑界面rd.break进入单用户模式 大魔头 Root 哈哈&#xff0c;你好&#xff01;今天&#xff0c;让我们来聊聊 Linux 系统…

Linux 端口

查看端口占用 1、使用nmap命令查看端口的占用情况 安装nmap&#xff1a;yum -y install nmap 语法&#xff1a;nmap 被查看的IP地址 可以看到&#xff0c;本机&#xff08;127.0.0.1&#xff09;上有7个端口现在被程序占用了。 2、使用netstat命令查看指定端口的占用情况 语…

小程序如何设置余额充值

在小程序中设置余额充值是一种非常有效的方式&#xff0c;可以帮助商家吸引更多的会员并提高用户的消费频率。下面将介绍如何在小程序中设置余额充值并使用。 第一步&#xff1a;创建充值方案 在小程序管理员后台->营销管理->余额充值页面&#xff0c;添加充值方案。可…

Python爬虫实战案例——第六例

文章中所有内容仅供学习交流使用&#xff0c;不用于其他任何目的&#xff01;严禁将文中内容用于任何商业与非法用途&#xff0c;由此产生的一切后果与作者无关。若有侵权&#xff0c;请联系删除。 目标&#xff1a;去哪儿网指定城市人气值最高的15个景点评论数据采集 地址&a…

ThreeJS-3D教学二:基础形状展示

three中提供了22 个基础模型&#xff0c;此案例除了 EdgesGeometry、ExtrudeGeometry、TextGeometry、WireframeGeometry&#xff0c;涵盖 17 个形状。 Fog 雾化设置&#xff0c;这是scene场景效果EdgesGeometry , WireframeGeometry 更多地可能作为辅助功能去查看几何体的边和…

学校安全用电管理系统解决方案

随着科技的发展和进步&#xff0c;电力已成为我们日常生活和学习的重要支柱。然而&#xff0c;电力的使用也带来了一定的安全风险。特别是对于学校这个复杂而又活跃的环境&#xff0c;安全用电管理系统的角色显得尤为重要。 一、学校用电管理系统的现状 目前&#xff0…

26593-2011 无损检测仪器 工业用X射线CT装置性能测试方法

声明 本文是学习GB-T 26593-2011 无损检测仪器 工业用X射线CT装置性能测试方法. 而整理的学习笔记,分享出来希望更多人受益,如果存在侵权请及时联系我们 1 范围 本标准规定了工业用X 射线CT 装置(以下简称CT 装置)性能测试的术语、定义、缩略语以及空间 分辨力、密度分辨率…

linux 防火墙iptables

iptables 是 Linux 中比较底层的网络服务&#xff0c;它控制了 Linux 系统中的网络操作&#xff0c;CentOS 中的 firewalld 和 Ubuntu 中的 ufw 都是在 iptables 之上构建的&#xff0c;只为了简化 iptables 的操作。同时&#xff0c;iptables 不仅仅是防火墙这么简单&#xff…

Mysql8安装+重装的数据备份方法【提供Mysql8.0.27版本的压缩包】

文章目录 Mysql8压缩安装包下载安装流程压缩包解压配置环境变量 初始化数据库连接数据库修改密码Mysql重装/重装系统 的数据库备份方法数据备份数据还原 Mysql8压缩安装包下载 压缩包下载路径 安装流程 压缩包解压 首先将压缩包解压&#xff0c;下图是解压之后的文件目录&a…