博主介绍:✌从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌
🍅文末获取源码联系🍅
👇🏻 精彩专栏推荐订阅👇🏻 不然下次找不到哟
————————————————
目录
一.前言介绍及开发技术
利用电脑网络的这些便利,发展一套在线预约导游系统,将会给人们生活带来更多方便,而在经济效能上,也必然会有很大的方便!这样可以节省大量的时间和金钱。此次管理系统的关键技术和架构由B/S结构、java、uniapp和mysql数据库,是本系统的关键开发技术,对系统的整体、数据库、功能模块、系统页面以及系统程序等设计进行了详细的研究与规划。
二.功能设计
本文提出了一种基于面向对象的思想方法,以适应系统的实际功能与性能要求。为了使在线预约导游管理更具自动化和亲和力,在对在线预约导游进行简单的需求分析之后,将其分为三大功能模块,分别为管理员、用户和导游。该系统主要完成了个人信息修改,对系统首页、个人中心、用户管理、导游管理、旅游心得管理、旅游景点管理、旅游线路管理、预约订单管理、系统管理等功能进行管理。方便了管理员随时随地,只要电脑联网,就能对在线预约导游进行管理。同时,用户还可以方便快捷查询旅游心得信息。
三.功能截图
当人们打开系统的网址后,首先看到的就是首页界面。在这里,人们能够看到系统的导航条,通过导航条导航进入各功能展示页面进行操作。
系统注册:在系统注册页面的输入栏中输入用户注册信息进行注册操作。
旅游心得:在旅游心得页面的输入栏中输入标题和导游姓名进行查询,可以查看到旅游心得详细信息,并根据需要进行评论或收藏操作。
旅游景点:在旅游景点页面的输入栏中输入景点名称和景点分类进行查询,可以查看到旅游景点详细信息,并根据需要进行评论或收藏操作,
系统公告:在系统公告页面的输入栏中输入标题进行查询,可以查看到系统公告详情详细信息。
个人中心:在个人中心页面通过填写个人详细信息进行信息更新操作,还可以对我的收藏进行详细操作。
后台用户登录,在登录页面选择需要登录的角色,在正确输入用户名和密码后,进入操作系统进行操作。
管理员进入主页面,主要功能包括对系统首页、个人中心、用户管理、导游管理、旅游心得管理、旅游景点管理、旅游线路管理、预约订单管理、系统管理等进行操作。
管理员点击用户管理。在用户页面输入用户名进行查询、新增或删除用户列表,并根据需要对用户详情信息进行详情、修改或删除操作。
管理员点击导游管理。在导游页面输入导游证号、导游姓名、选择导游等级和旅行社进行查询、新增或删除导游列表,并根据需要对导游详情信息进行详情、修改、查看评论或删除操作。
管理员点击旅游景点管理。在旅游景点页面输入景点名称和选择景点分类进行查询、新增或删除旅游景点列表,并根据需要对旅游景点详情信息进行详情、修改、查看评论或删除操作。
管理员点击旅游线路管理。在旅游线路页面输入路线名称、景点名称、景点地址、起点和终点进行查询或删除旅游线路列表,并根据需要对旅游线路详情信息进行详情、修改、查看评论或删除操作。
管理员点击系统管理。在系统公告页面输入标题进行查询、新增或删除系统公告列表,并根据需要对系统公告详情信息进行详情、修改或删除操作;还可以对关于我们、轮播图管理和系统简介进行详细操作。
导游进入系统可以对系统首页、个人中心、旅游心得管理、旅游线路管理、预约订单管理等功能进行操作。
用户进入系统可以对系统首页、个人中心、预约订单管理等功能进行操作。
四.数据库表结构设计
- 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-05-10 11:48:46','关于我们','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 `daoyou`
- --
-
- DROP TABLE IF EXISTS `daoyou`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `daoyou` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `daoyouzhenghao` varchar(200) DEFAULT NULL COMMENT '导游证号',
- `daoyouxingming` varchar(200) DEFAULT NULL COMMENT '导游姓名',
- `zhaopian` longtext COMMENT '照片',
- `mima` varchar(200) DEFAULT NULL COMMENT '密码',
- `xingbie` varchar(200) DEFAULT NULL COMMENT '性别',
- `nianling` varchar(200) DEFAULT NULL COMMENT '年龄',
- `daoyoudengji` varchar(200) DEFAULT NULL COMMENT '导游等级',
- `daoyouyuzhong` varchar(200) DEFAULT NULL COMMENT '导游语种',
- `lvxingshe` varchar(200) DEFAULT NULL COMMENT '旅行社',
- `lianxidianhua` varchar(200) DEFAULT NULL COMMENT '联系电话',
- PRIMARY KEY (`id`),
- UNIQUE KEY `daoyouzhenghao` (`daoyouzhenghao`)
- ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='导游';
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Dumping data for table `daoyou`
- --
-
- LOCK TABLES `daoyou` WRITE;
- /*!40000 ALTER TABLE `daoyou` DISABLE KEYS */;
- INSERT INTO `daoyou` VALUES (21,'2023-05-10 11:48:45','导游证号1','导游姓名1','upload/daoyou_zhaopian1.jpg','123456','男','年龄1','初级','导游语种1','旅行社1','13823888881'),(22,'2023-05-10 11:48:45','导游证号2','导游姓名2','upload/daoyou_zhaopian2.jpg','123456','男','年龄2','初级','导游语种2','旅行社2','13823888882'),(23,'2023-05-10 11:48:45','导游证号3','导游姓名3','upload/daoyou_zhaopian3.jpg','123456','男','年龄3','初级','导游语种3','旅行社3','13823888883'),(24,'2023-05-10 11:48:45','导游证号4','导游姓名4','upload/daoyou_zhaopian4.jpg','123456','男','年龄4','初级','导游语种4','旅行社4','13823888884'),(25,'2023-05-10 11:48:45','导游证号5','导游姓名5','upload/daoyou_zhaopian5.jpg','123456','男','年龄5','初级','导游语种5','旅行社5','13823888885'),(26,'2023-05-10 11:48:45','导游证号6','导游姓名6','upload/daoyou_zhaopian6.jpg','123456','男','年龄6','初级','导游语种6','旅行社6','13823888886'),(27,'2023-05-10 11:48:45','导游证号7','导游姓名7','upload/daoyou_zhaopian7.jpg','123456','男','年龄7','初级','导游语种7','旅行社7','13823888887'),(28,'2023-05-10 11:48:45','导游证号8','导游姓名8','upload/daoyou_zhaopian8.jpg','123456','男','年龄8','初级','导游语种8','旅行社8','13823888888');
- /*!40000 ALTER TABLE `daoyou` ENABLE KEYS */;
- UNLOCK TABLES;
-
- --
- -- Table structure for table `discussdaoyou`
- --
-
- DROP TABLE IF EXISTS `discussdaoyou`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `discussdaoyou` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `refid` bigint(20) NOT NULL COMMENT '关联表id',
- `userid` bigint(20) NOT NULL COMMENT '用户id',
- `avatarurl` longtext COMMENT '头像',
- `nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
- `content` longtext NOT NULL COMMENT '评论内容',
- `reply` longtext COMMENT '回复内容',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='导游评论表';
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Dumping data for table `discussdaoyou`
- --
-
- LOCK TABLES `discussdaoyou` WRITE;
- /*!40000 ALTER TABLE `discussdaoyou` DISABLE KEYS */;
- /*!40000 ALTER TABLE `discussdaoyou` ENABLE KEYS */;
- UNLOCK TABLES;
-
- --
- -- Table structure for table `discusslvyoujingdian`
- --
-
- DROP TABLE IF EXISTS `discusslvyoujingdian`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `discusslvyoujingdian` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `refid` bigint(20) NOT NULL COMMENT '关联表id',
- `userid` bigint(20) NOT NULL COMMENT '用户id',
- `avatarurl` longtext COMMENT '头像',
- `nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
- `content` longtext NOT NULL COMMENT '评论内容',
- `reply` longtext COMMENT '回复内容',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='旅游景点评论表';
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Dumping data for table `discusslvyoujingdian`
- --
-
- LOCK TABLES `discusslvyoujingdian` WRITE;
- /*!40000 ALTER TABLE `discusslvyoujingdian` DISABLE KEYS */;
- /*!40000 ALTER TABLE `discusslvyoujingdian` ENABLE KEYS */;
- UNLOCK TABLES;
-
- --
- -- Table structure for table `discusslvyouxianlu`
- --
-
- DROP TABLE IF EXISTS `discusslvyouxianlu`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `discusslvyouxianlu` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `refid` bigint(20) NOT NULL COMMENT '关联表id',
- `userid` bigint(20) NOT NULL COMMENT '用户id',
- `avatarurl` longtext COMMENT '头像',
- `nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
- `content` longtext NOT NULL COMMENT '评论内容',
- `reply` longtext COMMENT '回复内容',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='旅游线路评论表';
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Dumping data for table `discusslvyouxianlu`
- --
-
- LOCK TABLES `discusslvyouxianlu` WRITE;
- /*!40000 ALTER TABLE `discusslvyouxianlu` DISABLE KEYS */;
- /*!40000 ALTER TABLE `discusslvyouxianlu` ENABLE KEYS */;
- UNLOCK TABLES;
-
- --
- -- Table structure for table `discusslvyouxinde`
- --
-
- DROP TABLE IF EXISTS `discusslvyouxinde`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `discusslvyouxinde` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `refid` bigint(20) NOT NULL COMMENT '关联表id',
- `userid` bigint(20) NOT NULL COMMENT '用户id',
- `avatarurl` longtext COMMENT '头像',
- `nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
- `content` longtext NOT NULL COMMENT '评论内容',
- `reply` longtext COMMENT '回复内容',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='旅游心得评论表';
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Dumping data for table `discusslvyouxinde`
- --
-
- LOCK TABLES `discusslvyouxinde` WRITE;
- /*!40000 ALTER TABLE `discusslvyouxinde` DISABLE KEYS */;
- /*!40000 ALTER TABLE `discusslvyouxinde` 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=79 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 (71,'2023-05-10 11:48:46','景点分类1'),(72,'2023-05-10 11:48:46','景点分类2'),(73,'2023-05-10 11:48:46','景点分类3'),(74,'2023-05-10 11:48:46','景点分类4'),(75,'2023-05-10 11:48:46','景点分类5'),(76,'2023-05-10 11:48:46','景点分类6'),(77,'2023-05-10 11:48:46','景点分类7'),(78,'2023-05-10 11:48:46','景点分类8');
- /*!40000 ALTER TABLE `jingdianfenlei` 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 '景点名称',
- `jingdianfenlei` varchar(200) DEFAULT NULL COMMENT '景点分类',
- `jingdiantupian` longtext COMMENT '景点图片',
- `jingdiandengji` varchar(200) DEFAULT NULL COMMENT '景点等级',
- `chengshi` varchar(200) DEFAULT NULL COMMENT '城市',
- `jutidizhi` varchar(200) DEFAULT NULL COMMENT '具体地址',
- `menpiaojiage` varchar(200) DEFAULT NULL COMMENT '门票价格',
- `jingdianjieshao` longtext COMMENT '景点介绍',
- `kaifangshijian` varchar(200) DEFAULT NULL COMMENT '开放时间',
- `zhuyishixiang` 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 `lvyoujingdian`
- --
-
- LOCK TABLES `lvyoujingdian` WRITE;
- /*!40000 ALTER TABLE `lvyoujingdian` DISABLE KEYS */;
- INSERT INTO `lvyoujingdian` VALUES (41,'2023-05-10 11:48:46','景点名称1','景点分类1','upload/lvyoujingdian_jingdiantupian1.jpg,upload/lvyoujingdian_jingdiantupian2.jpg,upload/lvyoujingdian_jingdiantupian3.jpg','A','城市1','具体地址1','门票价格1','景点介绍1','开放时间1','注意事项1'),(42,'2023-05-10 11:48:46','景点名称2','景点分类2','upload/lvyoujingdian_jingdiantupian2.jpg,upload/lvyoujingdian_jingdiantupian3.jpg,upload/lvyoujingdian_jingdiantupian4.jpg','A','城市2','具体地址2','门票价格2','景点介绍2','开放时间2','注意事项2'),(43,'2023-05-10 11:48:46','景点名称3','景点分类3','upload/lvyoujingdian_jingdiantupian3.jpg,upload/lvyoujingdian_jingdiantupian4.jpg,upload/lvyoujingdian_jingdiantupian5.jpg','A','城市3','具体地址3','门票价格3','景点介绍3','开放时间3','注意事项3'),(44,'2023-05-10 11:48:46','景点名称4','景点分类4','upload/lvyoujingdian_jingdiantupian4.jpg,upload/lvyoujingdian_jingdiantupian5.jpg,upload/lvyoujingdian_jingdiantupian6.jpg','A','城市4','具体地址4','门票价格4','景点介绍4','开放时间4','注意事项4'),(45,'2023-05-10 11:48:46','景点名称5','景点分类5','upload/lvyoujingdian_jingdiantupian5.jpg,upload/lvyoujingdian_jingdiantupian6.jpg,upload/lvyoujingdian_jingdiantupian7.jpg','A','城市5','具体地址5','门票价格5','景点介绍5','开放时间5','注意事项5'),(46,'2023-05-10 11:48:46','景点名称6','景点分类6','upload/lvyoujingdian_jingdiantupian6.jpg,upload/lvyoujingdian_jingdiantupian7.jpg,upload/lvyoujingdian_jingdiantupian8.jpg','A','城市6','具体地址6','门票价格6','景点介绍6','开放时间6','注意事项6'),(47,'2023-05-10 11:48:46','景点名称7','景点分类7','upload/lvyoujingdian_jingdiantupian7.jpg,upload/lvyoujingdian_jingdiantupian8.jpg,upload/lvyoujingdian_jingdiantupian9.jpg','A','城市7','具体地址7','门票价格7','景点介绍7','开放时间7','注意事项7'),(48,'2023-05-10 11:48:46','景点名称8','景点分类8','upload/lvyoujingdian_jingdiantupian8.jpg,upload/lvyoujingdian_jingdiantupian9.jpg,upload/lvyoujingdian_jingdiantupian10.jpg','A','城市8','具体地址8','门票价格8','景点介绍8','开放时间8','注意事项8');
- /*!40000 ALTER TABLE `lvyoujingdian` ENABLE KEYS */;
- UNLOCK TABLES;
-
- --
- -- Table structure for table `lvyouxianlu`
- --
-
- DROP TABLE IF EXISTS `lvyouxianlu`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `lvyouxianlu` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `xianlumingcheng` varchar(200) NOT NULL COMMENT '线路名称',
- `jingdianmingcheng` varchar(200) NOT NULL COMMENT '景点名称',
- `jingdiandizhi` varchar(200) DEFAULT NULL COMMENT '景点地址',
- `xianlutupian` longtext COMMENT '线路图片',
- `qidian` varchar(200) DEFAULT NULL COMMENT '起点',
- `tujingluduan` varchar(200) DEFAULT NULL COMMENT '途径路段',
- `zhongdian` varchar(200) DEFAULT NULL COMMENT '终点',
- `jiaotongfangshi` varchar(200) DEFAULT NULL COMMENT '交通方式',
- `daoyouzhenghao` varchar(200) DEFAULT NULL COMMENT '导游证号',
- `daoyouxingming` varchar(200) DEFAULT NULL COMMENT '导游姓名',
- `xianluxiangqing` 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 `lvyouxianlu`
- --
-
- LOCK TABLES `lvyouxianlu` WRITE;
- /*!40000 ALTER TABLE `lvyouxianlu` DISABLE KEYS */;
- INSERT INTO `lvyouxianlu` VALUES (51,'2023-05-10 11:48:46','线路名称1','景点名称1','景点地址1','upload/lvyouxianlu_xianlutupian1.jpg,upload/lvyouxianlu_xianlutupian2.jpg,upload/lvyouxianlu_xianlutupian3.jpg','起点1','途径路段1','终点1','交通方式1','导游证号1','导游姓名1','线路详情1'),(52,'2023-05-10 11:48:46','线路名称2','景点名称2','景点地址2','upload/lvyouxianlu_xianlutupian2.jpg,upload/lvyouxianlu_xianlutupian3.jpg,upload/lvyouxianlu_xianlutupian4.jpg','起点2','途径路段2','终点2','交通方式2','导游证号2','导游姓名2','线路详情2'),(53,'2023-05-10 11:48:46','线路名称3','景点名称3','景点地址3','upload/lvyouxianlu_xianlutupian3.jpg,upload/lvyouxianlu_xianlutupian4.jpg,upload/lvyouxianlu_xianlutupian5.jpg','起点3','途径路段3','终点3','交通方式3','导游证号3','导游姓名3','线路详情3'),(54,'2023-05-10 11:48:46','线路名称4','景点名称4','景点地址4','upload/lvyouxianlu_xianlutupian4.jpg,upload/lvyouxianlu_xianlutupian5.jpg,upload/lvyouxianlu_xianlutupian6.jpg','起点4','途径路段4','终点4','交通方式4','导游证号4','导游姓名4','线路详情4'),(55,'2023-05-10 11:48:46','线路名称5','景点名称5','景点地址5','upload/lvyouxianlu_xianlutupian5.jpg,upload/lvyouxianlu_xianlutupian6.jpg,upload/lvyouxianlu_xianlutupian7.jpg','起点5','途径路段5','终点5','交通方式5','导游证号5','导游姓名5','线路详情5'),(56,'2023-05-10 11:48:46','线路名称6','景点名称6','景点地址6','upload/lvyouxianlu_xianlutupian6.jpg,upload/lvyouxianlu_xianlutupian7.jpg,upload/lvyouxianlu_xianlutupian8.jpg','起点6','途径路段6','终点6','交通方式6','导游证号6','导游姓名6','线路详情6'),(57,'2023-05-10 11:48:46','线路名称7','景点名称7','景点地址7','upload/lvyouxianlu_xianlutupian7.jpg,upload/lvyouxianlu_xianlutupian8.jpg,upload/lvyouxianlu_xianlutupian9.jpg','起点7','途径路段7','终点7','交通方式7','导游证号7','导游姓名7','线路详情7'),(58,'2023-05-10 11:48:46','线路名称8','景点名称8','景点地址8','upload/lvyouxianlu_xianlutupian8.jpg,upload/lvyouxianlu_xianlutupian9.jpg,upload/lvyouxianlu_xianlutupian10.jpg','起点8','途径路段8','终点8','交通方式8','导游证号8','导游姓名8','线路详情8');
- /*!40000 ALTER TABLE `lvyouxianlu` ENABLE KEYS */;
- UNLOCK TABLES;
-
- --
- -- Table structure for table `lvyouxinde`
- --
-
- DROP TABLE IF EXISTS `lvyouxinde`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `lvyouxinde` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `biaoti` varchar(200) NOT NULL COMMENT '标题',
- `jingdianmingcheng` varchar(200) DEFAULT NULL COMMENT '景点名称',
- `fengmian` longtext COMMENT '封面',
- `daoyouzhenghao` varchar(200) DEFAULT NULL COMMENT '导游证号',
- `daoyouxingming` varchar(200) DEFAULT NULL COMMENT '导游姓名',
- `fabushijian` datetime DEFAULT NULL COMMENT '发布时间',
- `jianjie` longtext COMMENT '简介',
- `shipin` longtext COMMENT '视频',
- `neirong` longtext COMMENT '内容',
- `clicktime` datetime DEFAULT NULL COMMENT '最近点击时间',
- `clicknum` int(11) DEFAULT '0' 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 `lvyouxinde`
- --
-
- LOCK TABLES `lvyouxinde` WRITE;
- /*!40000 ALTER TABLE `lvyouxinde` DISABLE KEYS */;
- INSERT INTO `lvyouxinde` VALUES (31,'2023-05-10 11:48:45','标题1','景点名称1','upload/lvyouxinde_fengmian1.jpg,upload/lvyouxinde_fengmian2.jpg,upload/lvyouxinde_fengmian3.jpg','导游证号1','导游姓名1','2023-05-10 19:48:45','简介1','','内容1','2023-05-10 19:48:45',1),(32,'2023-05-10 11:48:45','标题2','景点名称2','upload/lvyouxinde_fengmian2.jpg,upload/lvyouxinde_fengmian3.jpg,upload/lvyouxinde_fengmian4.jpg','导游证号2','导游姓名2','2023-05-10 19:48:45','简介2','','内容2','2023-05-10 19:48:45',2),(33,'2023-05-10 11:48:45','标题3','景点名称3','upload/lvyouxinde_fengmian3.jpg,upload/lvyouxinde_fengmian4.jpg,upload/lvyouxinde_fengmian5.jpg','导游证号3','导游姓名3','2023-05-10 19:48:45','简介3','','内容3','2023-05-10 19:48:45',3),(34,'2023-05-10 11:48:45','标题4','景点名称4','upload/lvyouxinde_fengmian4.jpg,upload/lvyouxinde_fengmian5.jpg,upload/lvyouxinde_fengmian6.jpg','导游证号4','导游姓名4','2023-05-10 19:48:45','简介4','','内容4','2023-05-10 19:48:45',4),(35,'2023-05-10 11:48:45','标题5','景点名称5','upload/lvyouxinde_fengmian5.jpg,upload/lvyouxinde_fengmian6.jpg,upload/lvyouxinde_fengmian7.jpg','导游证号5','导游姓名5','2023-05-10 19:48:45','简介5','','内容5','2023-05-10 19:48:45',5),(36,'2023-05-10 11:48:45','标题6','景点名称6','upload/lvyouxinde_fengmian6.jpg,upload/lvyouxinde_fengmian7.jpg,upload/lvyouxinde_fengmian8.jpg','导游证号6','导游姓名6','2023-05-10 19:48:45','简介6','','内容6','2023-05-10 19:48:45',6),(37,'2023-05-10 11:48:45','标题7','景点名称7','upload/lvyouxinde_fengmian7.jpg,upload/lvyouxinde_fengmian8.jpg,upload/lvyouxinde_fengmian9.jpg','导游证号7','导游姓名7','2023-05-10 19:48:45','简介7','','内容7','2023-05-10 19:48:45',7),(38,'2023-05-10 11:48:45','标题8','景点名称8','upload/lvyouxinde_fengmian8.jpg,upload/lvyouxinde_fengmian9.jpg,upload/lvyouxinde_fengmian10.jpg','导游证号8','导游姓名8','2023-05-10 19:48:45','简介8','','内容8','2023-05-10 19:48:45',8);
- /*!40000 ALTER TABLE `lvyouxinde` ENABLE KEYS */;
- UNLOCK TABLES;
-
- --
- -- Table structure for table `news`
- --
-
- DROP TABLE IF EXISTS `news`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `news` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `title` varchar(200) NOT NULL COMMENT '标题',
- `introduction` longtext COMMENT '简介',
- `picture` longtext NOT NULL COMMENT '图片',
- `content` longtext NOT NULL COMMENT '内容',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=99 DEFAULT CHARSET=utf8 COMMENT='系统公告';
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Table structure for table `systemintro`
- --
-
- DROP TABLE IF EXISTS `systemintro`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `systemintro` (
- `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 `systemintro`
- --
-
- LOCK TABLES `systemintro` WRITE;
- /*!40000 ALTER TABLE `systemintro` DISABLE KEYS */;
- INSERT INTO `systemintro` VALUES (1,'2023-05-10 11:48:46','系统简介','SYSTEM INTRODUCTION','当遇到挫折或失败,你是看见失败还是看见机会?挫折是我们每个人成长的必经之路,它不是你想有就有,想没有就没有的。有句名言说的好,如果你想一生摆脱苦难,你就得是神或者是死尸。这句话形象地说明了挫折是伴随着人生的,是谁都逃不掉的。人生在世,从古到今,不分天子平民,机遇虽有不同,但总不免有身陷困境或遭遇难题之处,这时候唯有通权达变,才能使人转危为安,甚至反败为胜。大部分的人,一生当中,最痛苦的经验是失去所爱的人,其次是丢掉一份工作。其实,经得起考验的人,就算是被开除也不会惊慌,要学会面对。','upload/systemintro_picture1.jpg','upload/systemintro_picture2.jpg','upload/systemintro_picture3.jpg');
- /*!40000 ALTER TABLE `systemintro` 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','用户','xbr0ja7wos1ivfk53ko4qacjxqwpk69s','2023-05-10 11:52:39','2023-05-10 12:52:40');
- /*!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-05-10 11:48:46');
- /*!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 '创建时间',
- `yonghuming` varchar(200) NOT NULL COMMENT '用户名',
- `xingming` varchar(200) NOT NULL COMMENT '姓名',
- `mima` varchar(200) NOT NULL COMMENT '密码',
- `xingbie` varchar(200) DEFAULT NULL COMMENT '性别',
- `lianxidianhua` varchar(200) DEFAULT NULL COMMENT '联系电话',
- `touxiang` longtext COMMENT '头像',
- `shenfenzheng` varchar(200) DEFAULT NULL COMMENT '身份证',
- PRIMARY KEY (`id`),
- UNIQUE KEY `yonghuming` (`yonghuming`)
- ) 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-05-10 11:48:45','用户名1','姓名1','123456','男','13823888881','upload/yonghu_touxiang1.jpg','440300199101010001'),(12,'2023-05-10 11:48:45','用户名2','姓名2','123456','男','13823888882','upload/yonghu_touxiang2.jpg','440300199202020002'),(13,'2023-05-10 11:48:45','用户名3','姓名3','123456','男','13823888883','upload/yonghu_touxiang3.jpg','440300199303030003'),(14,'2023-05-10 11:48:45','用户名4','姓名4','123456','男','13823888884','upload/yonghu_touxiang4.jpg','440300199404040004'),(15,'2023-05-10 11:48:45','用户名5','姓名5','123456','男','13823888885','upload/yonghu_touxiang5.jpg','440300199505050005'),(16,'2023-05-10 11:48:45','用户名6','姓名6','123456','男','13823888886','upload/yonghu_touxiang6.jpg','440300199606060006'),(17,'2023-05-10 11:48:45','用户名7','姓名7','123456','男','13823888887','upload/yonghu_touxiang7.jpg','440300199707070007'),(18,'2023-05-10 11:48:45','用户名8','姓名8','123456','男','13823888888','upload/yonghu_touxiang8.jpg','440300199808080008');
- /*!40000 ALTER TABLE `yonghu` ENABLE KEYS */;
- UNLOCK TABLES;
-
- --
- -- Table structure for table `yuyuedingdan`
- --
-
- DROP TABLE IF EXISTS `yuyuedingdan`;
- /*!40101 SET @saved_cs_client = @@character_set_client */;
- /*!40101 SET character_set_client = utf8 */;
- CREATE TABLE `yuyuedingdan` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `xianlumingcheng` varchar(200) NOT NULL COMMENT '线路名称',
- `jingdianmingcheng` varchar(200) NOT NULL COMMENT '景点名称',
- `jingdiandizhi` varchar(200) DEFAULT NULL COMMENT '景点地址',
- `xianlutupian` longtext COMMENT '线路图片',
- `qidian` varchar(200) DEFAULT NULL COMMENT '起点',
- `tujingluduan` varchar(200) DEFAULT NULL COMMENT '途径路段',
- `zhongdian` varchar(200) DEFAULT NULL COMMENT '终点',
- `jiaotongfangshi` varchar(200) DEFAULT NULL COMMENT '交通方式',
- `daoyouzhenghao` varchar(200) DEFAULT NULL COMMENT '导游证号',
- `daoyouxingming` varchar(200) DEFAULT NULL COMMENT '导游姓名',
- `yonghuming` varchar(200) DEFAULT NULL COMMENT '用户名',
- `xingming` varchar(200) DEFAULT NULL COMMENT '姓名',
- `lianxidianhua` varchar(200) DEFAULT NULL COMMENT '联系电话',
- `yuyueshijian` date DEFAULT NULL COMMENT '预约时间',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 COMMENT='预约订单';
- /*!40101 SET character_set_client = @saved_cs_client */;
-
- --
- -- Dumping data for table `yuyuedingdan`
- --
-
- LOCK TABLES `yuyuedingdan` WRITE;
- /*!40000 ALTER TABLE `yuyuedingdan` DISABLE KEYS */;
- INSERT INTO `yuyuedingdan` VALUES (61,'2023-05-10 11:48:46','线路名称1','景点名称1','景点地址1','upload/yuyuedingdan_xianlutupian1.jpg,upload/yuyuedingdan_xianlutupian2.jpg,upload/yuyuedingdan_xianlutupian3.jpg','起点1','途径路段1','终点1','交通方式1','导游证号1','导游姓名1','用户名1','姓名1','联系电话1','2023-05-10'),(62,'2023-05-10 11:48:46','线路名称2','景点名称2','景点地址2','upload/yuyuedingdan_xianlutupian2.jpg,upload/yuyuedingdan_xianlutupian3.jpg,upload/yuyuedingdan_xianlutupian4.jpg','起点2','途径路段2','终点2','交通方式2','导游证号2','导游姓名2','用户名2','姓名2','联系电话2','2023-05-10'),(63,'2023-05-10 11:48:46','线路名称3','景点名称3','景点地址3','upload/yuyuedingdan_xianlutupian3.jpg,upload/yuyuedingdan_xianlutupian4.jpg,upload/yuyuedingdan_xianlutupian5.jpg','起点3','途径路段3','终点3','交通方式3','导游证号3','导游姓名3','用户名3','姓名3','联系电话3','2023-05-10'),(64,'2023-05-10 11:48:46','线路名称4','景点名称4','景点地址4','upload/yuyuedingdan_xianlutupian4.jpg,upload/yuyuedingdan_xianlutupian5.jpg,upload/yuyuedingdan_xianlutupian6.jpg','起点4','途径路段4','终点4','交通方式4','导游证号4','导游姓名4','用户名4','姓名4','联系电话4','2023-05-10'),(65,'2023-05-10 11:48:46','线路名称5','景点名称5','景点地址5','upload/yuyuedingdan_xianlutupian5.jpg,upload/yuyuedingdan_xianlutupian6.jpg,upload/yuyuedingdan_xianlutupian7.jpg','起点5','途径路段5','终点5','交通方式5','导游证号5','导游姓名5','用户名5','姓名5','联系电话5','2023-05-10'),(66,'2023-05-10 11:48:46','线路名称6','景点名称6','景点地址6','upload/yuyuedingdan_xianlutupian6.jpg,upload/yuyuedingdan_xianlutupian7.jpg,upload/yuyuedingdan_xianlutupian8.jpg','起点6','途径路段6','终点6','交通方式6','导游证号6','导游姓名6','用户名6','姓名6','联系电话6','2023-05-10'),(67,'2023-05-10 11:48:46','线路名称7','景点名称7','景点地址7','upload/yuyuedingdan_xianlutupian7.jpg,upload/yuyuedingdan_xianlutupian8.jpg,upload/yuyuedingdan_xianlutupian9.jpg','起点7','途径路段7','终点7','交通方式7','导游证号7','导游姓名7','用户名7','姓名7','联系电话7','2023-05-10'),(68,'2023-05-10 11:48:46','线路名称8','景点名称8','景点地址8','upload/yuyuedingdan_xianlutupian8.jpg,upload/yuyuedingdan_xianlutupian9.jpg,upload/yuyuedingdan_xianlutupian10.jpg','起点8','途径路段8','终点8','交通方式8','导游证号8','导游姓名8','用户名8','姓名8','联系电话8','2023-05-10');
- /*!40000 ALTER TABLE `yuyuedingdan` 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-05-13 22:17:35
五.关键代码
- 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{
-
- @Autowired
- private UserService userService;
-
- @Autowired
- private TokenService tokenService;
-
- /**
- * 登录
- */
- @IgnoreAuth
- @PostMapping(value = "/login")
- public R login(String username, String password, String captcha, HttpServletRequest request) {
- UserEntity user = userService.selectOne(new EntityWrapper
().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
().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
().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
params,UserEntity user) { - EntityWrapper
ew = new EntityWrapper(); - 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
ew = new EntityWrapper(); - 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
().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);
- UserEntity u = userService.selectOne(new EntityWrapper
().eq("username", user.getUsername())); - if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
- return R.error("用户名已存在。");
- }
- userService.updateById(user);//全部更新
- return R.ok();
- }
-
- /**
- * 删除
- */
- @RequestMapping("/delete")
- public R delete(@RequestBody Long[] ids){
- userService.deleteBatchIds(Arrays.asList(ids));
- return R.ok();
- }
- }
六.论文目录参考
七.源码获取
感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!
喜欢文章可以点赞、收藏、关注、评论啦
获取源码请私信