├── adopt.iml ├── src ├── main │ ├── webapp │ │ ├── index.jsp │ │ ├── images │ │ │ ├── 1.jpg │ │ │ ├── 2.jpg │ │ │ ├── 3.jpg │ │ │ ├── 4.jpg │ │ │ ├── error │ │ │ │ ├── cut.jpg │ │ │ │ └── banner.png │ │ │ └── login │ │ │ │ ├── bg.jpg │ │ │ │ ├── passcode.jpg │ │ │ │ └── tmbg-white.png │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── fontawesome-webfont.woff2 │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── js │ │ │ ├── houtai │ │ │ │ ├── css │ │ │ │ │ ├── rightbg.jpg │ │ │ │ │ ├── style.css │ │ │ │ │ ├── boot-crm.css │ │ │ │ │ └── metisMenu.min.css │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ │ ├── sb-admin-2.js │ │ │ │ │ ├── metisMenu.min.js │ │ │ │ │ └── dataTables.bootstrap.min.js │ │ │ ├── move-top.js │ │ │ ├── demo.js │ │ │ ├── responsiveslides.min.js │ │ │ ├── gVerify.js │ │ │ ├── jquery.comment.js │ │ │ ├── easing.js │ │ │ └── jquery.slideBox.min.js │ │ ├── bootstrap │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ └── npm.js │ │ ├── WEB-INF │ │ │ ├── Sitemesh3.xml │ │ │ └── web.xml │ │ ├── animal │ │ │ ├── test.jsp │ │ │ ├── error.jsp │ │ │ └── admin │ │ │ │ └── login.jsp │ │ ├── css │ │ │ ├── login.css │ │ │ ├── simplelightbox.min.css │ │ │ ├── jquery.slideBox.css │ │ │ ├── icons.css │ │ │ └── personal-info.css │ │ └── html │ │ │ ├── admin │ │ │ └── test.html │ │ │ ├── error.html │ │ │ └── personal-info.html │ ├── java │ │ └── com │ │ │ └── wind │ │ │ ├── util │ │ │ ├── UUIDUtil.java │ │ │ ├── AnimalDate.java │ │ │ ├── DataConvert.java │ │ │ ├── Message.java │ │ │ ├── MailUtil.java │ │ │ └── MyInterceptor.java │ │ │ ├── service │ │ │ ├── AnswerService.java │ │ │ ├── impl │ │ │ │ ├── AnswerServiceImpl.java │ │ │ │ ├── BlogServiceImpl.java │ │ │ │ ├── UserServiceImpl.java │ │ │ │ ├── AdminServiceImpl.java │ │ │ │ ├── PetServiceImpl.java │ │ │ │ ├── ApplyServiceImpl.java │ │ │ │ ├── CommentServiceImpl.java │ │ │ │ └── AdoptAnimalServiceImpl.java │ │ │ ├── BlogService.java │ │ │ ├── ApplyService.java │ │ │ ├── UsersService.java │ │ │ ├── AdminService.java │ │ │ ├── PetService.java │ │ │ ├── CommentService.java │ │ │ └── AdoptAnimalService.java │ │ │ ├── mapper │ │ │ ├── AnswerMapper.java │ │ │ ├── BlogMapper.java │ │ │ ├── ApplyMapper.java │ │ │ ├── UsersMapper.java │ │ │ ├── AdminMapper.java │ │ │ ├── PetMapper.java │ │ │ ├── CommentMapper.java │ │ │ └── AdoptAnimalMapper.java │ │ │ ├── controller │ │ │ ├── FileLoad.java │ │ │ ├── AdminLogin.java │ │ │ ├── AnswerController.java │ │ │ ├── ApplyController.java │ │ │ ├── BlogController.java │ │ │ ├── AdminController.java │ │ │ ├── CommentController.java │ │ │ ├── PetController.java │ │ │ └── UsersController.java │ │ │ └── entity │ │ │ ├── Answer.java │ │ │ ├── AdoptAnimal.java │ │ │ ├── Blog.java │ │ │ ├── Comment.java │ │ │ ├── Apply.java │ │ │ ├── Pet.java │ │ │ ├── Admin.java │ │ │ └── Users.java │ └── resource │ │ ├── db.properties │ │ ├── Spring-service.xml │ │ ├── log4j.properties │ │ ├── MyBatis.xml │ │ ├── mapper │ │ ├── ApplyMapper.xml │ │ ├── BlogMapper.xml │ │ ├── AnswerMapper.xml │ │ ├── AdminMapper.xml │ │ ├── UserMapper.xml │ │ ├── AdoptAnimalMapper.xml │ │ └── PetMapper.xml │ │ ├── SpringMVC.xml │ │ ├── Sprng-tx.xml │ │ └── Spring-dao.xml └── test │ └── java │ ├── BlogTest.java │ ├── UserTest.java │ ├── petTest.java │ ├── AdminTest.java │ ├── CommentTest.java │ └── AdoptAnimalTest.java ├── .idea ├── encodings.xml ├── vcs.xml ├── compiler.xml ├── misc.xml ├── dataSources.local.xml ├── dataSources.xml └── inspectionProfiles │ └── Project_Default.xml └── README.md /adopt.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/error/cut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/error/cut.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/login/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/login/bg.jpg -------------------------------------------------------------------------------- /src/main/webapp/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/webapp/images/error/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/error/banner.png -------------------------------------------------------------------------------- /src/main/webapp/images/login/passcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/login/passcode.jpg -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/css/rightbg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/js/houtai/css/rightbg.jpg -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/css/style.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/js/houtai/css/style.css -------------------------------------------------------------------------------- /src/main/webapp/images/login/tmbg-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/images/login/tmbg-white.png -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/css/boot-crm.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/js/houtai/css/boot-crm.css -------------------------------------------------------------------------------- /src/main/webapp/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/webapp/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/webapp/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/webapp/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/main/webapp/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/webapp/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/webapp/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/webapp/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/js/houtai/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/js/houtai/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/js/houtai/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManbaCode/adopt/HEAD/src/main/webapp/js/houtai/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 基于SSM的流浪猫狗领养网站的设计与实现 2 | 在学习了JavaWeb的各种东西以后,我需要做个工程来巩固和实践自己的知识,所以我利用暑假这个空闲的时间来做这个工程。 3 | ## 项目介绍 4 | 这个网站是为了流浪动物和想要领养流浪动物的爱心人士提供一个平台,能够使得它们在这个网站解决它们的问题。 5 | ## 项目要用到的东西: 6 | 环境 JDk1.8 tomcat9.0 7 | 工具 Maven, Git, GitHub, IDEA MySql5.6 8 | 项目中用到的技术 Spring SpringMVC MyBatis Ajax Json 9 | -------------------------------------------------------------------------------- /src/main/java/com/wind/util/UUIDUtil.java: -------------------------------------------------------------------------------- 1 | package com.wind.util; 2 | 3 | import java.util.UUID; 4 | 5 | /** 6 | * 生成激活码 7 | * @author 24255 8 | */ 9 | public class UUIDUtil { 10 | public static String getUUID(){ 11 | return UUID.randomUUID().toString().replaceAll("-",""); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resource/db.properties: -------------------------------------------------------------------------------- 1 | jdbc.driver=com.mysql.cj.jdbc.Driver 2 | jdbc.url=jdbc:mysql://localhost:3306/adopt?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true 3 | jdbc.username=root 4 | jdbc.password=admin 5 | jdbc.maxTotal=30 6 | jdbc.initPoolSize=5 -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/Sitemesh3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/webapp/animal/test.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%-- 3 | Created by IntelliJ IDEA. 4 | User: 24255 5 | Date: 2019/8/25 6 | Time: 16:20 7 | To change this template use File | Settings | File Templates. 8 | --%> 9 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 10 | 11 | 12 | Title 13 | 14 | 15 | 16 |

hfkdashiofdn

17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/webapp/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/webapp/css/login.css: -------------------------------------------------------------------------------- 1 | body{ color:#333; font-size:13px;} 2 | input,select,textarea{color:#333;} 3 | .bg{ width:100%; height:100%; position:absolute; background:url(http://localhost:8080/web/images/login/bg.jpg) } 4 | .panel{background:#fff;} 5 | form .form-group:last-child{padding-bottom:0;} 6 | .passcode{position:absolute;right:0;bottom:0;height:32px;margin:1px;border-left:solid 1px #ddd;text-align:center;line-height:32px;border-radius:0 4px 4px 0;} 7 | ul,li{ list-style-type:none;} 8 | 9 | .field-icon-right .icon{ bottom:0px; top:auto} 10 | .loginbox { background:url(http://localhost:8080/web/images/login/tmbg-white.png); border:0px;} 11 | .mySize{ 12 | width: 200px; 13 | height: 45px; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resource/Spring-service.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/wind/util/AnimalDate.java: -------------------------------------------------------------------------------- 1 | package com.wind.util; 2 | 3 | import org.springframework.beans.propertyeditors.CustomDateEditor; 4 | import org.springframework.web.bind.WebDataBinder; 5 | import org.springframework.web.bind.support.WebBindingInitializer; 6 | 7 | import java.text.DateFormat; 8 | import java.text.SimpleDateFormat; 9 | import java.util.Date; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-08-24 09:56 14 | */ 15 | public class AnimalDate implements WebBindingInitializer { 16 | @Override 17 | public void initBinder(WebDataBinder binder) { 18 | DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 19 | binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/wind/util/DataConvert.java: -------------------------------------------------------------------------------- 1 | package com.wind.util; 2 | 3 | 4 | 5 | import org.springframework.core.convert.converter.Converter; 6 | 7 | import java.text.ParseException; 8 | import java.text.SimpleDateFormat; 9 | import java.util.Date; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-08-05 19:23 14 | */ 15 | public class DataConvert implements Converter { 16 | 17 | @Override 18 | public Date convert(String source) { 19 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); 20 | Date date=null; 21 | try { 22 | date=simpleDateFormat.parse(source); 23 | } catch (ParseException e) { 24 | date=null; 25 | e.getMessage(); 26 | } 27 | return date; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/AnswerService.java: -------------------------------------------------------------------------------- 1 | package com.wind.service; 2 | 3 | import com.wind.entity.Answer; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author Mr Wu 9 | * @create: 2019-09-07 09:19 10 | */ 11 | public interface AnswerService { 12 | 13 | /** 14 | * 更具id查询用户的信息 15 | * @param id 回复的id 16 | * @return answer 17 | * */ 18 | List findByCommentId(Integer id); 19 | /** 20 | * 添加回复 21 | * @param answer 回复 22 | * @return int 23 | * */ 24 | int addAnswer(Answer answer); 25 | /** 26 | * 添加回复 27 | * @param answer 回复 28 | * @return int 29 | * */ 30 | int addAnswers(Answer answer); 31 | 32 | /** 33 | * 通过id查询值 34 | * @param id 回复的值 35 | * @return answer 36 | * */ 37 | Answer findById(Integer id); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/wind/mapper/AnswerMapper.java: -------------------------------------------------------------------------------- 1 | package com.wind.mapper; 2 | 3 | import com.wind.entity.Answer; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author Mr Wu 9 | * @create: 2019-08-29 14:03 10 | */ 11 | public interface AnswerMapper { 12 | 13 | 14 | /** 15 | * 更具id查询用户的信息 16 | * @param id 回复的id 17 | * @return answer 18 | * */ 19 | List findByCommentId(Integer id); 20 | /** 21 | * 添加回复 22 | * @param answer 回复 23 | * @return int 24 | * */ 25 | int addAnswer(Answer answer); 26 | 27 | /** 28 | * 添加回复 29 | * @param answer 回复 30 | * @return int 31 | * */ 32 | int addAnswers(Answer answer); 33 | 34 | /** 35 | * 通过id查询值 36 | * @param id 回复的值 37 | * @return answer 38 | * */ 39 | Answer findById(Integer id); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/resource/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=debug,stdout,logfile 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout 4 | log4j.appender.logfile=org.apache.log4j.FileAppender 5 | log4j.appender.logfile.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.logfile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %F %p %m%n 7 | log4j.logger.com.ibatis=DEBUG 8 | log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG 9 | log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG 10 | log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG 11 | log4j.logger.java.sql.Connection=DEBUG 12 | log4j.logger.java.sql.Statement=DEBUG 13 | log4j.logger.java.sql.PreparedStatement=DEBUG 14 | log4j.logger.com.mchange.v2.async.ThreadPoolAsynchronousRunner = ERROR 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/css/metisMenu.min.css: -------------------------------------------------------------------------------- 1 | /* 2 | * metismenu - v1.1.3 3 | * Easy menu jQuery plugin for Twitter Bootstrap 3 4 | * https://github.com/onokumus/metisMenu 5 | * 6 | * Made by Osman Nuri Okumus 7 | * Under MIT License 8 | */ 9 | 10 | .arrow{float:right;line-height:1.42857}.glyphicon.arrow:before{content:"\e079"}.active>a>.glyphicon.arrow:before{content:"\e114"}.fa.arrow:before{content:"\f104"}.active>a>.fa.arrow:before{content:"\f107"}.plus-times{float:right}.fa.plus-times:before{content:"\f067"}.active>a>.fa.plus-times{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.plus-minus{float:right}.fa.plus-minus:before{content:"\f067"}.active>a>.fa.plus-minus:before{content:"\f068"} -------------------------------------------------------------------------------- /.idea/dataSources.local.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #@ 7 | ` 8 | 9 | 10 | master_key 11 | root 12 | *:@ 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/wind/controller/FileLoad.java: -------------------------------------------------------------------------------- 1 | package com.wind.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | import java.util.UUID; 9 | 10 | /** 11 | * @author Mr Wu 12 | * @create: 2019-08-25 19:09 13 | */ 14 | @Controller 15 | public class FileLoad { 16 | 17 | 18 | public static String load(MultipartFile file) { 19 | String picName = UUID.randomUUID().toString(); 20 | //获取上传文件得元素得名称 21 | String fileName = file.getOriginalFilename(); 22 | String substring = fileName.substring(fileName.lastIndexOf(".")); 23 | //上传文件 24 | try { 25 | file.transferTo(new File("C:/Users/24255/Pictures/sky/" + picName + substring)); 26 | } catch (IOException e) { 27 | e.printStackTrace(); 28 | } 29 | String name = picName + substring; 30 | 31 | return name; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/webapp/html/admin/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 35 | 36 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mysql.8 6 | true 7 | com.mysql.cj.jdbc.Driver 8 | jdbc:mysql://localhost:3306/adopt?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/test/java/BlogTest.java: -------------------------------------------------------------------------------- 1 | import com.wind.entity.Blog; 2 | import com.wind.mapper.BlogMapper; 3 | import com.wind.service.BlogService; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.test.context.ContextConfiguration; 8 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @author Mr Wu 14 | * @create: 2019-08-20 15:17 15 | */ 16 | @RunWith(SpringJUnit4ClassRunner.class) 17 | @ContextConfiguration({ "classpath:Spring-dao.xml", "classpath:Spring-service.xml" }) 18 | public class BlogTest { 19 | 20 | @Autowired 21 | private BlogService blogService; 22 | 23 | @Autowired 24 | private BlogMapper blogMapper; 25 | @Test 26 | public void findById(){ 27 | List blogs = blogService.getBlogs(); 28 | for (Blog b:blogs){ 29 | System.out.println(b); 30 | } 31 | } 32 | 33 | 34 | @Test 35 | public void select(){ 36 | Blog byId = blogService.findById(1); 37 | System.out.println(byId); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/wind/controller/AdminLogin.java: -------------------------------------------------------------------------------- 1 | package com.wind.controller; 2 | 3 | import com.wind.entity.Admin; 4 | import com.wind.service.AdminService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | /** 13 | * @author Mr Wu 14 | * @create: 2019-08-22 14:12 15 | */ 16 | @Controller 17 | 18 | public class AdminLogin { 19 | 20 | @Autowired 21 | private AdminService adminService; 22 | 23 | @RequestMapping("login.action") 24 | public String login(Admin admin, Model model, HttpServletRequest request){ 25 | Admin admin1 = adminService.loginAdmin(admin); 26 | request.getSession().setAttribute("admin",admin1); 27 | System.out.println(admin1); 28 | if(admin1!=null){ 29 | return "redirect:/animal/admin/admin.jsp"; 30 | }else { 31 | model.addAttribute("msg","账号或者密码有错,请重新输入!"); 32 | return "/animal/admin/login"; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/UserTest.java: -------------------------------------------------------------------------------- 1 | import com.wind.entity.Users; 2 | import com.wind.mapper.UsersMapper; 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-08-21 23:14 14 | */ 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration({ "classpath:Spring-dao.xml", "classpath:Spring-service.xml" }) 17 | public class UserTest { 18 | 19 | 20 | @Autowired 21 | private UsersMapper usersMapper; 22 | 23 | 24 | @Test 25 | public void select(){ 26 | List users = usersMapper.getUsers(); 27 | for(Users u:users){ 28 | System.out.println(u); 29 | } 30 | } 31 | 32 | @Test 33 | public void select1(){ 34 | Users users=new Users(); 35 | users.setUserName("张三丰"); 36 | users.setPassword("zsf123"); 37 | Users user = usersMapper.loginUser(users); 38 | System.out.println(user); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/webapp/html/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Home 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

error

19 |
20 |
21 |
22 |

我们很抱歉!

23 |

您请求的页面无法找到。

24 |

返回首页 或发送邮件 support@w3l.com 联系我们

25 | 26 |
27 |
28 |
29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/impl/AnswerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wind.service.impl; 2 | 3 | import com.wind.entity.Answer; 4 | import com.wind.mapper.AnswerMapper; 5 | import com.wind.service.AnswerService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-09-07 09:20 14 | */ 15 | @Service 16 | public class AnswerServiceImpl implements AnswerService { 17 | 18 | @Autowired 19 | private AnswerMapper answerMapper; 20 | 21 | @Override 22 | public List findByCommentId(Integer id) { 23 | List answers = answerMapper.findByCommentId(id); 24 | return answers; 25 | } 26 | 27 | @Override 28 | public int addAnswer(Answer answer) { 29 | int i = answerMapper.addAnswer(answer); 30 | return i; 31 | } 32 | 33 | @Override 34 | public int addAnswers(Answer answer) { 35 | int i = answerMapper.addAnswers(answer); 36 | return i; 37 | } 38 | 39 | @Override 40 | public Answer findById(Integer id) { 41 | Answer answer = answerMapper.findById(id); 42 | return answer; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/wind/mapper/BlogMapper.java: -------------------------------------------------------------------------------- 1 | package com.wind.mapper; 2 | 3 | import com.wind.entity.Blog; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-20 14:41 11 | */ 12 | public interface BlogMapper { 13 | 14 | /** 15 | * 新增插入新的活动 16 | * @param blog 新增对象 17 | * @return int 18 | * */ 19 | int addBlog(Blog blog); 20 | 21 | /** 22 | * 删除活动 23 | * @param id 活动的id 24 | * @return int 25 | * */ 26 | int deleteBlog(Integer id); 27 | 28 | /** 29 | * 更新活动信息 30 | * @param blog 更新活动的对象 31 | * @return int 32 | * */ 33 | int updateBlog(Blog blog); 34 | 35 | /** 36 | * 查询所有的对象 37 | * @return List 38 | * */ 39 | List getBlogs(); 40 | 41 | /** 42 | * 根据id查询对象 43 | * @param id 对象id 44 | * @return Blog 45 | * */ 46 | Blog findById(Integer id); 47 | 48 | /** 49 | * 根据活动时间查询对象 50 | * @param actionTime 活动的时间 51 | * @return Blog 52 | * */ 53 | List findByTime(String actionTime); 54 | 55 | /** 56 | * 批量删除 57 | * @param ids id的集合 58 | * */ 59 | void deleteBatch(@Param("ids")Listids); 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/BlogService.java: -------------------------------------------------------------------------------- 1 | package com.wind.service; 2 | 3 | import com.wind.entity.Blog; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-20 15:02 11 | */ 12 | public interface BlogService { 13 | 14 | /** 15 | * 新增插入新的活动 16 | * @param blog 新增对象 17 | * @return int 18 | * */ 19 | int addBlog(Blog blog); 20 | 21 | /** 22 | * 删除活动 23 | * @param id 活动的id 24 | * @return int 25 | * */ 26 | int deleteBlog(Integer id); 27 | 28 | /** 29 | * 更新活动信息 30 | * @param blog 更新活动的对象 31 | * @return int 32 | * */ 33 | int updateBlog(Blog blog); 34 | 35 | /** 36 | * 查询所有的对象 37 | * @return List 38 | * */ 39 | List getBlogs(); 40 | 41 | /** 42 | * 根据id查询对象 43 | * @param id 对象id 44 | * @return Blog 45 | * */ 46 | Blog findById(Integer id); 47 | 48 | /** 49 | * 根据活动时间查询对象 50 | * @param actionTime 活动的时间 51 | * @return Blog 52 | * */ 53 | List findByTime(String actionTime); 54 | 55 | /** 56 | * 批量删除 57 | * @param ids id的集合 58 | * */ 59 | void deleteBatch(@Param("ids")Listids); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/wind/mapper/ApplyMapper.java: -------------------------------------------------------------------------------- 1 | package com.wind.mapper; 2 | 3 | import com.wind.entity.Apply; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-09-05 10:01 11 | */ 12 | public interface ApplyMapper { 13 | 14 | /** 15 | * 增加申请 16 | * @param apply 申请的信息 17 | * @return int 18 | * */ 19 | int addApply(Apply apply); 20 | 21 | /** 22 | * 修改申请 23 | * @param apply 24 | * @return int 25 | * */ 26 | int updateApply(Apply apply); 27 | 28 | /** 29 | * 删除申请信息 30 | * @param id 领养的的id 31 | * @return int 32 | * */ 33 | int deleteApply(Integer id); 34 | 35 | 36 | /** 37 | * 查询所有的领养信息 38 | * @return list 39 | * */ 40 | List getApply(); 41 | 42 | 43 | /** 44 | * 根据领养id查询信息 45 | * @param id 用户id 46 | * @return adoptAnimal 47 | * */ 48 | Apply findById(Integer id); 49 | 50 | /** 51 | * 根据领养id查询信息 52 | * @param state 是否被处理 53 | * @return adoptAnimal 54 | * */ 55 | List findByState(Integer state); 56 | 57 | 58 | /** 59 | * 批量删除 60 | * @param ids id的集合 61 | * */ 62 | void deleteBatch(@Param("ids")Listids); 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/ApplyService.java: -------------------------------------------------------------------------------- 1 | package com.wind.service; 2 | 3 | import com.wind.entity.Apply; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-09-05 10:21 11 | */ 12 | public interface ApplyService { 13 | 14 | /** 15 | * 增加申请 16 | * @param apply 申请的信息 17 | * @return int 18 | * */ 19 | int addApply(Apply apply); 20 | 21 | /** 22 | * 修改申请 23 | * @param apply 24 | * @return int 25 | * */ 26 | int updateApply(Apply apply); 27 | 28 | /** 29 | * 删除申请信息 30 | * @param id 领养的的id 31 | * @return int 32 | * */ 33 | int deleteApply(Integer id); 34 | 35 | 36 | /** 37 | * 查询所有的领养信息 38 | * @return list 39 | * */ 40 | List getApply(); 41 | 42 | 43 | /** 44 | * 根据领养id查询信息 45 | * @param id 用户id 46 | * @return adoptAnimal 47 | * */ 48 | Apply findById(Integer id); 49 | 50 | /** 51 | * 根据领养id查询信息 52 | * @param state 是否被处理 53 | * @return adoptAnimal 54 | * */ 55 | List findByState(Integer state); 56 | 57 | 58 | /** 59 | * 批量删除 60 | * @param ids id的集合 61 | * */ 62 | void deleteBatch(@Param("ids")Listids); 63 | } 64 | -------------------------------------------------------------------------------- /src/main/webapp/js/move-top.js: -------------------------------------------------------------------------------- 1 | /* UItoTop jQuery Plugin 1.2 | Matt Varone | http://www.mattvarone.com/web-design/uitotop-jquery-plugin */ 2 | (function($){$.fn.UItoTop=function(options){var defaults={text:'To Top',min:200,inDelay:600,outDelay:400,containerID:'toTop',containerHoverID:'toTopHover',scrollSpeed:1000,easingType:'linear'},settings=$.extend(defaults,options),containerIDhash='#'+settings.containerID,containerHoverIDHash='#'+settings.containerHoverID;$('body').append(''+settings.text+'');$(containerIDhash).hide().on('click.UItoTop',function(){$('html, body').animate({scrollTop:0},settings.scrollSpeed,settings.easingType);$('#'+settings.containerHoverID,this).stop().animate({'opacity':0},settings.inDelay,settings.easingType);return false;}).prepend('').hover(function(){$(containerHoverIDHash,this).stop().animate({'opacity':1},600,'linear');},function(){$(containerHoverIDHash,this).stop().animate({'opacity':0},700,'linear');});$(window).scroll(function(){var sd=$(window).scrollTop();if(typeof document.body.style.maxHeight==="undefined"){$(containerIDhash).css({'position':'absolute','top':sd+$(window).height()-50});} 3 | if(sd>settings.min) 4 | $(containerIDhash).fadeIn(settings.inDelay);else 5 | $(containerIDhash).fadeOut(settings.Outdelay);});};})(jQuery); -------------------------------------------------------------------------------- /src/test/java/petTest.java: -------------------------------------------------------------------------------- 1 | import com.wind.entity.Pet; 2 | import com.wind.mapper.PetMapper; 3 | import com.wind.service.PetService; 4 | import com.github.pagehelper.PageHelper; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.test.context.ContextConfiguration; 9 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @author Mr Wu 15 | * @create: 2019-08-21 23:39 16 | */ 17 | @RunWith(SpringJUnit4ClassRunner.class) 18 | @ContextConfiguration({ "classpath:Spring-dao.xml", "classpath:Spring-service.xml" }) 19 | public class petTest { 20 | 21 | @Autowired 22 | private PetMapper petMapper; 23 | 24 | @Autowired 25 | private PetService petService; 26 | 27 | @Test 28 | public void select(){ 29 | List pets = petMapper.getPets(); 30 | System.out.println(pets); 31 | } 32 | 33 | @Test 34 | public void update(){ 35 | PageHelper.startPage(1,3); 36 | List pets = petService.getPets(); 37 | System.out.println(pets); 38 | } 39 | 40 | @Test 41 | public void select1(){ 42 | Pet byId = petService.findById(10); 43 | System.out.println(byId); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/js/sb-admin-2.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | $('#side-menu').metisMenu(); 4 | 5 | }); 6 | 7 | //Loads the correct sidebar on window load, 8 | //collapses the sidebar on window resize. 9 | // Sets the min-height of #page-wrapper to window size 10 | $(function() { 11 | $(window).bind("load resize", function() { 12 | topOffset = 50; 13 | width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width; 14 | if (width < 768) { 15 | $('div.navbar-collapse').addClass('collapse'); 16 | topOffset = 100; // 2-row-menu 17 | } else { 18 | $('div.navbar-collapse').removeClass('collapse'); 19 | } 20 | 21 | height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1; 22 | height = height - topOffset; 23 | if (height < 1) height = 1; 24 | if (height > topOffset) { 25 | // $("#page-wrapper").css("min-height", (height) + "px"); 26 | } 27 | }); 28 | 29 | var url = window.location; 30 | var element = $('ul.nav a').filter(function() { 31 | return this.href == url || url.href.indexOf(this.href) == 0; 32 | }).addClass('active').parent().parent().addClass('in').parent(); 33 | if (element.is('li')) { 34 | element.addClass('active'); 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/UsersService.java: -------------------------------------------------------------------------------- 1 | package com.wind.service; 2 | 3 | import com.wind.entity.Users; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-21 10:45 11 | */ 12 | public interface UsersService { 13 | /** 14 | * 新增的用户 15 | * @param user 新增的用户 16 | * @return int 17 | * */ 18 | int addUser(Users user); 19 | 20 | /** 21 | * 删除用户 22 | * @param id 用户的id 23 | * @return int 24 | * */ 25 | int deleteUser(Integer id); 26 | 27 | /** 28 | * 更新用户的信息 29 | * @param user 更新的用户信息 30 | * @return int 31 | * */ 32 | int updateUser(Users user); 33 | 34 | /** 35 | * 查询所有的用户 36 | * @return list 37 | * */ 38 | List getUsers(); 39 | 40 | /** 41 | * 根据用户id查询信息 42 | * @param id 用户id 43 | * @return users 44 | * */ 45 | Users findById(Integer id); 46 | 47 | /** 48 | * 根据用户名查询用户信息 49 | * @param userName 用户名 50 | * @return users 51 | * */ 52 | List findByName(String userName); 53 | 54 | /** 55 | * 用户登录 56 | * @param users 用户的账号和密码 57 | * @return Users 58 | * */ 59 | Users loginUser(Users users); 60 | /** 61 | * 批量删除 62 | * @param ids id的集合 63 | * */ 64 | void deleteBatch(@Param("ids")Listids); 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/wind/mapper/UsersMapper.java: -------------------------------------------------------------------------------- 1 | package com.wind.mapper; 2 | 3 | import com.wind.entity.Users; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-20 14:42 11 | */ 12 | public interface UsersMapper { 13 | 14 | 15 | /** 16 | * 新增的用户 17 | * @param user 新增的用户 18 | * @return int 19 | * */ 20 | int addUser(Users user); 21 | 22 | /** 23 | * 删除用户 24 | * @param id 用户的id 25 | * @return int 26 | * */ 27 | int deleteUser(Integer id); 28 | 29 | /** 30 | * 更新用户的信息 31 | * @param user 更新的用户信息 32 | * @return int 33 | * */ 34 | int updateUser(Users user); 35 | 36 | /** 37 | * 查询所有的用户 38 | * @return list 39 | * */ 40 | List getUsers(); 41 | 42 | /** 43 | * 根据用户id查询信息 44 | * @param id 用户id 45 | * @return users 46 | * */ 47 | Users findById(Integer id); 48 | 49 | /** 50 | * 根据用户名查询用户信息 51 | * @param userName 用户名 52 | * @return users 53 | * */ 54 | List findByName(String userName); 55 | 56 | /** 57 | * 用户登录 58 | * @param users 用户的账号和密码 59 | * @return Users 60 | * */ 61 | Users loginUser(Users users); 62 | 63 | /** 64 | * 批量删除 65 | * @param ids id的集合 66 | * */ 67 | void deleteBatch(@Param("ids")Listids); 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package com.wind.service; 2 | 3 | import com.wind.entity.Admin; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-21 10:45 11 | */ 12 | public interface AdminService { 13 | /** 14 | * 新增的管理员 15 | * @param admin 新增的管理员 16 | * @return int 17 | * */ 18 | int addAdmin(Admin admin); 19 | 20 | /** 21 | * 删除管理员 22 | * @param id 管理员的id 23 | * @return int 24 | * */ 25 | int deleteAdmin(Integer id); 26 | 27 | /** 28 | * 更新管理员的信息 29 | * @param admin 更新的管理员信息 30 | * @return int 31 | * */ 32 | int updateAdmin(Admin admin); 33 | 34 | /** 35 | * 查询所有的管理员 36 | * @return list 37 | * */ 38 | List getAdmins(); 39 | 40 | /** 41 | * 根据管理员id查询信息 42 | * @param id 管理员id 43 | * @return Admin 44 | * */ 45 | Admin findById(Integer id); 46 | 47 | /** 48 | * 管理员的登录 49 | * @param admin 管理员的账号和密码 50 | * @return Admin 51 | * */ 52 | Admin loginAdmin(Admin admin); 53 | /** 54 | * 根据用户名查询管理员信息 55 | * @param adminName 用户名 56 | * @return Admin 57 | * */ 58 | List findByName(String adminName); 59 | 60 | /** 61 | * 批量删除 62 | * @param ids id的集合 63 | * */ 64 | void deleteBatch(@Param("ids")Listids); 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/wind/mapper/AdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.wind.mapper; 2 | 3 | import com.wind.entity.Admin; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-20 14:41 11 | */ 12 | public interface AdminMapper { 13 | 14 | /** 15 | * 新增的管理员 16 | * @param admin 新增的管理员 17 | * @return int 18 | * */ 19 | int addAdmin(Admin admin); 20 | 21 | /** 22 | * 删除管理员 23 | * @param id 管理员的id 24 | * @return int 25 | * */ 26 | int deleteAdmin(Integer id); 27 | 28 | /** 29 | * 更新管理员的信息 30 | * @param admin 更新的管理员信息 31 | * @return int 32 | * */ 33 | int updateAdmin(Admin admin); 34 | 35 | /** 36 | * 查询所有的管理员 37 | * @return list 38 | * */ 39 | List getAdmins(); 40 | 41 | /** 42 | * 根据管理员id查询信息 43 | * @param id 管理员id 44 | * @return Admin 45 | * */ 46 | Admin findById(Integer id); 47 | 48 | /** 49 | * 管理员的登录 50 | * @param admin 管理员的账号和密码 51 | * @return Admin 52 | * */ 53 | Admin loginAdmin(Admin admin); 54 | 55 | /** 56 | * 根据用户名查询管理员信息 57 | * @param adminName 用户名 58 | * @return Admin 59 | * */ 60 | List findByName(String adminName); 61 | 62 | /** 63 | * 批量删除 64 | * @param ids id的集合 65 | * */ 66 | void deleteBatch(@Param("ids")Listids); 67 | } 68 | -------------------------------------------------------------------------------- /src/test/java/AdminTest.java: -------------------------------------------------------------------------------- 1 | import com.wind.entity.Admin; 2 | import com.wind.mapper.AdminMapper; 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-08-21 23:34 14 | */ 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration({ "classpath:Spring-dao.xml", "classpath:Spring-service.xml" }) 17 | public class AdminTest { 18 | 19 | @Autowired 20 | private AdminMapper adminMapper; 21 | 22 | 23 | @Test 24 | public void select(){ 25 | List admins = adminMapper.getAdmins(); 26 | System.out.println(admins); 27 | } 28 | 29 | @Test 30 | public void add(){ 31 | // int i = adminMapper.addAdmin(new Admin("熊四", "121", "111", "19802841023", "234552091@qq.com", new Date(), "男", "1111")); 32 | // String ste=i>0?"插入成功":"插入失败"; 33 | // System.out.println(ste); 34 | } 35 | 36 | @Test 37 | public void delete(){ 38 | int i = adminMapper.deleteAdmin(10); 39 | System.out.println(i); 40 | } 41 | 42 | @Test 43 | public void select1(){ 44 | 45 | } 46 | 47 | @Test 48 | public void select2(){ 49 | Admin admin=adminMapper.findById(1); 50 | System.out.println(admin); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/PetService.java: -------------------------------------------------------------------------------- 1 | package com.wind.service; 2 | 3 | import com.wind.entity.Pet; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-21 10:45 11 | */ 12 | public interface PetService { 13 | /** 14 | * 新增的动物 15 | * @param pet 新增的动物 16 | * @return int 17 | * */ 18 | int addPet(Pet pet); 19 | 20 | /** 21 | * 删除动物 22 | * @param id 动物的id 23 | * @return int 24 | * */ 25 | int deletePet(Integer id); 26 | 27 | /** 28 | * 更新动物的信息 29 | * @param pet 更新的动物信息 30 | * @return int 31 | * */ 32 | int updatePet(Pet pet); 33 | 34 | /** 35 | * 更新宠物的状态 36 | * @param pet 更新的宠物信息 37 | * @return int 38 | * */ 39 | int updateState(Pet pet); 40 | /** 41 | * 查询所有的动物 42 | * @return list 43 | * */ 44 | List getPets(); 45 | 46 | /** 47 | * 查询所有的动物 48 | * @param state 宠物现在的状态 49 | * @return list 50 | * */ 51 | List findByState(Integer state); 52 | /** 53 | * 根据动物id查询信息 54 | * @param id 用户id 55 | * @return pet 56 | * */ 57 | Pet findById(Integer id); 58 | /** 59 | * 根据动物名查询用户信息 60 | * @param petType 宠物类型 61 | * @return pet 62 | * */ 63 | List findByPetType(String petType); 64 | 65 | /** 66 | * 批量删除 67 | * @param ids id的集合 68 | * */ 69 | void deleteBatch(@Param("ids")Listids); 70 | } 71 | -------------------------------------------------------------------------------- /src/main/webapp/animal/error.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: 24255 4 | Date: 2019/8/22 5 | Time: 23:52 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | 12 | 13 | Home 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 |
26 |
27 |

error

28 |
29 |
30 |
31 |

我们很抱歉!

32 |

您请求的页面无法找到。

33 |

返回首页 或发送邮件 support@w3l.com 联系我们

34 | 35 |
36 |
37 |
38 |
39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/wind/mapper/PetMapper.java: -------------------------------------------------------------------------------- 1 | package com.wind.mapper; 2 | 3 | import com.wind.entity.Pet; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-20 14:42 11 | */ 12 | public interface PetMapper { 13 | 14 | /** 15 | * 新增的动物 16 | * @param pet 新增的动物 17 | * @return int 18 | * */ 19 | int addPet(Pet pet); 20 | 21 | /** 22 | * 删除动物 23 | * @param id 动物的id 24 | * @return int 25 | * */ 26 | int deletePet(Integer id); 27 | 28 | /** 29 | * 更新动物的信息 30 | * @param pet 更新的动物信息 31 | * @return int 32 | * */ 33 | int updatePet(Pet pet); 34 | 35 | /** 36 | * 更新宠物的状态 37 | * @param pet 更新的宠物信息 38 | * @return int 39 | * */ 40 | int updateState(Pet pet); 41 | /** 42 | * 查询所有的动物 43 | * @return list 44 | * */ 45 | List getPets(); 46 | 47 | /** 48 | * 查询所有的动物 49 | * @param state 宠物现在的状态 50 | * @return list 51 | * */ 52 | List findByState(Integer state); 53 | 54 | /** 55 | * 根据动物id查询信息 56 | * @param id 用户id 57 | * @return pet 58 | * */ 59 | Pet findById(Integer id); 60 | /** 61 | * 根据动物名查询用户信息 62 | * @param petType 宠物类型 63 | * @return pet 64 | * */ 65 | List findByPetType(String petType); 66 | 67 | /** 68 | * 批量删除 69 | * @param ids id的集合 70 | * */ 71 | void deleteBatch(@Param("ids")Listids); 72 | } 73 | -------------------------------------------------------------------------------- /src/main/resource/MyBatis.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/resource/mapper/ApplyMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | INSERT INTO apply(name,email,age,telephone,message,applyTime) VALUES (#{name},#{email},#{age},#{telephone},#{message},#{applyTime}) 9 | 10 | 11 | 12 | DELETE FROM apply WHERE id=#{id} 13 | 14 | 15 | UPDATE apply SET name=#{name},email=#{email},age=#{age},telephone=#{telephone},message=#{message},applyTime=#{applyTime},state=#{state} WHERE id=#{id} 16 | 17 | 18 | 21 | 22 | 25 | 26 | 29 | 30 | 31 | DELETE FROM apply 32 | 33 | #{id} 34 | 35 | 36 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /src/main/java/com/wind/util/Message.java: -------------------------------------------------------------------------------- 1 | package com.wind.util; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author Mr Wu 8 | * @create: 2019-08-20 15:12 9 | */ 10 | public class Message { 11 | 12 | /** 13 | * 状态码 100-成功 200-失败 14 | * */ 15 | private int code; 16 | 17 | /** 18 | * 提示信息 19 | * */ 20 | private String message; 21 | 22 | /** 23 | * 用户要返回给浏览器的数据 24 | * */ 25 | private Map extend = new HashMap(); 26 | 27 | public static Message success(){ 28 | Message result = new Message(); 29 | result.setCode(100); 30 | result.setMessage("处理成功!"); 31 | return result; 32 | } 33 | 34 | public static Message fail(){ 35 | Message result = new Message(); 36 | result.setCode(200); 37 | result.setMessage("处理失败!"); 38 | return result; 39 | } 40 | 41 | public Message add(String key,Object value){ 42 | this.getExtend().put(key, value); 43 | return this; 44 | } 45 | 46 | public int getCode() { 47 | return code; 48 | } 49 | 50 | public void setCode(int code) { 51 | this.code = code; 52 | } 53 | 54 | public String getMessage() { 55 | return message; 56 | } 57 | 58 | public void setMessage(String message) { 59 | this.message = message; 60 | } 61 | 62 | public Map getExtend() { 63 | return extend; 64 | } 65 | 66 | public void setExtend(Map extend) { 67 | this.extend = extend; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/impl/BlogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wind.service.impl; 2 | 3 | import com.wind.entity.Blog; 4 | import com.wind.mapper.BlogMapper; 5 | import com.wind.service.BlogService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-08-20 15:03 14 | */ 15 | @Service 16 | public class BlogServiceImpl implements BlogService { 17 | 18 | @Autowired 19 | BlogMapper blogMapper; 20 | 21 | @Override 22 | public int addBlog(Blog blog) { 23 | int i = blogMapper.addBlog(blog); 24 | return i; 25 | } 26 | 27 | @Override 28 | public int deleteBlog(Integer id) { 29 | int i = blogMapper.deleteBlog(id); 30 | return i; 31 | } 32 | 33 | @Override 34 | public int updateBlog(Blog blog) { 35 | int i = blogMapper.updateBlog(blog); 36 | return i; 37 | } 38 | 39 | @Override 40 | public List getBlogs() { 41 | List blogs = blogMapper.getBlogs(); 42 | return blogs; 43 | } 44 | 45 | @Override 46 | public Blog findById(Integer id) { 47 | Blog blog = blogMapper.findById(id); 48 | return blog; 49 | } 50 | 51 | @Override 52 | public List findByTime(String actionTime) { 53 | List blog = blogMapper.findByTime(actionTime); 54 | return blog; 55 | } 56 | 57 | @Override 58 | public void deleteBatch(List ids) { 59 | blogMapper.deleteBatch(ids); 60 | } 61 | 62 | 63 | public void judge(Blog blog){ 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/webapp/js/demo.js: -------------------------------------------------------------------------------- 1 | //定义全局变量和定时器 2 | var i = 0 ; 3 | var timer; 4 | 5 | $(document).ready(function(){ 6 | //用jquery方法设置第一张图片显示,其余隐藏 7 | $('.ig').eq(0).show().siblings('.ig').hide(); 8 | 9 | //调用showTime()函数(轮播函数) 10 | showTime(); 11 | 12 | //当鼠标经过下面的数字时,触发两个事件(鼠标悬停和鼠标离开) 13 | $('.tab').hover(function(){ 14 | //获取当前i的值,并显示,同时还要清除定时器 15 | i = $(this).index(); 16 | Show(); 17 | clearInterval(timer); 18 | },function(){ 19 | // 20 | showTime(); 21 | }); 22 | 23 | //鼠标点击左侧的箭头 24 | $('.btn1').click(function(){ 25 | clearInterval(timer); 26 | if(i == 0){ 27 | i = 5;//注意此时i的值 28 | } 29 | i--; 30 | Show(); 31 | showTime(); 32 | }); 33 | 34 | //鼠标点击右侧的箭头 35 | $('.btn2').click(function(){ 36 | clearInterval(timer); 37 | if(i == 4){ 38 | i = -1;//注意此时i的值 39 | } 40 | i++; 41 | Show(); 42 | showTime(); 43 | }); 44 | 45 | }); 46 | 47 | 48 | //创建一个showTime函数 49 | function showTime(){ 50 | //定时器 51 | timer = setInterval(function(){ 52 | //调用一个Show()函数 53 | Show(); 54 | i++; 55 | //当图片是最后一张的后面时,设置图片为第一张 56 | if(i==5){ 57 | i=0; 58 | } 59 | },2000); 60 | } 61 | 62 | 63 | //创建一个Show函数 64 | function Show(){ 65 | //在这里可以用其他jquery的动画 66 | $('.ig').eq(i).fadeIn(300).siblings('.ig').fadeOut(300); 67 | 68 | //给.tab创建一个新的Class为其添加一个新的样式,并且要在css代码中设置该样式 69 | $('.tab').eq(i).addClass('bg').siblings('.tab').removeClass('bg'); 70 | 71 | /* 72 | * css中添加的代码: 73 | * .bg{ background-color: #f00; } 74 | * */ 75 | } -------------------------------------------------------------------------------- /src/main/java/com/wind/mapper/CommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.wind.mapper; 2 | 3 | import com.wind.entity.Comment; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-20 14:42 11 | */ 12 | public interface CommentMapper { 13 | 14 | /** 15 | * 新增的评论 16 | * @param comment 新增的评论 17 | * @return int 18 | * */ 19 | int addComment(Comment comment); 20 | 21 | /** 22 | * 删除评论 23 | * @param id 评论的id 24 | * @return int 25 | * */ 26 | int deleteComment(Integer id); 27 | 28 | /** 29 | * 更新评论的信息 30 | * @param comment 更新的评论信息 31 | * @return int 32 | * */ 33 | int updateComment(Comment comment); 34 | 35 | /** 36 | * 破除用户表外键关系 37 | * @param user_id 评论表的外键 38 | * */ 39 | void updateRelationUser(Integer user_id); 40 | 41 | /** 42 | * 破除宠物表的外键 43 | * @param pet_id 评论表的主键 44 | * */ 45 | void updateRelationPet(Integer pet_id); 46 | /** 47 | * 查询所有的评论 48 | * @return list 49 | * */ 50 | List getComments(); 51 | 52 | /** 53 | * 查询所有的评论 54 | * @param pet_id 宠物狗的外键 55 | * @return list 56 | * */ 57 | List findByPetId(Integer pet_id); 58 | 59 | /** 60 | * 查询用户的评论 61 | * @param name 名字 62 | * @return list 63 | * */ 64 | List findByName(String name); 65 | 66 | /** 67 | * 根据评论表id查询信息 68 | * @param id 69 | * @return comment 70 | * */ 71 | Comment findById(Integer id); 72 | 73 | 74 | 75 | /** 76 | * 批量删除 77 | * @param ids id的集合 78 | * */ 79 | void deleteBatch(@Param("ids")Listids); 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/CommentService.java: -------------------------------------------------------------------------------- 1 | package com.wind.service; 2 | 3 | import com.wind.entity.Comment; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Mr Wu 10 | * @create: 2019-08-21 10:46 11 | */ 12 | public interface CommentService { 13 | 14 | /** 15 | * 新增的评论 16 | * @param comment 新增的评论 17 | * @return int 18 | * */ 19 | int addComment(Comment comment); 20 | 21 | /** 22 | * 删除评论 23 | * @param id 评论的id 24 | * @return int 25 | * */ 26 | int deleteComment(Integer id); 27 | 28 | /** 29 | * 更新评论的信息 30 | * @param comment 更新的评论信息 31 | * @return int 32 | * */ 33 | int updateComment(Comment comment); 34 | 35 | 36 | /** 37 | * 破除用户表外键关系 38 | * @param user_id 领养表的外键 39 | * */ 40 | void updateRelationUser(Integer user_id); 41 | 42 | /** 43 | * 破除宠物表的外键 44 | * @param pet_id 领养表的主键 45 | * */ 46 | void updateRelationPet(Integer pet_id); 47 | 48 | /** 49 | * 查询所有的评论 50 | * @return list 51 | * */ 52 | List getComments(); 53 | 54 | /** 55 | * 查询所有的评论 56 | * @param pet_id 宠物狗的外键 57 | * @return list 58 | * */ 59 | List findByPetId(Integer pet_id); 60 | 61 | /** 62 | * 查询用户的评论 63 | * @param name 名字 64 | * @return list 65 | * */ 66 | List findByName(String name); 67 | /** 68 | * 根据评论表id查询信息 69 | * @param id 评论的id 70 | * @return comment 71 | * */ 72 | Comment findById(Integer id); 73 | 74 | 75 | /** 76 | * 批量删除 77 | * @param ids id的集合 78 | * */ 79 | void deleteBatch(@Param("ids")Listids); 80 | } 81 | -------------------------------------------------------------------------------- /src/test/java/CommentTest.java: -------------------------------------------------------------------------------- 1 | import com.wind.entity.Answer; 2 | import com.wind.entity.Comment; 3 | import com.wind.entity.Users; 4 | import com.wind.mapper.CommentMapper; 5 | import com.wind.service.AnswerService; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * @author Mr Wu 16 | * @create: 2019-08-21 19:26 17 | */ 18 | @RunWith(SpringJUnit4ClassRunner.class) 19 | @ContextConfiguration({ "classpath:Spring-dao.xml","classpath:Spring-service.xml" }) 20 | public class CommentTest { 21 | 22 | @Autowired 23 | private CommentMapper commentMapper; 24 | 25 | @Autowired 26 | private AnswerService answerService; 27 | 28 | @Test 29 | public void select(){ 30 | List comments = commentMapper.getComments(); 31 | for(Comment c: comments){ 32 | System.out.println(c); 33 | } 34 | } 35 | 36 | @Test 37 | public void select1(){ 38 | Comment comment=new Comment(); 39 | Users users=new Users(); 40 | users.setId(3); 41 | comment.setUser(users); 42 | comment.setId(3); 43 | Comment byId = commentMapper.findById(3); 44 | System.out.println(byId); 45 | } 46 | 47 | @Test 48 | public void selectName(){ 49 | Comment comment1= commentMapper.findById(3); 50 | System.out.println(comment1); 51 | 52 | } 53 | 54 | @Test 55 | public void selec1(){ 56 | Answer byId = answerService.findById(10); 57 | System.out.println(byId); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/resource/mapper/BlogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | INSERT INTO blog(actionTime,address,peoples,event,title) 10 | VALUES (#{actionTime},#{address},#{peoples},#{event},#{title}) 11 | 12 | 13 | 14 | DELETE FROM blog 15 | 16 | #{id} 17 | 18 | 19 | 20 | 21 | DELETE FROM blog WHERE id=#{id} 22 | 23 | 24 | 25 | 26 | UPDATE blog set actionTime=#{actionTime},address=#{address},peoples=#{peoples}, 27 | event=#{event},title=#{title} WHERE id=#{id} 28 | 29 | 30 | 33 | 34 | 37 | 38 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wind.service.impl; 2 | 3 | import com.wind.entity.Users; 4 | import com.wind.mapper.UsersMapper; 5 | import com.wind.service.UsersService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-08-21 11:00 14 | */ 15 | @Service 16 | public class UserServiceImpl implements UsersService { 17 | 18 | @Autowired 19 | private UsersMapper usersMapper; 20 | 21 | @Override 22 | public int addUser(Users user) { 23 | int i = usersMapper.addUser(user); 24 | return i; 25 | } 26 | 27 | @Override 28 | public int deleteUser(Integer id) { 29 | int i = usersMapper.deleteUser(id); 30 | return i; 31 | } 32 | 33 | @Override 34 | public int updateUser(Users user) { 35 | int i = usersMapper.updateUser(user); 36 | return i; 37 | } 38 | 39 | @Override 40 | public List getUsers() { 41 | List users = usersMapper.getUsers(); 42 | return users; 43 | } 44 | 45 | @Override 46 | public Users findById(Integer id) { 47 | Users byId = usersMapper.findById(id); 48 | return byId; 49 | } 50 | 51 | @Override 52 | public List findByName(String userName) { 53 | List byName = usersMapper.findByName(userName); 54 | return byName; 55 | } 56 | 57 | @Override 58 | public Users loginUser(Users users) { 59 | Users users1 = usersMapper.loginUser(users); 60 | return users1; 61 | } 62 | 63 | @Override 64 | public void deleteBatch(List ids) { 65 | usersMapper.deleteBatch(ids); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/impl/AdminServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wind.service.impl; 2 | 3 | import com.wind.entity.Admin; 4 | import com.wind.mapper.AdminMapper; 5 | import com.wind.service.AdminService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-08-21 10:59 14 | */ 15 | @Service 16 | public class AdminServiceImpl implements AdminService { 17 | 18 | @Autowired 19 | private AdminMapper adminMapper; 20 | 21 | @Override 22 | public int addAdmin(Admin admin) { 23 | int i = adminMapper.addAdmin(admin); 24 | return i; 25 | } 26 | 27 | @Override 28 | public int deleteAdmin(Integer id) { 29 | int i = adminMapper.deleteAdmin(id); 30 | return i; 31 | } 32 | 33 | @Override 34 | public int updateAdmin(Admin admin) { 35 | int i = adminMapper.updateAdmin(admin); 36 | return i; 37 | } 38 | 39 | @Override 40 | public List getAdmins() { 41 | List admins = adminMapper.getAdmins(); 42 | return admins; 43 | } 44 | 45 | @Override 46 | public Admin findById(Integer id) { 47 | Admin admin = adminMapper.findById(id); 48 | return admin; 49 | } 50 | 51 | @Override 52 | public Admin loginAdmin(Admin admin) { 53 | Admin admin1 = adminMapper.loginAdmin(admin); 54 | return admin1; 55 | } 56 | 57 | @Override 58 | public List findByName(String adminName) { 59 | List byName = adminMapper.findByName(adminName); 60 | return byName; 61 | } 62 | 63 | @Override 64 | public void deleteBatch(List ids) { 65 | adminMapper.deleteBatch(ids); 66 | } 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/js/metisMenu.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * metismenu - v1.1.3 3 | * Easy menu jQuery plugin for Twitter Bootstrap 3 4 | * https://github.com/onokumus/metisMenu 5 | * 6 | * Made by Osman Nuri Okumus 7 | * Under MIT License 8 | */ 9 | !function(a,b,c){function d(b,c){this.element=a(b),this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init()}var e="metisMenu",f={toggle:!0,doubleTapToGo:!1};d.prototype={init:function(){var b=this.element,d=this.settings.toggle,f=this;this.isIE()<=9?(b.find("li.active").has("ul").children("ul").collapse("show"),b.find("li").not(".active").has("ul").children("ul").collapse("hide")):(b.find("li.active").has("ul").children("ul").addClass("collapse in"),b.find("li").not(".active").has("ul").children("ul").addClass("collapse")),f.settings.doubleTapToGo&&b.find("li.active").has("ul").children("a").addClass("doubleTapToGo"),b.find("li").has("ul").children("a").on("click."+e,function(b){return b.preventDefault(),f.settings.doubleTapToGo&&f.doubleTapToGo(a(this))&&"#"!==a(this).attr("href")&&""!==a(this).attr("href")?(b.stopPropagation(),void(c.location=a(this).attr("href"))):(a(this).parent("li").toggleClass("active").children("ul").collapse("toggle"),void(d&&a(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")))})},isIE:function(){for(var a,b=3,d=c.createElement("div"),e=d.getElementsByTagName("i");d.innerHTML="",e[0];)return b>4?b:a},doubleTapToGo:function(a){var b=this.element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},remove:function(){this.element.off("."+e),this.element.removeData(e)}},a.fn[e]=function(b){return this.each(function(){var c=a(this);c.data(e)&&c.data(e).remove(),c.data(e,new d(this,b))}),this}}(jQuery,window,document); -------------------------------------------------------------------------------- /src/main/java/com/wind/util/MailUtil.java: -------------------------------------------------------------------------------- 1 | package com.wind.util; 2 | 3 | import javax.mail.*; 4 | import javax.mail.Message; 5 | import javax.mail.internet.InternetAddress; 6 | import javax.mail.internet.MimeMessage; 7 | import java.util.Properties; 8 | 9 | /** 10 | * 邮件发送的工具 11 | * @author 12 | * */ 13 | public class MailUtil { 14 | 15 | /** 16 | * 发送邮件的方法,自己需要去注册163邮箱账号 17 | * @param to :给谁发送邮件 18 | * @param state :邮件的激活码 19 | * */ 20 | public static void sendMail(String to,int state) throws MessagingException { 21 | //1 创建连接对象 22 | Properties properties = new Properties(); 23 | // 设置邮件服务器 24 | properties.setProperty("mail.smtp.host", "smtp.163.com"); 25 | // 打开认证 26 | properties.setProperty("mail.smtp.auth", "true"); 27 | Session session = Session.getInstance(properties, new Authenticator() { 28 | @Override 29 | protected PasswordAuthentication getPasswordAuthentication() { 30 | return new PasswordAuthentication("邮箱账号", "授权码"); 31 | } 32 | }); 33 | String word=null; 34 | if(state==1){ 35 | word="你的申请已经同意了,请你快来这领养宠物"; 36 | }else if(state==0){ 37 | word="因为你的条件不符合,所有不能同意你的申请"; 38 | }else if(state==2){ 39 | word="有申请成为志愿者的申请,请快去处理"; 40 | } 41 | //2 创建邮件对象 42 | 43 | javax.mail.Message message =new MimeMessage(session); 44 | //2.1 设置发件人 45 | message.setFrom(new InternetAddress("邮箱")); 46 | //2.2设置收件人 47 | message.setRecipient(Message.RecipientType.TO,new InternetAddress(to)); 48 | //2.3 设置邮件主题 49 | message.setSubject("来自XXX网站的邮件"); 50 | //2.4这是正文 51 | message.setContent("

来自流浪猫狗网站的邮件,

"+word+"

","text/html;charset=UTF-8"); 52 | //发送一封激活邮件 53 | Transport.send(message); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/impl/PetServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wind.service.impl; 2 | 3 | import com.wind.entity.Pet; 4 | import com.wind.mapper.PetMapper; 5 | import com.wind.service.PetService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author Mr Wu 13 | * @create: 2019-08-21 10:59 14 | */ 15 | 16 | @Service 17 | public class PetServiceImpl implements PetService { 18 | 19 | @Autowired 20 | private PetMapper petMapper; 21 | @Override 22 | public int addPet(Pet pet) { 23 | int i = petMapper.addPet(pet); 24 | return i; 25 | } 26 | 27 | @Override 28 | public int deletePet(Integer id) { 29 | int i = petMapper.deletePet(id); 30 | return i; 31 | } 32 | 33 | @Override 34 | public int updatePet(Pet pet) { 35 | int i = petMapper.updatePet(pet); 36 | return i; 37 | } 38 | 39 | @Override 40 | public int updateState(Pet pet) { 41 | int i = petMapper.updateState(pet); 42 | return i; 43 | } 44 | 45 | @Override 46 | public List getPets() { 47 | List pets = petMapper.getPets(); 48 | return pets; 49 | } 50 | 51 | @Override 52 | public List findByState(Integer state) { 53 | List pets = petMapper.findByState(state); 54 | return pets; 55 | } 56 | 57 | @Override 58 | public Pet findById(Integer id) { 59 | Pet byId = petMapper.findById(id); 60 | return byId; 61 | } 62 | 63 | @Override 64 | public List findByPetType(String petType) { 65 | List pets = petMapper.findByPetType(petType); 66 | return pets; 67 | } 68 | 69 | @Override 70 | public void deleteBatch(List ids) { 71 | petMapper.deleteBatch(ids); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/wind/service/impl/ApplyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wind.service.impl; 2 | 3 | import com.wind.entity.Apply; 4 | import com.wind.mapper.ApplyMapper; 5 | import com.wind.service.ApplyService; 6 | import com.wind.util.MailUtil; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import javax.mail.MessagingException; 11 | import java.util.List; 12 | 13 | /** 14 | * @author Mr Wu 15 | * @create: 2019-09-05 10:22 16 | */ 17 | @Service 18 | public class ApplyServiceImpl implements ApplyService { 19 | 20 | @Autowired 21 | private ApplyMapper applyMapper; 22 | 23 | 24 | @Override 25 | public int addApply(Apply apply) { 26 | String email="2425549281@qq.com"; 27 | try { 28 | MailUtil.sendMail(email,apply.getState()); 29 | } catch (MessagingException e) { 30 | e.printStackTrace(); 31 | } 32 | int i = applyMapper.addApply(apply); 33 | return i; 34 | } 35 | 36 | @Override 37 | public int updateApply(Apply apply) { 38 | int i = applyMapper.updateApply(apply); 39 | return i; 40 | } 41 | 42 | @Override 43 | public int deleteApply(Integer id) { 44 | int i = applyMapper.deleteApply(id); 45 | return i; 46 | } 47 | 48 | @Override 49 | public List getApply() { 50 | List apply = applyMapper.getApply(); 51 | return apply; 52 | } 53 | 54 | @Override 55 | public Apply findById(Integer id) { 56 | Apply byId = applyMapper.findById(id); 57 | return byId; 58 | } 59 | 60 | @Override 61 | public List findByState(Integer state) { 62 | List byState = applyMapper.findByState(state); 63 | return byState; 64 | } 65 | 66 | @Override 67 | public void deleteBatch(List ids) { 68 | applyMapper.deleteBatch(ids); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/webapp/js/houtai/js/dataTables.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | DataTables Bootstrap 3 integration 3 | ©2011-2014 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(){var f=function(c,b){c.extend(!0,b.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-6'i><'col-sm-6'p>>",renderer:"bootstrap"});c.extend(b.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});b.ext.renderer.pageButton.bootstrap=function(g,f,p,k,h,l){var q=new b.Api(g),r=g.oClasses,i=g.oLanguage.oPaginate,d,e,o=function(b,f){var j,m,n,a,k=function(a){a.preventDefault(); 6 | c(a.currentTarget).hasClass("disabled")||q.page(a.data.action).draw(!1)};j=0;for(m=f.length;j",{"class":r.sPageButton+" "+ 7 | e,"aria-controls":g.sTableId,tabindex:g.iTabIndex,id:0===p&&"string"===typeof a?g.sTableId+"_"+a:null}).append(c("",{href:"#"}).html(d)).appendTo(b),g.oApi._fnBindAction(n,{action:a},k))}};o(c(f).empty().html('