计算机毕业设计 基于Web的城市旅游网站的设计与实现 Java实战项目 附源码+文档+视频讲解

发布时间:2023年12月17日

博主介绍:?从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者?
🍅文末获取源码联系🍅
👇🏻 精彩专栏推荐订阅👇🏻 不然下次找不到哟
————————————————
计算机毕业设计《1000套》?

目录

1、项目介绍及开发技术

1.1 项目介绍

1.2 开发技术

2、系统功能模块设计

3、功能截图

3.1 前台功能

3.2 后台功能

4、数据库表结构设计

5、关键代码

5.1 旅游景点Controller模块?

5.2 旅游景点Service模块?

5.3 旅游景点ServiceImpl模块

5.4 旅游景点Dao模块

6、论文目录结构

7、源码获取


1、项目介绍及开发技术

1.1 项目介绍

随着旅游业的快速发展,人们对于旅游网站的需求也越来越高。传统的旅游网站往往难以满足用户的需求,因此,我们提出了基于Web的城市旅游网站的设计与实现。传统旅游网站的界面不够美观、功能不够完善,难以满足用户的需求。因此,我们希望通过该系统的设计与实现,提升用户体验,使用户更加满意。该系统它可以帮助用户更好地了解旅游目的地,提供更加全面的旅游信息。用户可以在网站上查看旅游景点、酒店管理、特色美食、机票信息等,还可以在购物车中选择自己喜欢的商品,进行在线支付。此外,用户还可以在个人中心中查看自己的订单和收藏的商品,方便进行管理。对于管理员来说,该系统可以让他们更加方便地管理景点、酒店、特色美食等信息,提高管理效率。总之,基于Web的城市旅游网站的设计与实现,不仅可以提升用户体验,满足用户的需求,还可以提高管理员的管理效率,为旅游业的发展做出贡献。

1.2 开发技术

Java开发语言、SpringBoot、MyBatisPlus、MySQL数据库、Maven、IDEA开发工具、JDK1.8+、Vue、HTML、CSS、JS。

2、系统功能模块设计

管理员:登录、首页、个人中心(修改密码、个人信息)、用户管理、景点分类管理、旅游景点管理、酒店信息管理、特色美食管理、’机票信息管理、系统管理(轮播图管理、旅游资讯)、订单管理(已完成订单、已取消订单、已退款订单、未支付订单、已支付订单)。

用户:注册登录、首页、旅游景点、酒店管理、特色美食、机票信息、旅游咨资讯、购物车、个人中心(个人信息、我的订单、我的收藏)。

3、功能截图

3.1 前台功能

注册

登录

首页

旅游景点

酒店信息

?特色美食

机票信息

旅游资讯

购物车

个人中心

3.2 后台功能

登录

首页

个人中心

用户管理

景点分类管理

旅游景点管理

?酒店信息管理

特色美食管理

机票信息管理

?系统管理

订单管理

4、数据库表结构设计

-- MySQL dump 10.13  Distrib 5.7.31, for Linux (x86_64)
--
-- Host: localhost    Database: springboothw31x
-- ------------------------------------------------------
-- Server version	5.7.31

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Current Database: `springboothw31x`
--

/*!40000 DROP DATABASE IF EXISTS `springboothw31x`*/;

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `springboothw31x` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;

USE `springboothw31x`;

--
-- Table structure for table `aboutus`
--

DROP TABLE IF EXISTS `aboutus`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `aboutus` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `title` varchar(200) NOT NULL COMMENT '标题',
  `subtitle` varchar(200) DEFAULT NULL COMMENT '副标题',
  `content` longtext NOT NULL COMMENT '内容',
  `picture1` longtext COMMENT '图片1',
  `picture2` longtext COMMENT '图片2',
  `picture3` longtext COMMENT '图片3',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='关于我们';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `aboutus`
--

LOCK TABLES `aboutus` WRITE;
/*!40000 ALTER TABLE `aboutus` DISABLE KEYS */;
INSERT INTO `aboutus` VALUES (1,'2023-03-15 03:57:29','关于我们','ABOUT US','不管你想要怎样的生活,你都要去努力争取,不多尝试一些事情怎么知道自己适合什么、不适合什么呢?\n你说你喜欢读书,让我给你列书单,你还问我哪里有那么多时间看书;你说自己梦想的职业是广告文案,问我如何成为一个文案,应该具备哪些素质;你说你计划晨跑,但总是因为学习、工作辛苦或者身体不舒服第二天起不了床;你说你一直梦想一个人去长途旅行,但是没钱,父母觉得危险。其实,我已经厌倦了你这样说说而已的把戏,我觉得就算我告诉你如何去做,你也不会照做,因为你根本什么都不做。','upload/aboutus_picture1.jpg','upload/aboutus_picture2.jpg','upload/aboutus_picture3.jpg');
/*!40000 ALTER TABLE `aboutus` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `config`
--

DROP TABLE IF EXISTS `config`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(100) NOT NULL COMMENT '配置参数名称',
  `value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `config`
--

LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES (1,'picture1','upload/picture1.jpg'),(2,'picture2','upload/picture2.jpg'),(3,'picture3','upload/picture3.jpg');
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `jingdianfenlei`
--

DROP TABLE IF EXISTS `jingdianfenlei`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jingdianfenlei` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `jingdianfenlei` varchar(200) NOT NULL COMMENT '景点分类',
  PRIMARY KEY (`id`),
  UNIQUE KEY `jingdianfenlei` (`jingdianfenlei`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='景点分类';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `jingdianfenlei`
--

LOCK TABLES `jingdianfenlei` WRITE;
/*!40000 ALTER TABLE `jingdianfenlei` DISABLE KEYS */;
INSERT INTO `jingdianfenlei` VALUES (21,'2023-03-15 03:57:29','景点分类1'),(22,'2023-03-15 03:57:29','景点分类2'),(23,'2023-03-15 03:57:29','景点分类3'),(24,'2023-03-15 03:57:29','景点分类4'),(25,'2023-03-15 03:57:29','景点分类5'),(26,'2023-03-15 03:57:29','景点分类6'),(27,'2023-03-15 03:57:29','景点分类7'),(28,'2023-03-15 03:57:29','景点分类8');
/*!40000 ALTER TABLE `jingdianfenlei` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `jiudianxinxi`
--

DROP TABLE IF EXISTS `jiudianxinxi`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jiudianxinxi` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `jiudianmingcheng` varchar(200) NOT NULL COMMENT '酒店名称',
  `leibie` varchar(200) NOT NULL COMMENT '类别',
  `xingji` varchar(200) NOT NULL COMMENT '星级',
  `jiudiantupian` longtext COMMENT '酒店图片',
  `jiudiandizhi` varchar(200) DEFAULT NULL COMMENT '酒店地址',
  `fangjianleixing` varchar(200) DEFAULT NULL COMMENT '房间类型',
  `lianxidianhua` varchar(200) DEFAULT NULL COMMENT '联系电话',
  `jiudianjieshao` longtext COMMENT '酒店介绍',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8 COMMENT='酒店信息';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `jiudianxinxi`
--

LOCK TABLES `jiudianxinxi` WRITE;
/*!40000 ALTER TABLE `jiudianxinxi` DISABLE KEYS */;
INSERT INTO `jiudianxinxi` VALUES (41,'2023-03-15 03:57:29','酒店名称1','民宿','一星','upload/jiudianxinxi_jiudiantupian1.jpg,upload/jiudianxinxi_jiudiantupian2.jpg,upload/jiudianxinxi_jiudiantupian3.jpg','酒店地址1','单人间','13823888881','酒店介绍1'),(42,'2023-03-15 03:57:29','酒店名称2','民宿','一星','upload/jiudianxinxi_jiudiantupian2.jpg,upload/jiudianxinxi_jiudiantupian3.jpg,upload/jiudianxinxi_jiudiantupian4.jpg','酒店地址2','单人间','13823888882','酒店介绍2'),(43,'2023-03-15 03:57:29','酒店名称3','民宿','一星','upload/jiudianxinxi_jiudiantupian3.jpg,upload/jiudianxinxi_jiudiantupian4.jpg,upload/jiudianxinxi_jiudiantupian5.jpg','酒店地址3','单人间','13823888883','酒店介绍3'),(44,'2023-03-15 03:57:29','酒店名称4','民宿','一星','upload/jiudianxinxi_jiudiantupian4.jpg,upload/jiudianxinxi_jiudiantupian5.jpg,upload/jiudianxinxi_jiudiantupian6.jpg','酒店地址4','单人间','13823888884','酒店介绍4'),(45,'2023-03-15 03:57:29','酒店名称5','民宿','一星','upload/jiudianxinxi_jiudiantupian5.jpg,upload/jiudianxinxi_jiudiantupian6.jpg,upload/jiudianxinxi_jiudiantupian7.jpg','酒店地址5','单人间','13823888885','酒店介绍5'),(46,'2023-03-15 03:57:29','酒店名称6','民宿','一星','upload/jiudianxinxi_jiudiantupian6.jpg,upload/jiudianxinxi_jiudiantupian7.jpg,upload/jiudianxinxi_jiudiantupian8.jpg','酒店地址6','单人间','13823888886','酒店介绍6'),(47,'2023-03-15 03:57:29','酒店名称7','民宿','一星','upload/jiudianxinxi_jiudiantupian7.jpg,upload/jiudianxinxi_jiudiantupian8.jpg,upload/jiudianxinxi_jiudiantupian9.jpg','酒店地址7','单人间','13823888887','酒店介绍7'),(48,'2023-03-15 03:57:29','酒店名称8','民宿','一星','upload/jiudianxinxi_jiudiantupian8.jpg,upload/jiudianxinxi_jiudiantupian9.jpg,upload/jiudianxinxi_jiudiantupian10.jpg','酒店地址8','单人间','13823888888','酒店介绍8');
/*!40000 ALTER TABLE `jiudianxinxi` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `lvyoujingdian`
--

DROP TABLE IF EXISTS `lvyoujingdian`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lvyoujingdian` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `jingdianmingcheng` varchar(200) NOT NULL COMMENT '景点名称',
  `jingdiantupian` longtext COMMENT '景点图片',
  `jingdianfenlei` varchar(200) DEFAULT NULL COMMENT '景点分类',
  `jingdiandengji` varchar(200) DEFAULT NULL COMMENT '景点等级',
  `jingdiandizhi` varchar(200) DEFAULT NULL COMMENT '景点地址',
  `kaifangshijian` varchar(200) DEFAULT NULL COMMENT '开放时间',
  `lvyoutedian` longtext COMMENT '旅游特点',
  `jingdianjieshao` longtext COMMENT '景点介绍',
  `lvyouwenhua` longtext COMMENT '旅游文化',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COMMENT='旅游景点';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `lvyoujingdian`
--

LOCK TABLES `lvyoujingdian` WRITE;
/*!40000 ALTER TABLE `lvyoujingdian` DISABLE KEYS */;
INSERT INTO `lvyoujingdian` VALUES (31,'2023-03-15 03:57:29','景点名称1','upload/lvyoujingdian_jingdiantupian1.jpg,upload/lvyoujingdian_jingdiantupian2.jpg,upload/lvyoujingdian_jingdiantupian3.jpg','景点分类1','A','景点地址1','开放时间1','旅游特点1','景点介绍1','旅游文化1'),(32,'2023-03-15 03:57:29','景点名称2','upload/lvyoujingdian_jingdiantupian2.jpg,upload/lvyoujingdian_jingdiantupian3.jpg,upload/lvyoujingdian_jingdiantupian4.jpg','景点分类2','A','景点地址2','开放时间2','旅游特点2','景点介绍2','旅游文化2'),(33,'2023-03-15 03:57:29','景点名称3','upload/lvyoujingdian_jingdiantupian3.jpg,upload/lvyoujingdian_jingdiantupian4.jpg,upload/lvyoujingdian_jingdiantupian5.jpg','景点分类3','A','景点地址3','开放时间3','旅游特点3','景点介绍3','旅游文化3'),(34,'2023-03-15 03:57:29','景点名称4','upload/lvyoujingdian_jingdiantupian4.jpg,upload/lvyoujingdian_jingdiantupian5.jpg,upload/lvyoujingdian_jingdiantupian6.jpg','景点分类4','A','景点地址4','开放时间4','旅游特点4','景点介绍4','旅游文化4'),(35,'2023-03-15 03:57:29','景点名称5','upload/lvyoujingdian_jingdiantupian5.jpg,upload/lvyoujingdian_jingdiantupian6.jpg,upload/lvyoujingdian_jingdiantupian7.jpg','景点分类5','A','景点地址5','开放时间5','旅游特点5','景点介绍5','旅游文化5'),(36,'2023-03-15 03:57:29','景点名称6','upload/lvyoujingdian_jingdiantupian6.jpg,upload/lvyoujingdian_jingdiantupian7.jpg,upload/lvyoujingdian_jingdiantupian8.jpg','景点分类6','A','景点地址6','开放时间6','旅游特点6','景点介绍6','旅游文化6'),(37,'2023-03-15 03:57:29','景点名称7','upload/lvyoujingdian_jingdiantupian7.jpg,upload/lvyoujingdian_jingdiantupian8.jpg,upload/lvyoujingdian_jingdiantupian9.jpg','景点分类7','A','景点地址7','开放时间7','旅游特点7','景点介绍7','旅游文化7'),(38,'2023-03-15 03:57:29','景点名称8','upload/lvyoujingdian_jingdiantupian8.jpg,upload/lvyoujingdian_jingdiantupian9.jpg,upload/lvyoujingdian_jingdiantupian10.jpg','景点分类8','A','景点地址8','开放时间8','旅游特点8','景点介绍8','旅游文化8');
/*!40000 ALTER TABLE `lvyoujingdian` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tesemeishi`
--

DROP TABLE IF EXISTS `tesemeishi`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tesemeishi` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `meishimingcheng` varchar(200) NOT NULL COMMENT '美食名称',
  `meishileixing` varchar(200) NOT NULL COMMENT '美食类型',
  `tupian` longtext COMMENT '图片',
  `kouwei` varchar(200) DEFAULT NULL COMMENT '口味',
  `tese` varchar(200) DEFAULT NULL COMMENT '特色',
  `chengshi` varchar(200) NOT NULL COMMENT '城市',
  `dakadidian` varchar(200) DEFAULT NULL COMMENT '打卡地点',
  `renjunxiaofei` float DEFAULT NULL COMMENT '人均消费',
  `xiangqing` longtext COMMENT '详情',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COMMENT='特色美食';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tesemeishi`
--

LOCK TABLES `tesemeishi` WRITE;
/*!40000 ALTER TABLE `tesemeishi` DISABLE KEYS */;
INSERT INTO `tesemeishi` VALUES (51,'2023-03-15 03:57:29','美食名称1','小吃','upload/tesemeishi_tupian1.jpg,upload/tesemeishi_tupian2.jpg,upload/tesemeishi_tupian3.jpg','口味1','特色1','城市1','打卡地点1',1,'详情1'),(52,'2023-03-15 03:57:29','美食名称2','小吃','upload/tesemeishi_tupian2.jpg,upload/tesemeishi_tupian3.jpg,upload/tesemeishi_tupian4.jpg','口味2','特色2','城市2','打卡地点2',2,'详情2'),(53,'2023-03-15 03:57:29','美食名称3','小吃','upload/tesemeishi_tupian3.jpg,upload/tesemeishi_tupian4.jpg,upload/tesemeishi_tupian5.jpg','口味3','特色3','城市3','打卡地点3',3,'详情3'),(54,'2023-03-15 03:57:29','美食名称4','小吃','upload/tesemeishi_tupian4.jpg,upload/tesemeishi_tupian5.jpg,upload/tesemeishi_tupian6.jpg','口味4','特色4','城市4','打卡地点4',4,'详情4'),(55,'2023-03-15 03:57:29','美食名称5','小吃','upload/tesemeishi_tupian5.jpg,upload/tesemeishi_tupian6.jpg,upload/tesemeishi_tupian7.jpg','口味5','特色5','城市5','打卡地点5',5,'详情5'),(56,'2023-03-15 03:57:29','美食名称6','小吃','upload/tesemeishi_tupian6.jpg,upload/tesemeishi_tupian7.jpg,upload/tesemeishi_tupian8.jpg','口味6','特色6','城市6','打卡地点6',6,'详情6'),(57,'2023-03-15 03:57:29','美食名称7','小吃','upload/tesemeishi_tupian7.jpg,upload/tesemeishi_tupian8.jpg,upload/tesemeishi_tupian9.jpg','口味7','特色7','城市7','打卡地点7',7,'详情7'),(58,'2023-03-15 03:57:29','美食名称8','小吃','upload/tesemeishi_tupian8.jpg,upload/tesemeishi_tupian9.jpg,upload/tesemeishi_tupian10.jpg','口味8','特色8','城市8','打卡地点8',8,'详情8');
/*!40000 ALTER TABLE `tesemeishi` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `token`
--

DROP TABLE IF EXISTS `token`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `token` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `userid` bigint(20) NOT NULL COMMENT '用户id',
  `username` varchar(100) NOT NULL COMMENT '用户名',
  `tablename` varchar(100) DEFAULT NULL COMMENT '表名',
  `role` varchar(100) DEFAULT NULL COMMENT '角色',
  `token` varchar(200) NOT NULL COMMENT '密码',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  `expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='token表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `token`
--

LOCK TABLES `token` WRITE;
/*!40000 ALTER TABLE `token` DISABLE KEYS */;
INSERT INTO `token` VALUES (1,11,'用户账号1','yonghu','用户','052hy2qa4aibiltbj6u9spzsd8lwq528','2023-03-15 04:01:34','2023-03-15 05:01:35');
/*!40000 ALTER TABLE `token` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(100) NOT NULL COMMENT '用户名',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `role` varchar(100) DEFAULT '管理员' COMMENT '角色',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'admin','admin','管理员','2023-03-15 03:57:29');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `yonghu`
--

DROP TABLE IF EXISTS `yonghu`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `yonghu` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `yonghuzhanghao` varchar(200) NOT NULL COMMENT '用户账号',
  `yonghuxingming` varchar(200) NOT NULL COMMENT '用户姓名',
  `mima` varchar(200) NOT NULL COMMENT '密码',
  `xingbie` varchar(200) DEFAULT NULL COMMENT '性别',
  `touxiang` longtext COMMENT '头像',
  `lianxidianhua` varchar(200) DEFAULT NULL COMMENT '联系电话',
  PRIMARY KEY (`id`),
  UNIQUE KEY `yonghuzhanghao` (`yonghuzhanghao`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='用户';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `yonghu`
--

LOCK TABLES `yonghu` WRITE;
/*!40000 ALTER TABLE `yonghu` DISABLE KEYS */;
INSERT INTO `yonghu` VALUES (11,'2023-03-15 03:57:29','用户账号1','用户姓名1','123456','男','upload/yonghu_touxiang1.jpg','13823888881'),(12,'2023-03-15 03:57:29','用户账号2','用户姓名2','123456','男','upload/yonghu_touxiang2.jpg','13823888882'),(13,'2023-03-15 03:57:29','用户账号3','用户姓名3','123456','男','upload/yonghu_touxiang3.jpg','13823888883'),(14,'2023-03-15 03:57:29','用户账号4','用户姓名4','123456','男','upload/yonghu_touxiang4.jpg','13823888884'),(15,'2023-03-15 03:57:29','用户账号5','用户姓名5','123456','男','upload/yonghu_touxiang5.jpg','13823888885'),(16,'2023-03-15 03:57:29','用户账号6','用户姓名6','123456','男','upload/yonghu_touxiang6.jpg','13823888886'),(17,'2023-03-15 03:57:29','用户账号7','用户姓名7','123456','男','upload/yonghu_touxiang7.jpg','13823888887'),(18,'2023-03-15 03:57:29','用户账号8','用户姓名8','123456','男','upload/yonghu_touxiang8.jpg','13823888888');
/*!40000 ALTER TABLE `yonghu` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2023-03-17 10:14:11

5、关键代码

5.1 旅游景点Controller模块?

package com.controller;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.LvyoujingdianEntity;
import com.entity.view.LvyoujingdianView;

import com.service.LvyoujingdianService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;

/**
 * 旅游景点
 * 后端接口
 * @author 
 * @email 
 * @date 2023-03-15 11:57:16
 */
@RestController
@RequestMapping("/lvyoujingdian")
public class LvyoujingdianController {
    @Autowired
    private LvyoujingdianService lvyoujingdianService;

    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,LvyoujingdianEntity lvyoujingdian,
		HttpServletRequest request){
        EntityWrapper<LvyoujingdianEntity> ew = new EntityWrapper<LvyoujingdianEntity>();

		PageUtils page = lvyoujingdianService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, lvyoujingdian), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,LvyoujingdianEntity lvyoujingdian, 
		HttpServletRequest request){
        EntityWrapper<LvyoujingdianEntity> ew = new EntityWrapper<LvyoujingdianEntity>();

		PageUtils page = lvyoujingdianService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, lvyoujingdian), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( LvyoujingdianEntity lvyoujingdian){
       	EntityWrapper<LvyoujingdianEntity> ew = new EntityWrapper<LvyoujingdianEntity>();
      	ew.allEq(MPUtil.allEQMapPre( lvyoujingdian, "lvyoujingdian")); 
        return R.ok().put("data", lvyoujingdianService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(LvyoujingdianEntity lvyoujingdian){
        EntityWrapper< LvyoujingdianEntity> ew = new EntityWrapper< LvyoujingdianEntity>();
 		ew.allEq(MPUtil.allEQMapPre( lvyoujingdian, "lvyoujingdian")); 
		LvyoujingdianView lvyoujingdianView =  lvyoujingdianService.selectView(ew);
		return R.ok("查询旅游景点成功").put("data", lvyoujingdianView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        LvyoujingdianEntity lvyoujingdian = lvyoujingdianService.selectById(id);
        return R.ok().put("data", lvyoujingdian);
    }

    /**
     * 前端详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        LvyoujingdianEntity lvyoujingdian = lvyoujingdianService.selectById(id);
        return R.ok().put("data", lvyoujingdian);
    }
    
    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody LvyoujingdianEntity lvyoujingdian, HttpServletRequest request){
    	lvyoujingdian.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(lvyoujingdian);
        lvyoujingdianService.insert(lvyoujingdian);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody LvyoujingdianEntity lvyoujingdian, HttpServletRequest request){
    	lvyoujingdian.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(lvyoujingdian);
        lvyoujingdianService.insert(lvyoujingdian);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @Transactional
    public R update(@RequestBody LvyoujingdianEntity lvyoujingdian, HttpServletRequest request){
        //ValidatorUtils.validateEntity(lvyoujingdian);
        lvyoujingdianService.updateById(lvyoujingdian);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        lvyoujingdianService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<LvyoujingdianEntity> wrapper = new EntityWrapper<LvyoujingdianEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}

		int count = lvyoujingdianService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
}

5.2 旅游景点Service模块?

package com.service;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.LvyoujingdianEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.LvyoujingdianVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.LvyoujingdianView;

/**
 * 旅游景点
 *
 * @author 
 * @email 
 * @date 2023-03-15 11:57:16
 */
public interface LvyoujingdianService extends IService<LvyoujingdianEntity> {

    PageUtils queryPage(Map<String, Object> params);
    
   	List<LvyoujingdianVO> selectListVO(Wrapper<LvyoujingdianEntity> wrapper);
   	
   	LvyoujingdianVO selectVO(@Param("ew") Wrapper<LvyoujingdianEntity> wrapper);
   	
   	List<LvyoujingdianView> selectListView(Wrapper<LvyoujingdianEntity> wrapper);
   	
   	LvyoujingdianView selectView(@Param("ew") Wrapper<LvyoujingdianEntity> wrapper);
   	
   	PageUtils queryPage(Map<String, Object> params,Wrapper<LvyoujingdianEntity> wrapper);
   	
}

5.3 旅游景点ServiceImpl模块

package com.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;

import com.dao.LvyoujingdianDao;
import com.entity.LvyoujingdianEntity;
import com.service.LvyoujingdianService;
import com.entity.vo.LvyoujingdianVO;
import com.entity.view.LvyoujingdianView;

@Service("lvyoujingdianService")
public class LvyoujingdianServiceImpl extends ServiceImpl<LvyoujingdianDao, LvyoujingdianEntity> implements LvyoujingdianService {
	
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<LvyoujingdianEntity> page = this.selectPage(
                new Query<LvyoujingdianEntity>(params).getPage(),
                new EntityWrapper<LvyoujingdianEntity>()
        );
        return new PageUtils(page);
    }
    
    @Override
	public PageUtils queryPage(Map<String, Object> params, Wrapper<LvyoujingdianEntity> wrapper) {
		  Page<LvyoujingdianView> page =new Query<LvyoujingdianView>(params).getPage();
	        page.setRecords(baseMapper.selectListView(page,wrapper));
	    	PageUtils pageUtil = new PageUtils(page);
	    	return pageUtil;
 	}
    
    @Override
	public List<LvyoujingdianVO> selectListVO(Wrapper<LvyoujingdianEntity> wrapper) {
 		return baseMapper.selectListVO(wrapper);
	}
	
	@Override
	public LvyoujingdianVO selectVO(Wrapper<LvyoujingdianEntity> wrapper) {
 		return baseMapper.selectVO(wrapper);
	}
	
	@Override
	public List<LvyoujingdianView> selectListView(Wrapper<LvyoujingdianEntity> wrapper) {
		return baseMapper.selectListView(wrapper);
	}

	@Override
	public LvyoujingdianView selectView(Wrapper<LvyoujingdianEntity> wrapper) {
		return baseMapper.selectView(wrapper);
	}
}

5.4 旅游景点Dao模块

package com.dao;

import com.entity.LvyoujingdianEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;

import org.apache.ibatis.annotations.Param;
import com.entity.vo.LvyoujingdianVO;
import com.entity.view.LvyoujingdianView;

/**
 * 旅游景点
 * 
 * @author 
 * @email 
 * @date 2023-03-15 11:57:16
 */
public interface LvyoujingdianDao extends BaseMapper<LvyoujingdianEntity> {
	
	List<LvyoujingdianVO> selectListVO(@Param("ew") Wrapper<LvyoujingdianEntity> wrapper);
	
	LvyoujingdianVO selectVO(@Param("ew") Wrapper<LvyoujingdianEntity> wrapper);
	
	List<LvyoujingdianView> selectListView(@Param("ew") Wrapper<LvyoujingdianEntity> wrapper);

	List<LvyoujingdianView> selectListView(Pagination page,@Param("ew") Wrapper<LvyoujingdianEntity> wrapper);
	
	LvyoujingdianView selectView(@Param("ew") Wrapper<LvyoujingdianEntity> wrapper);
	
}

6、论文目录结构

7、源码获取

感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!

喜欢文章可以点赞、收藏、关注、评论

获取源码请私信

文章来源:https://blog.csdn.net/m0_74181697/article/details/134983482
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。