博主介紹:?從事軟件開發(fā)10年之余,專注于Java技術領域、Python人工智能及數據挖掘、小程序項目開發(fā)和Android項目開發(fā)等。CSDN、掘金、華為云、InfoQ、阿里云等平臺優(yōu)質作者?
??文末獲取源碼聯(lián)系??
???? 精彩專欄推薦訂閱???? 不然下次找不到喲
————————————————計算機畢業(yè)設計題目《1000套》?
目錄
一.前言介紹
二.功能設計
三.功能截圖
四.數據庫表結構設計
五.關鍵代碼
六.論文目錄參考
七.源碼獲取
一.前言介紹
?本環(huán)保網站可以幫助管理者在短時間內處理完畢龐大的數據信息,使用這種軟件工具可以幫助管理人員提高事務處理效率,達到事半功倍的效果。本環(huán)保網站也是緊跟科學技術的發(fā)展,運用當今一流的軟件技術實現(xiàn)軟件系統(tǒng)的開發(fā),讓環(huán)保方面的信息完全通過管理系統(tǒng)實現(xiàn)科學化,規(guī)范化,程序化管理。從而幫助信息管理者節(jié)省事務處理的時間,降低數據處理的錯誤率,對于基礎數據的管理水平可以起到促進作用,也從一定程度上對隨意的業(yè)務管理工作進行了避免,同時,環(huán)保網站的數據庫里面存儲的各種動態(tài)信息,也為上層管理人員作出重大決策提供了大量的事實依據此環(huán)保網站使用跨平臺的可開發(fā)大型商業(yè)網站的HTML技術,以及最受歡迎的RDBMS應用軟件之一的MySQL數據庫進行程序開發(fā),后臺采用Java語言的Spring Boot框架,前臺采用VUE框架和layui樣式,環(huán)保網站實現(xiàn)頁面基本用HTML文件寫作方式。
二.功能設計
?管理員功能有個人中心,管理員管理,瀕危生物管理,地區(qū)管理,環(huán)保健康類型管理,保護法類型管理,公告類型管理,論壇管理,環(huán)保健康管理,環(huán)境保護管理,環(huán)境保護法管理,公告信息管理,輪播圖管理。用戶可以注冊登錄,修改個人信息,查看管理員發(fā)布的各種信息還可以留言,可以對瀕危生物收藏,環(huán)保健康收藏,環(huán)境保護收藏等操作。
三.功能截圖
管理員管理頁面,管理員可以對管理員信息進行添加,修改,刪除,查詢操作。
?瀕危生物管理頁面,管理員可以對瀕危生物信息進行添加,修改,刪除,查詢操作。
?論壇管理頁面,管理員可以對論壇信息進行添加,修改,刪除,查詢操作。
?環(huán)保健康管理頁面,管理員可以對環(huán)保健康信息進行添加,修改,刪除,查詢操作。
?環(huán)境保護頁面,管理員可以對環(huán)境保護信息進行添加,修改,刪除,查詢操作。
?環(huán)境保護法管理頁面,管理員可以對環(huán)境保護法信息進行添加,修改,刪除,查詢操作。
?公告信息管理頁面,管理員可以對公告信息進行添加,修改,刪除,查詢操作。
?用戶信息頁面,管理員可以對用戶信息進行添加,修改,刪除,查詢操作。
?個人中心頁面,用戶注冊登錄后點擊個人中心可以修改個人資料和查看自己的收藏信息。
?瀕危生物頁面,用戶可以在瀕危生物界面查看瀕危生物信息。
?環(huán)境保護信息頁面,用戶點擊環(huán)境保護可以查看環(huán)境保護信息。
?公告信息頁面,用戶登錄后可以點擊公告信息里面查看公告信息。
四.數據庫表結構設計
CREATE TABLE `binweishengwu` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`binweishengwu_name` varchar(200) DEFAULT NULL COMMENT '動物 Search111',
`address_types` int(11) DEFAULT NULL COMMENT '所在地區(qū) Search111',
`binweishengwu_photo` varchar(200) DEFAULT NULL COMMENT '圖片',
`binweishengwu_size` varchar(200) DEFAULT NULL COMMENT '現(xiàn)存數量',
`zan_number` int(11) DEFAULT NULL COMMENT '贊',
`cai_number` int(11) DEFAULT NULL COMMENT '踩',
`binweishengwu_content` text COMMENT '介紹',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '添加時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='瀕危生物';
/*Data for the table `binweishengwu` */
insert into `binweishengwu`(`id`,`binweishengwu_name`,`address_types`,`binweishengwu_photo`,`binweishengwu_size`,`zan_number`,`cai_number`,`binweishengwu_content`,`insert_time`,`create_time`) values (1,'動物1',2,'http://localhost:8080/huanbaowangzhan/upload/1650112322844.jpeg','現(xiàn)存數量1',234,163,'<p>介紹1</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,'動物2',1,'http://localhost:8080/huanbaowangzhan/upload/1650112312072.jpeg','現(xiàn)存數量2',290,321,'<p>介紹2</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,'動物3',3,'http://localhost:8080/huanbaowangzhan/upload/1650112303555.jpeg','現(xiàn)存數量3',493,190,'<p>介紹3</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,'動物4',2,'http://localhost:8080/huanbaowangzhan/upload/1650112296219.jpeg','現(xiàn)存數量4',293,67,'<p>介紹4</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,'動物5',3,'http://localhost:8080/huanbaowangzhan/upload/1650112288417.jpeg','現(xiàn)存數量5',387,197,'<p>介紹5</p>','2022-04-16 20:09:58','2022-04-16 20:09:58');
/*Table structure for table `binweishengwu_collection` */
DROP TABLE IF EXISTS `binweishengwu_collection`;
CREATE TABLE `binweishengwu_collection` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`binweishengwu_id` int(11) DEFAULT NULL COMMENT '瀕危生物',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用戶',
`binweishengwu_collection_types` int(11) DEFAULT NULL COMMENT '類型',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '收藏時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show3 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='瀕危生物收藏';
/*Data for the table `binweishengwu_collection` */
insert into `binweishengwu_collection`(`id`,`binweishengwu_id`,`yonghu_id`,`binweishengwu_collection_types`,`insert_time`,`create_time`) values (1,1,2,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,2,3,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,3,3,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,4,2,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,5,3,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(6,3,1,2,'2022-04-16 20:39:37','2022-04-16 20:39:37');
/*Table structure for table `binweishengwu_liuyan` */
DROP TABLE IF EXISTS `binweishengwu_liuyan`;
CREATE TABLE `binweishengwu_liuyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`binweishengwu_id` int(11) DEFAULT NULL COMMENT '瀕危生物',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用戶',
`binweishengwu_liuyan_text` text COMMENT '留言內容',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '留言時間',
`reply_text` text COMMENT '回復內容',
`update_time` timestamp NULL DEFAULT NULL COMMENT '回復時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='瀕危生物留言';
/*Data for the table `binweishengwu_liuyan` */
insert into `binweishengwu_liuyan`(`id`,`binweishengwu_id`,`yonghu_id`,`binweishengwu_liuyan_text`,`insert_time`,`reply_text`,`update_time`,`create_time`) values (1,1,3,'留言內容1','2022-04-16 20:09:58','回復信息1','2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,2,1,'留言內容2','2022-04-16 20:09:58','回復信息2','2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,3,1,'留言內容3','2022-04-16 20:09:58','回復信息3','2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,4,1,'留言內容4','2022-04-16 20:09:58','回復信息4','2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,5,3,'留言內容5','2022-04-16 20:09:58','回復信息5','2022-04-16 20:09:58','2022-04-16 20:09:58'),(6,3,1,'登錄后才能看到詳情頁面 和留言','2022-04-16 20:39:54','管理回復123','2022-04-16 20:41:32','2022-04-16 20:39:54');
/*Table structure for table `config` */
DROP TABLE IF EXISTS `config`;
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='配置文件';
/*Data for the table `config` */
insert into `config`(`id`,`name`,`value`) values (1,'輪播圖1','http://localhost:8080/huanbaowangzhan/upload/config1.jpg'),(2,'輪播圖2','http://localhost:8080/huanbaowangzhan/upload/config2.jpg'),(3,'輪播圖3','http://localhost:8080/huanbaowangzhan/upload/config3.jpg');
/*Table structure for table `dictionary` */
DROP TABLE IF EXISTS `dictionary`;
CREATE TABLE `dictionary` (
`id` int(20) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`dic_code` varchar(200) DEFAULT NULL COMMENT '字段',
`dic_name` varchar(200) DEFAULT NULL COMMENT '字段名',
`code_index` int(11) DEFAULT NULL COMMENT '編碼',
`index_name` varchar(200) DEFAULT NULL COMMENT '編碼名字 Search111 ',
`super_id` int(11) DEFAULT NULL COMMENT '父字段id',
`beizhu` varchar(200) DEFAULT NULL COMMENT '備注',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COMMENT='字典表';
/*Data for the table `dictionary` */
insert into `dictionary`(`id`,`dic_code`,`dic_name`,`code_index`,`index_name`,`super_id`,`beizhu`,`create_time`) values (1,'address_types','地區(qū)',1,'地區(qū)1',NULL,NULL,'2022-04-16 20:09:05'),(2,'address_types','地區(qū)',2,'地區(qū)2',NULL,NULL,'2022-04-16 20:09:05'),(3,'address_types','地區(qū)',3,'地區(qū)3',NULL,NULL,'2022-04-16 20:09:05'),(4,'huanjingbaohu_collection_types','收藏表類型',1,'收藏',NULL,NULL,'2022-04-16 20:09:05'),(5,'huanjingbaohu_collection_types','收藏表類型',2,'贊',NULL,NULL,'2022-04-16 20:09:05'),(6,'huanjingbaohu_collection_types','收藏表類型',3,'踩',NULL,NULL,'2022-04-16 20:09:05'),(7,'binweishengwu_collection_types','收藏表類型',1,'收藏',NULL,NULL,'2022-04-16 20:09:05'),(8,'binweishengwu_collection_types','收藏表類型',2,'贊',NULL,NULL,'2022-04-16 20:09:05'),(9,'binweishengwu_collection_types','收藏表類型',3,'踩',NULL,NULL,'2022-04-16 20:09:05'),(10,'huanjingbaohufa_types','保護法類型',1,'保護法類型1',NULL,NULL,'2022-04-16 20:09:05'),(11,'huanjingbaohufa_types','保護法類型',2,'保護法類型2',NULL,NULL,'2022-04-16 20:09:05'),(12,'huanjingbaohufa_types','保護法類型',3,'保護法類型3',NULL,NULL,'2022-04-16 20:09:05'),(13,'huanbaojiankang_types','環(huán)保健康類型',1,'環(huán)保健康類型1',NULL,NULL,'2022-04-16 20:09:05'),(14,'huanbaojiankang_types','環(huán)保健康類型',2,'環(huán)保健康類型2',NULL,NULL,'2022-04-16 20:09:05'),(15,'huanbaojiankang_types','環(huán)保健康類型',3,'環(huán)保健康類型3',NULL,NULL,'2022-04-16 20:09:05'),(16,'huanbaojiankang_collection_types','收藏表類型',1,'收藏',NULL,NULL,'2022-04-16 20:09:05'),(17,'huanbaojiankang_collection_types','收藏表類型',2,'贊',NULL,NULL,'2022-04-16 20:09:05'),(18,'huanbaojiankang_collection_types','收藏表類型',3,'踩',NULL,NULL,'2022-04-16 20:09:05'),(19,'news_types','公告類型',1,'公告類型1',NULL,NULL,'2022-04-16 20:09:05'),(20,'news_types','公告類型',2,'公告類型2',NULL,NULL,'2022-04-16 20:09:05'),(21,'news_types','公告類型',3,'公告類型3',NULL,NULL,'2022-04-16 20:09:06'),(22,'sex_types','性別類型',1,'男',NULL,NULL,'2022-04-16 20:09:06'),(23,'sex_types','性別類型',2,'女',NULL,NULL,'2022-04-16 20:09:06'),(24,'forum_state_types','帖子狀態(tài)',1,'發(fā)帖',NULL,NULL,'2022-04-16 20:09:06'),(25,'forum_state_types','帖子狀態(tài)',2,'回帖',NULL,NULL,'2022-04-16 20:09:06');
/*Table structure for table `forum` */
DROP TABLE IF EXISTS `forum`;
CREATE TABLE `forum` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`forum_name` varchar(200) DEFAULT NULL COMMENT '帖子標題 Search111 ',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用戶',
`users_id` int(11) DEFAULT NULL COMMENT '管理員',
`forum_content` text COMMENT '發(fā)布內容',
`super_ids` int(11) DEFAULT NULL COMMENT '父id',
`forum_state_types` int(11) DEFAULT NULL COMMENT '帖子狀態(tài)',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '發(fā)帖時間',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show2',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='論壇';
/*Data for the table `forum` */
insert into `forum`(`id`,`forum_name`,`yonghu_id`,`users_id`,`forum_content`,`super_ids`,`forum_state_types`,`insert_time`,`update_time`,`create_time`) values (1,'帖子標題1',1,NULL,'發(fā)布內容1',NULL,1,'2022-04-16 20:09:58','2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,'帖子標題2',3,NULL,'發(fā)布內容2',NULL,1,'2022-04-16 20:09:58','2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,'帖子標題3',2,NULL,'發(fā)布內容3',NULL,1,'2022-04-16 20:09:58','2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,'帖子標題4',2,NULL,'發(fā)布內容4',NULL,1,'2022-04-16 20:09:58','2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,'帖子標題5',3,NULL,'發(fā)布內容5',NULL,1,'2022-04-16 20:09:58','2022-04-16 20:09:58','2022-04-16 20:09:58'),(6,NULL,1,NULL,'評論內容111123',5,2,'2022-04-16 20:40:15',NULL,'2022-04-16 20:40:15'),(7,NULL,NULL,1,'管理評論123',5,2,'2022-04-16 20:41:47',NULL,'2022-04-16 20:41:47');
/*Table structure for table `huanbaojiankang` */
DROP TABLE IF EXISTS `huanbaojiankang`;
CREATE TABLE `huanbaojiankang` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`huanbaojiankang_name` varchar(200) DEFAULT NULL COMMENT '標題 Search111',
`huanbaojiankang_types` int(11) DEFAULT NULL COMMENT '環(huán)保健康類型 Search111',
`huanbaojiankang_photo` varchar(200) DEFAULT NULL COMMENT '封面',
`zan_number` int(11) DEFAULT NULL COMMENT '贊',
`cai_number` int(11) DEFAULT NULL COMMENT '踩',
`huanbaojiankang_content` text COMMENT '介紹',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '添加時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='環(huán)保健康';
/*Data for the table `huanbaojiankang` */
insert into `huanbaojiankang`(`id`,`huanbaojiankang_name`,`huanbaojiankang_types`,`huanbaojiankang_photo`,`zan_number`,`cai_number`,`huanbaojiankang_content`,`insert_time`,`create_time`) values (1,'標題1',1,'http://localhost:8080/huanbaowangzhan/upload/1650112387392.jpeg',371,126,'<p>介紹1</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,'標題2',2,'http://localhost:8080/huanbaowangzhan/upload/1650112378955.jpeg',133,244,'<p>介紹2</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,'標題3',3,'http://localhost:8080/huanbaowangzhan/upload/1650112370907.jpeg',307,359,'<p>介紹3</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,'標題4',1,'http://localhost:8080/huanbaowangzhan/upload/1650112362784.jpeg',489,119,'<p>介紹4</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,'標題5',1,'http://localhost:8080/huanbaowangzhan/upload/1650112354631.jpeg',87,383,'<p>介紹5</p>','2022-04-16 20:09:58','2022-04-16 20:09:58');
/*Table structure for table `huanbaojiankang_collection` */
DROP TABLE IF EXISTS `huanbaojiankang_collection`;
CREATE TABLE `huanbaojiankang_collection` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`huanbaojiankang_id` int(11) DEFAULT NULL COMMENT '環(huán)保健康',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用戶',
`huanbaojiankang_collection_types` int(11) DEFAULT NULL COMMENT '類型',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '收藏時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show3 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='環(huán)保健康收藏';
/*Data for the table `huanbaojiankang_collection` */
insert into `huanbaojiankang_collection`(`id`,`huanbaojiankang_id`,`yonghu_id`,`huanbaojiankang_collection_types`,`insert_time`,`create_time`) values (1,1,1,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,3,2,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,4,2,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(6,3,1,2,'2022-04-16 20:40:31','2022-04-16 20:40:31');
/*Table structure for table `huanbaojiankang_liuyan` */
DROP TABLE IF EXISTS `huanbaojiankang_liuyan`;
CREATE TABLE `huanbaojiankang_liuyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`huanbaojiankang_id` int(11) DEFAULT NULL COMMENT '環(huán)保健康',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用戶',
`huanbaojiankang_liuyan_text` text COMMENT '留言內容',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '留言時間',
`reply_text` text COMMENT '回復內容',
`update_time` timestamp NULL DEFAULT NULL COMMENT '回復時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='環(huán)保健康留言';
/*Data for the table `huanbaojiankang_liuyan` */
insert into `huanbaojiankang_liuyan`(`id`,`huanbaojiankang_id`,`yonghu_id`,`huanbaojiankang_liuyan_text`,`insert_time`,`reply_text`,`update_time`,`create_time`) values (1,1,2,'留言內容1','2022-04-16 20:09:58','回復信息1','2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,2,2,'留言內容2','2022-04-16 20:09:58','回復信息2','2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,3,2,'留言內容3','2022-04-16 20:09:58','回復信息3','2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,4,1,'留言內容4','2022-04-16 20:09:58','回復信息4','2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,5,1,'留言內容5','2022-04-16 20:09:58','回復信息5','2022-04-16 20:09:58','2022-04-16 20:09:58'),(6,3,1,'留言11111','2022-04-16 20:40:30',NULL,NULL,'2022-04-16 20:40:30');
/*Table structure for table `huanjingbaohu` */
DROP TABLE IF EXISTS `huanjingbaohu`;
CREATE TABLE `huanjingbaohu` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`huanjingbaohu_name` varchar(200) DEFAULT NULL COMMENT '名稱 Search111',
`address_types` int(11) DEFAULT NULL COMMENT '地區(qū) Search111',
`huanjingbaohu_photo` varchar(200) DEFAULT NULL COMMENT '圖片',
`huanjingbaohu_size` varchar(200) DEFAULT NULL COMMENT '大小',
`zan_number` int(11) DEFAULT NULL COMMENT '贊',
`cai_number` int(11) DEFAULT NULL COMMENT '踩',
`huanjingbaohu_content` text COMMENT '介紹',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '添加時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='環(huán)境保護';
/*Data for the table `huanjingbaohu` */
insert into `huanjingbaohu`(`id`,`huanjingbaohu_name`,`address_types`,`huanjingbaohu_photo`,`huanjingbaohu_size`,`zan_number`,`cai_number`,`huanjingbaohu_content`,`insert_time`,`create_time`) values (1,'名稱1',2,'http://localhost:8080/huanbaowangzhan/upload/1650112465892.jpeg','大小1',250,296,'<p>介紹1</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,'名稱2',3,'http://localhost:8080/huanbaowangzhan/upload/1650112458858.jpeg','大小2',496,474,'<p>介紹2</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,'名稱3',2,'http://localhost:8080/huanbaowangzhan/upload/1650112450975.jpeg','大小3',419,428,'<p>介紹3</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,'名稱4',2,'http://localhost:8080/huanbaowangzhan/upload/1650112443477.jpeg','大小4',144,288,'<p>介紹4</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,'名稱5',3,'http://localhost:8080/huanbaowangzhan/upload/1650112435202.jpeg','大小5',371,199,'<p>介紹5</p>','2022-04-16 20:09:58','2022-04-16 20:09:58');
/*Table structure for table `huanjingbaohu_collection` */
DROP TABLE IF EXISTS `huanjingbaohu_collection`;
CREATE TABLE `huanjingbaohu_collection` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`huanjingbaohu_id` int(11) DEFAULT NULL COMMENT '環(huán)境保護',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用戶',
`huanjingbaohu_collection_types` int(11) DEFAULT NULL COMMENT '類型',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '收藏時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show3 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='環(huán)境保護收藏';
/*Data for the table `huanjingbaohu_collection` */
insert into `huanjingbaohu_collection`(`id`,`huanjingbaohu_id`,`yonghu_id`,`huanjingbaohu_collection_types`,`insert_time`,`create_time`) values (1,1,1,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,2,3,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,3,3,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,4,2,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,5,2,1,'2022-04-16 20:09:58','2022-04-16 20:09:58'),(6,4,1,2,'2022-04-16 20:40:44','2022-04-16 20:40:44');
/*Table structure for table `huanjingbaohu_liuyan` */
DROP TABLE IF EXISTS `huanjingbaohu_liuyan`;
CREATE TABLE `huanjingbaohu_liuyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`huanjingbaohu_id` int(11) DEFAULT NULL COMMENT '環(huán)境保護',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用戶',
`huanjingbaohu_liuyan_text` text COMMENT '留言內容',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '留言時間',
`reply_text` text COMMENT '回復內容',
`update_time` timestamp NULL DEFAULT NULL COMMENT '回復時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='環(huán)境保護留言';
/*Data for the table `huanjingbaohu_liuyan` */
insert into `huanjingbaohu_liuyan`(`id`,`huanjingbaohu_id`,`yonghu_id`,`huanjingbaohu_liuyan_text`,`insert_time`,`reply_text`,`update_time`,`create_time`) values (1,1,3,'留言內容1','2022-04-16 20:09:58','回復信息1','2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,2,2,'留言內容2','2022-04-16 20:09:58','回復信息2','2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,3,2,'留言內容3','2022-04-16 20:09:58','回復信息3','2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,4,3,'留言內容4','2022-04-16 20:09:58','回復信息4','2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,5,1,'留言內容5','2022-04-16 20:09:58','回復信息5','2022-04-16 20:09:58','2022-04-16 20:09:58');
/*Table structure for table `huanjingbaohufa` */
DROP TABLE IF EXISTS `huanjingbaohufa`;
CREATE TABLE `huanjingbaohufa` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`huanjingbaohufa_name` varchar(200) DEFAULT NULL COMMENT '標題 Search111',
`huanjingbaohufa_types` int(11) DEFAULT NULL COMMENT '保護法類型 Search111',
`huanjingbaohufa_photo` varchar(200) DEFAULT NULL COMMENT '封面',
`huanjingbaohufa_content` text COMMENT '詳情',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '添加時間',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show1 show2 nameShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='瀕危生物法';
/*Data for the table `huanjingbaohufa` */
insert into `huanjingbaohufa`(`id`,`huanjingbaohufa_name`,`huanjingbaohufa_types`,`huanjingbaohufa_photo`,`huanjingbaohufa_content`,`insert_time`,`create_time`) values (1,'標題1',1,'http://localhost:8080/huanbaowangzhan/upload/1650112607688.jpeg','<p>詳情1</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(2,'標題2',1,'http://localhost:8080/huanbaowangzhan/upload/1650112600474.jpeg','<p>詳情2</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(3,'標題3',2,'http://localhost:8080/huanbaowangzhan/upload/1650112593159.jpg','<p>詳情3</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(4,'標題4',2,'http://localhost:8080/huanbaowangzhan/upload/1650112585705.jpeg','<p>詳情4</p>','2022-04-16 20:09:58','2022-04-16 20:09:58'),(5,'標題5',2,'http://localhost:8080/huanbaowangzhan/upload/1650112577297.jpeg','<p>詳情5</p>','2022-04-16 20:09:58','2022-04-16 20:09:58');
/*Table structure for table `news` */
DROP TABLE IF EXISTS `news`;
CREATE TABLE `news` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`news_name` varchar(200) DEFAULT NULL COMMENT '公告標題 Search111 ',
`news_types` int(11) DEFAULT NULL COMMENT '公告類型 Search111 ',
`news_photo` varchar(200) DEFAULT NULL COMMENT '公告圖片',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '添加時間',
`news_content` text COMMENT '公告詳情',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間 show1 show2 nameShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='公告信息';
/*Data for the table `news` */
insert into `news`(`id`,`news_name`,`news_types`,`news_photo`,`insert_time`,`news_content`,`create_time`) values (1,'公告標題1',3,'http://localhost:8080/huanbaowangzhan/upload/news1.jpg','2022-04-16 20:09:58','公告詳情1','2022-04-16 20:09:58'),(2,'公告標題2',3,'http://localhost:8080/huanbaowangzhan/upload/news2.jpg','2022-04-16 20:09:58','公告詳情2','2022-04-16 20:09:58'),(3,'公告標題3',3,'http://localhost:8080/huanbaowangzhan/upload/news3.jpg','2022-04-16 20:09:58','公告詳情3','2022-04-16 20:09:58'),(4,'公告標題4',2,'http://localhost:8080/huanbaowangzhan/upload/news4.jpg','2022-04-16 20:09:58','公告詳情4','2022-04-16 20:09:58'),(5,'公告標題5',1,'http://localhost:8080/huanbaowangzhan/upload/news5.jpg','2022-04-16 20:09:58','公告詳情5','2022-04-16 20:09:58');
/*Table structure for table `token` */
DROP TABLE IF EXISTS `token`;
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=3 DEFAULT CHARSET=utf8 COMMENT='token表';
/*Data for the table `token` */
insert into `token`(`id`,`userid`,`username`,`tablename`,`role`,`token`,`addtime`,`expiratedtime`) values (1,1,'a1','yonghu','用戶','k3rxhv0e5ms9hv08padtxu99pg3jquf6','2022-04-16 20:26:40','2022-04-16 21:42:14'),(2,1,'admin','users','管理員','az1z95l9m1zzp5ad7bkp92vneps2aa1i','2022-04-16 20:30:50','2022-04-16 21:30:51');
/*Table structure for table `users` */
DROP TABLE IF EXISTS `users`;
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='用戶表';
/*Data for the table `users` */
insert into `users`(`id`,`username`,`password`,`role`,`addtime`) values (1,'admin','admin','管理員','2022-05-01 00:00:00');
/*Table structure for table `yonghu` */
DROP TABLE IF EXISTS `yonghu`;
CREATE TABLE `yonghu` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主鍵',
`username` varchar(200) DEFAULT NULL COMMENT '賬戶',
`password` varchar(200) DEFAULT NULL COMMENT '密碼',
`yonghu_name` varchar(200) DEFAULT NULL COMMENT '用戶姓名 Search111 ',
`yonghu_photo` varchar(200) DEFAULT NULL COMMENT '頭像',
`yonghu_phone` varchar(200) DEFAULT NULL COMMENT '手機號',
`yonghu_email` varchar(200) DEFAULT NULL COMMENT '電子郵箱',
`sex_types` int(11) DEFAULT NULL COMMENT '性別 Search111 ',
`yonghu_delete` int(11) DEFAULT '1' COMMENT '假刪',
`create_time` timestamp NULL DEFAULT NULL COMMENT '創(chuàng)建時間',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='用戶';
/*Data for the table `yonghu` */
insert into `yonghu`(`id`,`username`,`password`,`yonghu_name`,`yonghu_photo`,`yonghu_phone`,`yonghu_email`,`sex_types`,`yonghu_delete`,`create_time`) values (1,'a1','123456','用戶姓名1','http://localhost:8080/huanbaowangzhan/upload/yonghu1.jpg','17703786901','1@qq.com',2,1,'2022-04-16 20:09:58'),(2,'a2','123456','用戶姓名2','http://localhost:8080/huanbaowangzhan/upload/yonghu2.jpg','17703786902','2@qq.com',1,1,'2022-04-16 20:09:58'),(3,'a3','123456','用戶姓名3','http://localhost:8080/huanbaowangzhan/upload/yonghu3.jpg','17703786903','3@qq.com',1,1,'2022-04-16 20:09:58');
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
五.關鍵代碼
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<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);
UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().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();
}
}
六.論文目錄參考
七.源碼獲取
感謝大家的閱讀,如有不懂的問題可以評論區(qū)交流或私聊!
喜歡文章可以點贊、收藏、關注、評論啦文章來源:http://www.zghlxwxcb.cn/news/detail-729264.html
獲取源碼請私信文章來源地址http://www.zghlxwxcb.cn/news/detail-729264.html
到了這里,關于計算機畢業(yè)設計 基于HTML語言的環(huán)保網站的設計與實現(xiàn) Java實戰(zhàn)項目 附源碼+文檔+視頻講解的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!